Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom DataSeries in Strategy

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

    Custom DataSeries in Strategy

    I need to create a custom dataseries object, based on the "primary bars" in a strategy. I need my dataseries to stay in sync with the primary bars for the strategy.
    Previously, for an Indicator I used the sample code provided:
    myDataSeries = new DataSeries(this);
    Would the same code work in a strategy to achieve what I have described above?
    Lastly, How could I do the same thing, except I would like my custom dataseries to stay in sync with the second or third Bars object?
    Last edited by astrolobe; 12-02-2007, 09:00 PM.

    #2
    Correct.
    To sync to a secondary bar object see this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=3572
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh, thanks for the solution.
      In your strategy example you have:
      secondarySeries = new DataSeries(SMA(BarsArray[1], 50));

      Do I have to use some arbitary Indicator, or could I just use the BarsArray[1]?
      Also, I am just curious...why are we not able to access the BarsArray property in the Initialize?

      Comment


        #4
        You should use an arbitrary indicator.
        There are probably some under-the-hood design reasons for why BarsArray is not accessible in the Initialize() method.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        567 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 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
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X