Defining last candle on chart

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #86598 quote
    Andyswede
    Participant
    Master

    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

    Last-candle.jpg Last-candle.jpg
    #86600 quote
    robertogozzi
    Moderator
    Master

    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.

    Andyswede thanked this post
    #86601 quote
    Vonasi
    Moderator
    Master

    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!

    Andyswede thanked this post
    #86605 quote
    Andyswede
    Participant
    Master

    Ok, thank’s to both of you:)

    #86656 quote
    Nicolas
    Keymaster
    Master

    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)
  • You must be logged in to reply to this topic.

Defining last candle on chart


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Andyswede @andyswede Participant
Summary

This topic contains 4 replies,
has 4 voices, and was last updated by Nicolas
7 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/09/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...