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

Adding custom bar series to strategy

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

    Adding custom bar series to strategy

    Hello,
    Hopefully a quick and easy one, I have written my own custom Bar Type in NT8 and want to add it to a strategy however I can't for the life of me figure out what to put in the BarsPeriodType for the AddDataSeries, any help would be much appreciated.

    #2
    Originally posted by ScotCyGuy View Post
    Hello,
    Hopefully a quick and easy one, I have written my own custom Bar Type in NT8 and want to add it to a strategy however I can't for the life of me figure out what to put in the BarsPeriodType for the AddDataSeries, any help would be much appreciated.
    You need to assign a unique ID for your bar type, then use the ID to call the bar type in AddDataSeries.

    For example, I assign my ninZaRenko bar's ID to 12345. Then we can add the data series as follows:

    AddDataSeries(new BarsPeriod() {
    BarsPeriodType = (BarsPeriodType)12345,
    Value = 8,
    Value2 = 4
    });

    ____________

    And here is how I set the ID, which should be done in SetDefaults:

    BarsPeriod = new BarsPeriod {
    BarsPeriodType = (BarsPeriodType)12345,
    BarsPeriodTypeName = "ninZaRenko",
    };
    ninZa
    NinjaTrader Ecosystem Vendor - ninZa.co

    Comment


      #3
      Gah I knew it would be straight forward...thanks a lot for your help

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by andrewtrades, Today, 04:57 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      6 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      7 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X