Announcement

Collapse
No announcement yet.

Background not changing

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

  • Background not changing

    Hello,

    I am creating a simple non-price study. Attached is the EFS. Basically, I want to change the background colors when the Simple Moving Averages for different values meet certain condition. I was able to draw the SMA on the non-price study. However, the background colors aren't changing.


    Can someone tell me what I am doing wrong?

    -Mike
    Attached Files

  • #2
    Mike,

    The problem is you are comparing the series variables to each other instead of the series values.

    You need to do something like
    if(vSMA5.getValue(-1)<vSMA20.getValue(-1))

    Your return statement should probably also use vSMA5.getValue(0) , etc for your other 2 moving averages. What you have now will show the moving average for the chart interval the efs is loaded into versus the interval of 60 you have for your other moving averages.

    If you're always loading this on a 60 minute chart, then you don't need the inv(60) on lines 9-11.

    Steve

    Comment

    Working...
    X