Announcement

Collapse
No announcement yet.

Previous Bollinger value

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

  • Previous Bollinger value

    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 ?.
    Last edited by Mike2; 04-26-2005, 04:21 AM.

  • #2
    Mike2
    Use studybb.getValue(BollingerStudy.UPPER,-nn); where -nn is the number of bars back you want to retrieve
    Alex

    Comment

    Working...
    X