Announcement

Collapse
No announcement yet.

Histogram loads with wrong value

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

  • Histogram loads with wrong value

    I have an EFS that draws a histogram of some calculated values using the Bid and the Ask as input.
    Though I set the variable to zero when I initialize it, as well as in the pre-main, when the EFS first loads, the histogram loads w/some other value (not zero). I suspect this is somehow related to the fact that Bid and Ask are not available for historical data.
    Is there a line to put into the beginning of my EFS code that checks to see if the script is just loaded, and will force that value to zero for all prior bar data?

  • #2
    f1sh7
    Try setting the value of the variable to 0 inside a condition that checks for BARSTATE_ALLBARS or when getCurrentBarIndex() is less than 0.
    Alternatively add the following line to the top of main()
    If (getCurrentBarIndex() < 0) return;
    Alex

    Comment


    • #3
      Ah, thx a ton!...

      Comment


      • #4
        f1sh7
        You are most welcome
        Alex

        Comment


        • #5
          I tried both of those, Alex... no luck.

          Checking for BARSTATE_ALLBARS does nothing, and using getCurrentBarIndex()<0 causes the EFS to return all the time w/out ever executing.

          Any other ideas?

          PS
          This is on a TICK chart, by the way, if that matters.
          Last edited by fish7; 07-20-2007, 04:40 AM.

          Comment


          • #6
            f1sh7
            Post your code or a working sample script that illustrates the issue and someone may be able to help you
            Alex

            Comment

            Working...
            X