Announcement

Collapse
No announcement yet.

Colors issues

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

  • Colors issues

    I know it is probably a very simple thing but I just cant figure it out.

    This indicator changes color green if going up red for down.

    when I load it on new chart all is good however it will not print correctly on a bar by bar basis.

    Probably missing 1 line of code but which one is the question.

    Thank you in advance
    Attached Files

  • #2
    Re: Colors issues

    Hi richbois,

    In your code, you are referring to myVarS1 = myStudyS.getValue(1); which as the historical chart info is being loaded is one bar into the future. The proper format to refer to the last bar value is myVarS1 = myStudyS.getValue(-1);

    I assume this will fix things for you.

    Originally posted by richbois
    I know it is probably a very simple thing but I just cant figure it out.

    This indicator changes color green if going up red for down.

    when I load it on new chart all is good however it will not print correctly on a bar by bar basis.

    Probably missing 1 line of code but which one is the question.

    Thank you in advance

    Comment


    • #3
      Thank you Steve

      That was so easy and obvious but I couldnt see the forest for the trees.

      Comment


      • #4
        Hi richbois,

        You are most welcome, good to hear that helped.

        Comment

        Working...
        X