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

HELP prgramming mutiple time frames in strategy wizard

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

    HELP prgramming mutiple time frames in strategy wizard

    Is it possible to prgram a mutiple time strat in strategy wiazrd, we are building a 1 minute strat, that needs to look at the MACD cross on a 3 minute chart before executing the trade. Any ideas? Also we are looking for a method that will time the idications of trade. For example, our first condition is a EMA cross, following that we are looking for higher highs Etc, these need to occur no more then a max of 7 minutes after the cross before possible trade is disregarded. Your help is appreaciated... MIke

    #2
    >> Is it possible to prgram a mutiple time strat in strategy wiazrd
    Unfortunately not. You would need to code manually.

    Comment


      #3
      Any ideas on what that should look like in hard code?

      Comment


        #4
        You would need to roll up your sleeves and dig into NinjaScript coding. There is a wealth of information in the help guide e.g. here: http://www.ninjatrader-support.com/H...verview39.html

        Also: check out SampleMultiTimeFrame strategy

        As last resort there are certified NinjaScript consultants at your help: http://www.ninjatrader.com/webnew/pa...injaScript.htm

        Comment


          #5
          great Ill take a look, by the way your product is great, well thought out. Ill be buying lifetime key as soon as we get start to work properly

          Comment


            #6
            Is this correct code for 2 EMA crosses occuring in different time frames

            is this the corect code?
            if yes please post so that overs will be able to use it as a reference point to which they can control/use multiple time frames.


            // This namespace holds all strategies and is required. Do not change it.
            namespace NinjaTrader.Strategy
            {
            ///<summary>
            /// Enter the description of your strategy here
            ///</summary>
            [Description("Enter the description of your strategy here")]
            publicclass helpme : Strategy
            {
            #region Variables
            // Wizard generated variables
            privateint myInput0 = 1; // Default setting for MyInput0
            // 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>
            protectedoverridevoid Initialize()
            {

            Add(PeriodType.Minute,
            5);
            Add(EMA(
            5));
            Add(EMA(
            10));
            SetProfitTarget(
            "", CalculationMode.Ticks, 10);
            SetStopLoss(
            "", CalculationMode.Ticks, 3, true);
            CalculateOnBarClose =
            true;
            }
            ///<summary>
            /// Called on each bar update event (incoming tick)
            ///</summary>
            protectedoverridevoid OnBarUpdate()
            {
            // Condition set 1
            if (CrossAbove(EMA(5), EMA(10), 7)
            && (BarsInProgress ==
            1)
            && CrossAbove(EMA (BarsArray[
            1], 5), EMA(BarsArray[1], 10), 7))
            {
            EnterLong(DefaultQuantity,
            "");
            }
            }
            #region Properties
            [Description(
            "")]
            [Category(
            "Parameters")]
            publicint MyInput0
            {
            get { return myInput0; }
            set { myInput0 = Math.Max(1, value); }
            }
            #endregion
            }
            }

            Comment


              #7
              I think you might be being redundant in your conditions. If you limit your condition to work in BarsInProgress == 1 you are already in the secondary time frame at start. If you are in the secondary bars object this means EMA(5) is reflective of the secondary bars object and not the primary one. When you do EMA(BarsArray[1], 5) that is still the secondary bar object.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                What would you suggest, I understand it looks redunadant maybe you can steer in me the right direction. Im reading that version 7 will have multi times frames in strategy wizard. when will V7 be released

                Comment


                  #9
                  To clarify:
                  - your code below looks ok. Josh just suggested an alternate, more efficient way to code which essentially would not change any logic -> you can leave
                  - NT 7 will support multi series indicators, but not multi series in the strategy wizard (nor indicator wizard), since multi series logic is way beyond basic level which could be not covered by a wizard

                  Comment


                    #10
                    If you think it looks ok, I have one more question, the Ema was only an example maybe my Macd coding is wrong,

                    if (CrossAbove(Macd(BarsArray[1],12,26,9), Macd(BarsArray[1],12,26,9)
                    do something;

                    In my protectedoverridevoid Initialize()

                    My timeperiod= Add(PeriodType.Minute,3);

                    Guys I cant thank you enough for help, Id buy drinks if I could



                    Comment


                      #11
                      I suggest debugging your strategy as per here: http://www.ninjatrader-support.com/v...ead.php?t=3418

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by judysamnt7, 03-13-2023, 09:11 AM
                      4 responses
                      59 views
                      0 likes
                      Last Post DynamicTest  
                      Started by ScottWalsh, Today, 06:52 PM
                      4 responses
                      36 views
                      0 likes
                      Last Post ScottWalsh  
                      Started by olisav57, Today, 07:39 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post olisav57  
                      Started by trilliantrader, Today, 03:01 PM
                      2 responses
                      21 views
                      0 likes
                      Last Post helpwanted  
                      Started by cre8able, Today, 07:24 PM
                      0 responses
                      10 views
                      0 likes
                      Last Post cre8able  
                      Working...
                      X