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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    54 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    34 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    57 views
    0 likes
    Last Post PaulMohn  
    Working...
    X