Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Finding OHLC in BaseBarsPeriodType within custom bartype

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

    Finding OHLC in BaseBarsPeriodType within custom bartype

    Hi there,

    I have made daily renko bars. The BaseBarsPeriodType is Day bars so historical values are gathered from Day bar values. I actually just use Open and close values since I cannot ascertain if the high or low occurred first. ( Any proxy ideas for using Day HL would be welcome )

    However I also wish to access OHLC values of these day bars historically.

    I cannot use bars.GetDayBar(n) since the BaseBarsPeriodType is not intraday.

    I can access day OHLC 'realtime' every OnDataPoint() through the vars open, high , low and close however how do I access these values historically?

    I thought about using List and storing values via List.Add.
    This would work fine with EOD data. However in case a real-time connection is available the current bar values would continuously add to the list every price change. How would I circumvent this? Using a 'barTime' condition?

    Obviously a simple, more efficient route would be better.

    Thank you.

    #2
    Hello Sim22,

    Thank you for your post.

    BarsTypes are used to create and edit current bars with no real intention to edit historical values or pull from historical values.

    You may find better use of OnRender() in an indicator to create the custom bars you are looking for. Similar to the process used for the HeikenAshi indicator in NinjaTrader 7. This would allow for accessing to historical values on the chart.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rhyminkevin, Today, 04:58 PM
    1 response
    42 views
    0 likes
    Last Post Anfedport  
    Started by iceman2018, Today, 05:07 PM
    0 responses
    5 views
    0 likes
    Last Post iceman2018  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    7 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    14 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    49 views
    0 likes
    Last Post futtrader  
    Working...
    X