Announcement

Collapse
No announcement yet.

Wrong Background Color

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wrong Background Color

    I would like to change the background color to yellow when LSMA is above EMA, and to grey when LSMA is below EMA. However, my chart doesn't look correct.... Pls help

    This study plots the LSMA but not the EMA... but I am including another EMA line in the chart below so I can check whether the background color is correct or not.
    - LSMA ("test.efs"): green line
    - EMA: brown/blue line (brown if close < EMA, blue if close > EMA)

    Pls note that the LSMA portion is downloaded from the forum and it works. And the EMA portion is taken from the builtin library directly.... so I don't understand why the background color is not correctly displayed.

    Attached Files
    Last edited by Richard Yu; 02-27-2005, 08:15 AM.

  • #2
    Richard
    Unless you have a specific reason it is considerably simpler to use a builtin ema study rather than creating your own. See attached (changes are commented in the script)
    Alex
    Attached Files

    Comment


    • #3
      Thank you...

      Right now I hv to call the EMA twice.... One call is for the LSMA study so that the LSMA and EMA can be compared and the LSMA will be plotted. Another call is for plotting the EMA. Can it combine them so I don't hv to call twice.

      Pls note that when I plot the EMA, it will show blue if close is above it and brown if close is below it. thx.

      Comment


      • #4
        Richard
        Not sure what you mean by "have to call the EMA twice".
        If you also want to plot the EMA just replace the return statement
        return LSMA_Array[nOffset];
        with
        return new Array (LSMA_Array[nOffset],dThisMA);
        Then all you need to do is add some statements in preMain for the color and thickness of the EMA plot
        Alex

        Comment

        Working...
        X