Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating a Custom Bar Type - Understanding Parameters

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

    Creating a Custom Bar Type - Understanding Parameters

    So, to overcome the dilemma that I mentioned about adding a secondary dataseries to an indicator in a previous post, I have revisited the creation of custom bar type. I am using code downloaded from the ecosystem link, namely SveRenkoBarsType, as a template. I have downloaded both the NT7 and NT8 versions to compare. It looks like they are using the previous Open, High, Low, and Close and calling it the current open, high, low, close? However, both the Add function in version NT7 and the OnDataPoint function in NT8 seem to pass a open, high, low, and close.

    NT7 Code:
    Bar bar = (Bar)bars.Get(bars.Count - 1);
    Bar barprev = (Bar)bars.Get(bars.Count - 2);
    NT8: Code:
    double barOpen = bars.GetOpen(bars.Count - 1);
    double barHigh = bars.GetHigh(bars.Count - 1);
    double barLow = bars.GetLow(bars.Count - 1);
    long barVolume = bars.GetVolume(bars.Count - 1);
    if this is the case, what exactly is the open,high,low,close being passed into these functions?

    #2
    Hello jeliner,

    Thanks for your post.

    OnDataPoint will iterate from data coming through the base bars type. I.E. Tick, Minute, or Day. This base bars type will provide the open, high, low, close, time, and volume parameters of OnDataPoint. bars will reflect the barstype you are building, so for example, bars.GetOpen() will get the open assigned to the bar with AddBar().

    Explanations on these parameters can be found in our OnDataPoint() documentation.

    OnDataPoint - https://ninjatrader.com/support/help...ndatapoint.htm

    If you have any additional questions, could you elaborate on your goals so we can offer further direction?

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X