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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        45 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        14 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        20 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X