Store Indicator Value At Bar Open

Forums ProRealTime English forum ProBuilder support Store Indicator Value At Bar Open

Viewing 2 posts - 1 through 2 (of 2 total)
  • #83162
    Ξ3

    I am able to identify the opening tick of a new X-tick bar using the below code, but is there a way to store a value at this point in time?

    With each new tick that arrives, the value of my indicator changes but I would like to compare it to the value at the bar open (which will be different from the previous bar close value).

    As soon as the “NewBarOnChart” is false (from tick 2 onwards), I lose the opening value of my indicator. Can I somehow store it?

    // -> Bar On Chart
    CurrTime = CurrentTime + (10000 * TimeZoneAdjustment)
    LastBarOnChart = (Date = Today)
    LastBarOnChart = LastBarOnChart AND (CurrTime = OpenTime)
    LastBarOnChart = LastBarOnChart AND (Time >= CurrTime)
    NewBarOnChart = LastBarOnChart
    NewBarOnChart = NewBarOnChart AND (Time = OpenTime)

    #83184

    This is a common problem because variables are reset at their default values, each new tick received, in the current bar.

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login