Announcement

Collapse
No announcement yet.

ref(-1)

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

  • ref(-1)

    Why does ref(-1) return a null when using setComputeOnClose(); in the premain and getCurrentBarIndex()==-1?

    Thanks

    Bob Turner

  • #2
    ref(-1) will return null for the oldest bar on the chart, which is typical. The only reason I can think of for it to return null when the bar index = -1 is that the indicator study didn't return a value to eSignal. For my indicators this doesn't happen....

    G
    Garth

    Comment


    • #3
      G,
      Thanks but my indicator did have a value at -1. What was strange is that it only happens AFTER getCurrentBarIndex() > -2 and setComputeOnClose() is called from the Premain. If setComputeOnClose() is not called I get values for ref(-1)... go figure

      Bob
      Originally posted by gspiker
      ref(-1) will return null for the oldest bar on the chart, which is typical. The only reason I can think of for it to return null when the bar index = -1 is that the indicator study didn't return a value to eSignal. For my indicators this doesn't happen....

      G

      Comment

      Working...
      X