Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Beginner to Edit Strategies (with multiple time frame)

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

    Beginner to Edit Strategies (with multiple time frame)

    Hi there,

    I’m a novice to NinjaTrader and I’m starting to make my first strategies with the “Condition Builder”, without hard coding.

    The strategy I would like to set up involves the combination of indicators done on different time-frames, to give an easy example, if:

    - The daily 100 bars SMA > daily 200 bars SMA
    - I want to trade the 60 minutes intraday crossover of 20 bars SMA > daily 50 bars SMA.

    I guess this is very easy to do but in Strategy Condition Builder I do not find any field were I can set up the different time-frames for each indicator, only the periods for each indicator.

    So my questions are:

    - can I set-up, in the Strategy Condition Builder, a strategy like this one without knowing to code?


    - if the only way is to unlock the code is there any tutorial were I can learn to do it (without having previous knowledge of coding)


    Many thanks
    Paulo

    #2
    Hi Paulo, thanks posting - unfortunately working with multiple series would not be possible in the wizard interface > you would need custom code in our NinjaScript editor for this task. What you can start reviewing is the per default installed 'SampleMultiTimeFrame' strategy we ship with NinjaTrader, here you could see a working code example in action.

    It might be a bit overwhelming at first read, but here's the full documentation on our MultiSeries framework which can act as reference - http://www.ninjatrader.com/support/h...nstruments.htm

    Comment


      #3
      Multi time frame errors

      I am new in NT and trying to convert from Strategy Trader to NT. I am using two timeframes of 60 and 240 minutes. I need right code to 2nd timeframe to get data.

      In ST code, I use BarOfData(2).High[0] to point to 2nd timeframe to get High price.

      I use High[2][0] but I got errors. What is the right code in here?

      Many thanks in advance.
      -traderjh

      Code:
      #region Using declarations
      using System;
      using System.ComponentModel;
      using System.Diagnostics;
      using System.Drawing;
      using System.Drawing.Drawing2D;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Data;
      using NinjaTrader.Indicator;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Strategy;
      #endregion
      
      // This namespace holds all strategies and is required. Do not change it.
      namespace NinjaTrader.Strategy
      {
          /// <summary>
          /// Display data on the chart
          /// </summary>
          [Description("Display data on the chart")]
          public class ShowData : Strategy
          {
              #region Variables
              // Wizard generated variables
              // User defined variables (add any user defined variables below)
              #endregion
              /// <summary>
              /// This method is used to configure the strategy and is called once before any strategy method is called.
              /// </summary>
              protected override void Initialize()
              {
                  CalculateOnBarClose = false;
      			Add(PeriodType.Minute, 60);
      			Add(PeriodType.Minute, 240);
              }
              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {
      			DrawTextFixed("Show Position", "Position: " 
      				+"\nHi: " + High[0][0],5.ToString() + "\nLo: " + Low[0][0],5.ToString()
      				+"\nHi: " + High[1][0],5.ToString() + "\nLo: " + Low[1][0],5.ToString(), TextPosition.TopLeft);
      		}
      
              #region Properties
              #endregion
          }
      }

      Comment


        #4
        traderjh, you would want to use Highs[2][0] here instead, the added s points to the multiseries method you would need to designate from which series index to 'get' the high price values.

        Comment


          #5
          How Do I use the Strategy wizard to call a strategy when

          Suppose I have a buy signal on one strategy How to I incorporate that signal into another
          strategy wich would then place an order when it became a buy as well

          Is there a you tube video of an example of using the strategy wizard to create a multi
          time frame strategy ?

          Comment


            #6
            WaveTools, welcome to our forums - generally Strategies would not cross communicate so you would not be able to call the signal from Strategy A into Strategy B. One option would be combining scripts into one and then checking for the conditions to happen at the same time (or lets say 1 bar apart).

            For the MultiSeries / Instrument scripts - unfortunately the wizard would not offer the creation of those, this would need to be done directly via custom coding. We ship NT with an example called 'SampleMultinstrument'.

            Comment


              #7
              Mulit Instrument

              Hello How would you enter information to judt do a sample with the multi instrument
              template I just wana see one work as an example of what to enter and where.

              Comment


                #8
                Have you looked at the SampleMultiTimeFrame strategy under Tools--> Edit NinjaScript--> Strategy?

                Please also have a look at our Sample Multi-Time Frame orders reference:

                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Multi Time Frame continued

                  Hello Thank you for your help and for the links Im still refining my question so I appreciate your patience

                  Here Is where I can use some guidance : I have begun to learn how to use the sample Ma crossover template to create a strategy. I have done that by selecting that example and then inputting the variable numbers into the sample feilds that are available in the strategy.

                  I would like to do a practice multi time frame strategy in that same way but I get stuck
                  because when I select that as a strategy I cannot understand whch feilds I can select
                  withiin that sample to create a rudimentary practice example.

                  I learned how to create a sample MA strategy by watching one of your grreat videos
                  is there a similar video for fillling in the sample feilds for the multi time frame strategy ?

                  Comment


                    #10
                    WaveTools, unfortunately for the MultiTimeFrame script there would not be a video available explaining it, but thanks for the idea. Generally you could not recreate it's actions via the wizard point and click interface, you would need to code or modify the code example we pointed to that's shipped with NT.

                    For our indepth documentation for this environment, including examples, please check this helpguide link out - http://www.ninjatrader.com/support/h...nstruments.htm

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    669 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    378 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    111 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    575 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    580 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X