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 jxs_xrj, 01-12-2020, 09:49 AM
    4 responses
    3,281 views
    1 like
    Last Post jgualdronc  
    Started by Option Whisperer, Today, 09:55 AM
    0 responses
    5 views
    0 likes
    Last Post Option Whisperer  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    8 responses
    58 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by halgo_boulder, 04-20-2024, 08:44 AM
    2 responses
    22 views
    0 likes
    Last Post halgo_boulder  
    Started by mishhh, 05-25-2010, 08:54 AM
    19 responses
    6,189 views
    0 likes
    Last Post rene69851  
    Working...
    X