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

Define a new series for bars!

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

    Define a new series for bars!

    Hello,
    I wanted to attribute a new series to the bars. Which acts almost like a bool flag.

    If condition 1 is met, I will assign the value of 1 to the series, and if condition 2 is met, I will assign the value -1 to the series, and if none of them are met, I will set the value of the series to 0.

    And in my strategy when bars are loaded. I want that series to be calculated for historical bars. To continue to use it.

    For example, suppose each bar has 5 parameters: open, high, low, close, and volume, and we want to add a sixth parameter called the bool flag to it.

    Do you have an idea?

    #2
    Hello alichi50,

    Thanks for the post.

    What you are describing can be achieved by using a Series<int> or Series<double> in your strategy. To modify the actual bar series to include a new value would require making a BarsType and a custom method to retrieve that value. Your strategy is already configured to parse the existing bars and has the ability to make new series which match the amount of bars on the chart so that is a more appropriate place to do this type of series.

    There is a general example of making a series in the following page:
    https://ninjatrader.com/support/help...t8/seriest.htm

    There is a sample of using a bool series here, bool series does not have to be used you can change the type to int or double as well. This is just a working example and can also be used in a strategy: https://ninjatrader.com/support/help...alues_that.htm

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by FrancisMorro, Today, 03:24 AM
    0 responses
    1 view
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,769 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    10 views
    0 likes
    Last Post Max238
    by Max238
     
    Working...
    X