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

Three Period Strategy with DataSeries

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

    Three Period Strategy with DataSeries

    Hello,

    I'm setting up a strategy with several DataSeries on three time-frames.

    I've looked at the SampleDataSeries and the SampleMultiTimeFrameOrders for ideas. I don't want to overload my script but I'm using this quantity of DataSeries for three time periods
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]
    [SIZE=2][FONT=Courier New][COLOR=#0000ff]private[/COLOR][/FONT][/SIZE][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] DataSeries primaryLRHigh;[/SIZE][/FONT]
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] DataSeries secondaryLRHigh;[/SIZE][/FONT]
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] DataSeries tertiaryLRHigh;[/SIZE][/FONT]
     
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]...[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
    [FONT=Courier New][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] DataSeries primaryPrevMidpoint;[/SIZE][/FONT]
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] DataSeries secondaryPrevMidpoint;[/SIZE][/FONT]
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] DataSeries tertiaryPrevMidpoint;[/SIZE][/FONT]
     
    [/SIZE][/FONT]
    Am I trying to get too much data? or do I need to filter out some data somehow or ??? I really only need for the past 3 or 4 bars anyway.

    I may be missing some required lines to go further. I tried it so far with an attempt to print data to the output window and it does'nt go too far.

    Thanks for any direction you can send me...

    Kirk
    Attached Files

    #2
    Sorry. Not sure I follow. What is the problem you are having? You have a lot of DataSeries here, but let us just keep it simple. Please describe your issue in relation to 1 DataSeries. All the rest are done in exactly the same way.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I've tried to follow the samples per each dataseries. The samples are only showing 1 SMA and 1 rangevalue close-open. My project is using three time frames and nine or more indicators. Is this too many?

      I'm not sure why I can't get the more of the current bar's data on the printout to the output window even though the first few print lines work.

      If I'm overloading the strategy with too many dataseries, I want to know that. I have to use several of them but can eliminate some of them if need be. If I'm missing one key ingredient because I didn't understand where it says regarding the SMA:

      /* Syncs another DataSeries object to the secondary bar object.
      We use an arbitrary indicator overloaded with an IDataSeries input to achieve the sync.
      The indicator can be any indicator. The DataSeries will be synced to whatever the
      BarsArray[] is provided.*/

      Comment


        #4
        Kirk,

        There is no hard coded limit as to how many you can use. I still fail to understand what issue you are having. I suggest you just start with one set and work up from there. Look in Control Center for errors. If no errors then you will need to debug with Print().
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          thanks for your reply,

          I've gone ahead and added one at a time and I saw my missing line items.

          I think I can move ahead now.

          Thanks,

          kz

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Jimmyk, 01-26-2018, 05:19 AM
          6 responses
          835 views
          0 likes
          Last Post emuns
          by emuns
           
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,291 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          10 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          11 responses
          62 views
          0 likes
          Last Post halgo_boulder  
          Started by Option Whisperer, Today, 09:55 AM
          0 responses
          9 views
          0 likes
          Last Post Option Whisperer  
          Working...
          X