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

Convert strategy to Multi time frame

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

    Convert strategy to Multi time frame

    Hey fellas -

    I have a perfectly working strategy on a single timeframe (400 Tick) but I want to slightly modify it to enter and roll stops using a lower timeframe (200 Tick). From my limited understanding of the Help, are these the only steps that need to be taken?

    1. Add both Data Series (400 and 200 Tick).

    2. Specify the 200 tick data series for my EnterLong/EnterShort orders.

    3. Specify the 200 tick data series for my SetStopLess orders.

    Is that all that needs to be done?

    Also, I'm assuming that the Strategy Analyzer can only show 1 chart and I guess it's the Primary?

    Thanks in advance.

    #2
    Hello PN720,

    Yes, you would need to add an additional series of 200 tick. Then you would want to include a condition that BarsInProgress is 1 to the condition set that triggers the order submission.

    Below is a public link to the help guide on BarsInProgress.


    As well as a link to the reference sample that demonstrates adding a series to a script.



    Set methods (such as SetStopLoss()) will always reference the primary series. If you want the historical data to fill orders using the 200 tick series, you would need to use Exit methods like ExitLongStop() and supply the BarsInProgress 1.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,
      A couple of follow up questions :

      1. From the sample code, the comments say that the secondary data series must be smaller than the first. Is this true? I was considering reversing my approach and running the strategy on the 200 tick chart as primary and only specifying entry criteria on the 400 tick chart.

      2. Do I need to add the same chart indicators to both data series?

      Comment


        #4
        Hello PN720,

        The example is specifically using the secondary series for intra-bar granularity. To be intra-bar the secondary series must be of a smaller interval than the primary.

        But that is not required for adding a secondary series. You can add any bar type or interval size you would like for your purposes.

        You can use the secondary series for the input series of an indicator if you would like. By default any called will use the primary series for its input unless a different series is provided.

        There is a reference sample that demonstrates this. Below is a public link.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jclose, Today, 09:37 PM
        0 responses
        5 views
        0 likes
        Last Post jclose
        by jclose
         
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        10 responses
        1,413 views
        0 likes
        Last Post Traderontheroad  
        Started by firefoxforum12, Today, 08:53 PM
        0 responses
        11 views
        0 likes
        Last Post firefoxforum12  
        Started by stafe, Today, 08:34 PM
        0 responses
        11 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by sastrades, 01-31-2024, 10:19 PM
        11 responses
        169 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X