Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pop up window

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

    #46
    Hi bernard,

    I am playing with Strategy which is using ATM as per your example.
    How can I include entry by indicator? I mean data like
    SampleBoolSeries().ExposedVariable)
    or Bull/Bear information which I learn to transfer from your example.
    Can I call this information from the indicator inside the new strategy which is ATM strategy?
    I understand that I can recreate the indicator inside this new strategy, which I am going to try.
    can you advise what is possible?

    Thanks
    Peter


    Originally posted by NinjaTrader_Brett View Post
    Hello,

    Sure, please see the following information:



    Also for a sample of how this is done there is one included in your NInjaTrader install.

    Control Center->Tools->Edit NinjaScript->Strategies->SampleATMStrategy.


    Let me know if I can be of further assistance.

    Comment


      #47
      Peter, yes you can call an indicator method as well in the NinjaScript strategy calling the AtmStrategyCreate() - for example below I changed the entry order condition to check if the Close is higher than the SMA of the highs, the SMA could be your custom indicator for example, too -

      if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > SMA(High, 21)[1])
      {
      atmStrategyId = GetAtmStrategyUniqueId();
      orderId = GetAtmStrategyUniqueId();
      AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
      }

      Comment


        #48
        Thank you Bertrand,

        Is there a way how to exclude particular day in backtesting inside the strategy?
        If I want exclude 15Feb 2010.Or include every day exept 15Feb2010

        Thanks
        peter

        Comment


          #49
          Peter, yes that is possible with custom coding as well, just setup as part of entry conditions to satisfy a time / date filter rule as well - http://www.ninjatrader.com/support/h.../nt7/today.htm

          Comment


            #50
            Thank You Bertrand,

            Your help is the best I can think of.

            1)We have existing SampleAtmStrategy and we would like to use Bool series from indicator SampleBoolSeries
            I have changed the second part of 1st line example bellow. I am trying to call Bool series signal from indicator SampleBoolSeries.:
            if (orderId.Length == 0 && atmStrategyId.Length == 0 &&
            (SampleBoolSeries().BullIndication[0])
            {
            atmStrategyId = GetAtmStrategyUniqueId();
            orderId = GetAtmStrategyUniqueId();
            AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);

            Is this correct?

            2)If we have already the
            SampleBoolSeriesStrategy and indicator
            SampleBoolSeries
            How can we include ATM inside this existing SampleBoolSeriesStrategy ?

            Originally posted by NinjaTrader_Bertrand View Post
            Peter, yes you can call an indicator method as well in the NinjaScript strategy calling the AtmStrategyCreate() - for example below I changed the entry order condition to check if the Close is higher than the SMA of the highs, the SMA could be your custom indicator for example, too -

            if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > SMA(High, 21)[1])
            {
            atmStrategyId = GetAtmStrategyUniqueId();
            orderId = GetAtmStrategyUniqueId();
            AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
            }

            Comment


              #51
              Thanks for the kind words Peter, you're welcome - the snippet looks correct to me. I'm not 100% sure I follow your second question though - you would need to modify the SampleBoolSeries code then and work the AtmStrategyCreate() calls / ATM strategy related methods into it.

              Comment


                #52
                Thank you Bernard,

                I wanted to ask if its possible to transfer buy ,sell and exits signals from NT7 to other platforms like MT4 platform or other broker who does cash forex?

                This is just note for me :How to print out information about all the trades:
                : http://www.ninjatrader.com/support/f...ad.php?t=38007

                Thanks
                Peter

                Comment


                  #53
                  Peter,

                  Unfortunately we do not support sending signals to MT4. NT can send signals to any brokerage we support. You can find the various provider technologies we support here: http://www.ninjatrader.com/support/h...rical_data.htm
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #54
                    Hi Bernard,

                    I have combined together examples SampleAtmStrategy and indicator SampleBoolSeries.
                    In the example bellow I have included in SampleAtmStrategy line calling BullIndication[0] signal from SampleBoolSeries. Is this script now correct?
                    Is there way how to backtested, forwardtested ATM strategies?
                    I was testing SampleAtmStrategy and trades were taken without any order.
                    Something was wrong.

                    Thanks
                    peter


                    // HELP DOCUMENTATION REFERENCE: Please see the Help Guide section "Using ATM Strategies"
                    // Make sure this strategy does not execute against historical data
                    if (Historical)
                    return;
                     
                    // Submits an entry limit order at the current low price to initiate an ATM Strategy if both order id and strategy id are in a reset state
                    // **** YOU MUST HAVE AN ATM STRATEGY TEMPLATE NAMED 'AtmStrategyTemplate' CREATED IN NINJATRADER (SUPERDOM FOR EXAMPLE) FOR THIS TO WORK ****
                    if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > Open[0]
                    && SampleBoolSeries().BullIndication[
                    0]
                    )
                    {
                    atmStrategyId = GetAtmStrategyUniqueId();
                    orderId = GetAtmStrategyUniqueId();
                    AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[
                    0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
                    }

                    Comment


                      #55
                      Hi Bernard,
                      1)What is "double limitPrice" in AtmStrategyCreate()? In example
                      "AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Market, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);"
                      we have Low[0] as "double limitPrice". Is this the lowest price in entry?
                      If we put "0" instead of Low[0] what will happen?

                      2)I preffer to use market order for now. The statement can look like this for short?
                      ""AtmStrategyCreate(Cbi.OrderAction.Sell, OrderType.Market, 0, 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);""

                      3)Can I use more than 1 AtmStrategies or other strategies on 1 instrument at the same time?

                      4)
                      I have combined together examples SampleAtmStrategy and indicator SampleBoolSeries.
                      In the example bellow I have included in SampleAtmStrategy line calling BullIndication[0] signal from SampleBoolSeries. Is this script now correct?
                      Is there way how to backtested, forwardtested ATM strategies?
                      I was testing SampleAtmStrategy and trades were taken without any order.
                      Something was wrong.

                      Thanks
                      peter


                      // HELP DOCUMENTATION REFERENCE: Please see the Help Guide section "Using ATM Strategies"
                      // Make sure this strategy does not execute against historical data
                      if (Historical)
                      return;
                       
                      // Submits an entry limit order at the current low price to initiate an ATM Strategy if both order id and strategy id are in a reset state
                      // **** YOU MUST HAVE AN ATM STRATEGY TEMPLATE NAMED 'AtmStrategyTemplate' CREATED IN NINJATRADER (SUPERDOM FOR EXAMPLE) FOR THIS TO WORK ****
                      if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > Open[0]
                      && SampleBoolSeries().BullIndication[
                      0]
                      )
                      {
                      atmStrategyId = GetAtmStrategyUniqueId();
                      orderId = GetAtmStrategyUniqueId();
                      AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[
                      0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
                      }


                      Thanks
                      Peter

                      Comment


                        #56
                        Hello,

                        1) This is the limit price you want to use for your limit order for entry.

                        2) If you want to use a market order to enter instead you would use 0 for your limit price just like you have provided a sample of.

                        Let me know if I can be of further assistance.
                        BrettNinjaTrader Product Management

                        Comment


                          #57
                          Hello,

                          Thank you for replay.
                          Can you have a look at this 2 questions ,please?
                          i am trying to figure out atm strategy.

                          3)Can I use more than 1 AtmStrategies or other strategies on 1 instrument at the same time?

                          4)
                          I have combined together examples SampleAtmStrategy and indicator SampleBoolSeries.
                          In the example bellow I have included in SampleAtmStrategy line calling BullIndication[0] signal from SampleBoolSeries. Is this script now correct?
                          Is there way how to backtested, forwardtested ATM strategies?
                          I was testing SampleAtmStrategy and trades were taken without any order.
                          Something was wrong.

                          Thanks
                          peter


                          // HELP DOCUMENTATION REFERENCE: Please see the Help Guide section "Using ATM Strategies"
                          // Make sure this strategy does not execute against historical data
                          if (Historical)
                          return;
                           
                          // Submits an entry limit order at the current low price to initiate an ATM Strategy if both order id and strategy id are in a reset state
                          // **** YOU MUST HAVE AN ATM STRATEGY TEMPLATE NAMED 'AtmStrategyTemplate' CREATED IN NINJATRADER (SUPERDOM FOR EXAMPLE) FOR THIS TO WORK ****
                          if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > Open[0]
                          && SampleBoolSeries().BullIndication[
                          0]
                          )
                          {
                          atmStrategyId = GetAtmStrategyUniqueId();
                          orderId = GetAtmStrategyUniqueId();
                          AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[
                          0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
                          }


                          Thanks
                          Peter

                          Comment


                            #58
                            Hi Peter,

                            3. You can as long as you use separate ATM strategy ID variables to keep track of which is which.

                            4. You will not be able to backtest ATM strategies as they are real-time only. You can forward test this just by using the Simulated Data Feed, Market Replay, or any real-time data feed on Sim101 to see if your ATM strategy is doing what you want it to do.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #59
                              Hello,

                              Thank you for help,
                              I have combined together examples SampleAtmStrategy and indicator SampleBoolSeries.
                              In the example bellow I have included in SampleAtmStrategy line calling BullIndication[0] signal from SampleBoolSeries. I highlited this insert in RED. Is this script now correct?
                              // HELP DOCUMENTATION REFERENCE: Please see the Help Guide section "Using ATM Strategies"
                              // Make sure this strategy does not execute against historical data
                              if
                              (Historical)
                              return
                              ;
                               
                              // Submits an entry limit order at the current low price to initiate an ATM Strategy if both order id and strategy id are in a reset state
                              // **** YOU MUST HAVE AN ATM STRATEGY TEMPLATE NAMED 'AtmStrategyTemplate' CREATED IN NINJATRADER (SUPERDOM FOR EXAMPLE) FOR THIS TO WORK ****
                              if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > Open[0
                              ]
                              && SampleBoolSeries().BullIndication[
                              0
                              ]
                              )
                              {
                              atmStrategyId = GetAtmStrategyUniqueId();
                              orderId = GetAtmStrategyUniqueId();
                              AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Limit, Low[
                              0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate"
                              , atmStrategyId);
                              }

                              Thanks
                              Peter

                              Comment


                                #60
                                Yes, the code looks fine. That portion will evaluate to true when BullIndication on the current bar is true.
                                Josh P.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                88 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                48 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                30 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                34 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                68 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X