I've got a script where I'm retrieving prior bars like this:
f = studyMA.GetValue(MAStudy.MA,-x);
But on my chart when I use this value for large "x" I am getting 0 when I look at the plots by scrolling back on the screen.
So I need to indicate somehow that my script requires X number of bars before it outputs useful info.
Now if I use a scheme like this...
var iNewBars = 0
.....
If (getBarState() == BARSTATE_NEWBAR)
iNewBars++;
if (iNewBars < x)
return null;
...
then I have the case where 90% of my chart does not compute the indicator. However if I scroll back the chart by hand I see that eSignal has the data in that I call getOldestBarIndex() and the value keeps getting more negative as I scroll back, it is just not starting far enough back for me initially.
Is there a way to handl this?
f = studyMA.GetValue(MAStudy.MA,-x);
But on my chart when I use this value for large "x" I am getting 0 when I look at the plots by scrolling back on the screen.
So I need to indicate somehow that my script requires X number of bars before it outputs useful info.
Now if I use a scheme like this...
var iNewBars = 0
.....
If (getBarState() == BARSTATE_NEWBAR)
iNewBars++;
if (iNewBars < x)
return null;
...
then I have the case where 90% of my chart does not compute the indicator. However if I scroll back the chart by hand I see that eSignal has the data in that I call getOldestBarIndex() and the value keeps getting more negative as I scroll back, it is just not starting far enough back for me initially.
Is there a way to handl this?
Comment