Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    22 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    10 views
    0 likes
    Last Post cre8able  
    Working...
    X