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 cmoran13, Yesterday, 01:02 PM
        0 responses
        31 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        22 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        151 views
        2 likes
        Last Post CaptainJack  
        Working...
        X