I have an efs which shows historical results of bollinger bands.
I want to be able to measure results based on the previous bar's values.
I can get this to work in real time using
if (getBarState() == BARSTATE_NEWBAR) UpperPrevious = Upper;
However, if I try using
UpperPrevious = Upper(-1);
I get no result.
My premain is
var studybb = new BollingerStudy(20, "Close", 2.0);
and in main I have
var Upper = studybb.getValue(BollingerStudy.UPPER);
Is there a way to get the previous bollinger value to be used for calculations whilst drawing the study ?.
I want to be able to measure results based on the previous bar's values.
I can get this to work in real time using
if (getBarState() == BARSTATE_NEWBAR) UpperPrevious = Upper;
However, if I try using
UpperPrevious = Upper(-1);
I get no result.
My premain is
var studybb = new BollingerStudy(20, "Close", 2.0);
and in main I have
var Upper = studybb.getValue(BollingerStudy.UPPER);
Is there a way to get the previous bollinger value to be used for calculations whilst drawing the study ?.
Comment