Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Time Frame strategy help

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

    Multi Time Frame strategy help

    Hi all,

    Hope to elicit some help from you gurus. I'm a beginner trying to implement my strategy idea and I'd like to know how one can monitor the same indicator in all 2 of my charts (a daily, and 4hrs) at once.

    An example would be... say:

    If the last candle closed above the 200 days SMA in a daily AND a 4hr chart then go long.

    I'm not looking for a handme, so a sample code or a point in a general direction to where I can find sample codes or a sample document would be much appreciated. Thank you all and have a blessful day~!

    #2
    Welcome to our forums ChunkyBrown - please have a look at this general outline of the MultiSeries concept in NinjaScript -



    For a sample code strategy, please consider reviewing the SampleMultiInstrument and SampleMultiTimeFrame ones installed per default with your NinjaTrader copy.

    Comment


      #3
      Thank you very much Bertrand! How does one run the Sample Multi Time Frame Strategy? I ran it and under Strategy Performance and the Summary shows all ZEROs and no trades made. I just need to grasp how it works then I can start hacking the codes to my need. Thanks again!

      Comment


        #4
        ChunkyBrown, on which chart and timeframe are you running it? It could be that you're loading to few days of historical data, if you for example just run it from the strategies tab directly...therefore to understand and start working with it, run it from a chart with 10-20 days of intraday data.

        Comment


          #5
          Thanks for your reply. I'm running it on a Daily chart using the Free Kinetick connection as I only started using NT since last night and it doesnt seem to provide anything else aside from Daily candles.

          Comment


            #6
            Thanks for clarifying, the way it's coded it would require intraday data - please try for example a comment FX spot instrument ($EURUSD) on the free Gain / Forex.com connection we support -

            Comment


              #7
              Hi Bertrand,

              Your advice worked great! I was running the backtest on the SampleMultiTimeFrame strategy on EUR/USD via the free GAIN connection and I noticed that the net profit, net lost etc under Summary is different depending on the timeframe I selected under "Data Series" when choosing the parameters for the new strategy. I thought the timeframes were defined in the code in the Initialize() method. Please clarify. Thank you so kindly!

              Comment


                #8
                I think i might be able to answer my own question, but please tell me if i'm right or wrong. Index[0] always is the timeframe in the Data Series i selected and the rest of the Index[n] will be whatever i define in the codes? Say if I did Add(PeriodType.Minute, 5) that would be index[1]?

                Comment


                  #9
                  You're welcome, this is correct - the primary one (BIP 0) is the one you select to run the strategy on and the Add()-ed ones are found in the strategy's Initialize().

                  Comment


                    #10
                    Nevermind. I got it. Read it in the document. Sorry for posting so many times. Thanks!

                    Comment


                      #11
                      No worries, great you got it.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      649 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      576 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X