Defining last candle on chart

Forums ProRealTime English forum ProBuilder support Defining last candle on chart

Viewing 5 posts - 1 through 5 (of 5 total)
  • #86598

    Hi! A maybe simple question: How do I define the last formed candle on a chart with the value of for example 1?

    Best regards, Andy

    #86600

    The current candle being formed is referred to as [0] or nothing. [1 ] is the first previous, [2] the second previous,….

    So HIGH[2] is the HIGH price of the second previous candle.

    This is true for ProBuilder and ProScreener which both access candles live, while ProOrder deals only with closed candles, so [0] or nothing refers to the last closed candle, whch is considered the current candle.

    1 user thanked author for this post.
    #86601

    Not sure I fully understand the question but here goes…

    The currently forming candle (the last one on the chart) is always [0]. The candle before it is [1] and the one before that is [2] and so on.

    So if you want to know any of the values or indicator values of the currently forming candle then you want to look at high[0], low[0], average[12](close[0]) etc. You can omit the [0] in your code as if there is no value then PRT code just assumes that it is zero.

    EDIT: I think we were typing at the same time Roberto!

    1 user thanked author for this post.
    #86605

    Ok, thank’s to both of you:)

    #86656

    Stop me if I’m wrong, but I think that Andy is looking for a code to know if the last visible candle on the bar is the last one?

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

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