Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get OHLC from all bars in chart?

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

    Get OHLC from all bars in chart?

    deleted...
    Last edited by defa0009; 09-20-2024, 03:31 PM.

    #2
    Hello defa0009,

    Thank you for your post.

    On each pass of OnBarUpdate, all loaded bars will be processed individually. So you can access the OHLC of the current bar processing by simply calling Close[0], Open[0], High[0], Low[0].
    This would work best for an indicator running OnBarClose as all final OHLC values will be known at the time the bar closes.

    If you are using OnEachTick or OnPriceChange you should instead use 1 bar ago instead of 0 bars ago to access the OHLC of the previously closed bar i.e. Close[1], Open[1], etc.



    Please let us know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X