Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using a ATM in a Strategy

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

    Using a ATM in a Strategy

    How can I execute an an ATM order from a strategy? Is is possible to set this up in the wizard or do I need to add it to the strategy code?

    #2
    Hello nedrob519,

    Thank you for your post.

    Unfortunately, this is not possible through the Strategy Wizard. You will need to unlock the code to add the ATM Strategy methods and functions.

    You can find an example under Tools > Edit NinjaScript > Strategy > SampleAtmStrategy.

    Information on the methods and functions can be found at the following link: http://www.ninjatrader.com/support/h...gy_methods.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      If once I add the ATM Strategy code to the ninjascript strategy, do I need to have the atm strategy pulled up in the chart trader, or should it be on none

      Comment


        #4
        Hello brucelevy,

        Thanks for your reply.

        To apply the strategy to a chart, chart trader will need to be disabled. Since chart trader will not be there, there will not be an option for ATM to select.

        Comment


          #5
          if you disable chart trader on the first chart and open chart trader on a second chart the order will show on screen. Is it ok to manage the stop loss this way or will it mess up the strategy? I noticed that the stop losses would be taken and show up in executions page but still show fluctuating pnl on strategy page as if it were still there.

          Comment


            #6
            I have a strategy to get me in a trade and an atm to put stops and auto breakeven but I need to be able to manually drag the stop behind price.

            Comment


              #7
              If you are using ATM Strategies, it is fine to manually modify the order once you're in position.

              As long as your strategy is not explicitly resetting the stop price in code somewhere, the atm strategy which is created should allow you manually move the orders.
              MatthewNinjaTrader Product Management

              Comment


                #8
                Thanks for that, Matthew. I've just noticed this thread and I didn't realise you could manually adjust ATMs entered per strategy (with the proviso you mentioned).

                Another example of Ninja being so flexible.

                Comment


                  #9
                  I am using this code to initiate the ATM Strategy, however I've noticed that when the position is reversed the stop loss order is still there.

                  AtmStrategyCreate(OrderAction.Buy, OrderType.Market, 0, 0,
                  TimeInForce.Day, GetAtmStrategyUniqueId(), "AtmStrategyTemplate",
                  GetAtmStrategyUniqueId());

                  Comment


                    #10
                    Hello Brucelevy,

                    You need to cancel and close out the other order.
                    ATM strategies are not tracked with Strategies, so once they are entered they are tracked by themselves. You would need to close the other working ATM for this.

                    http://www.ninjatrader.com/support/h...ategyclose.htm
                    Cal H.NinjaTrader Customer Service

                    Comment


                      #11
                      Would it be added like so?

                      AtmStrategyCreate(OrderAction.Buy, OrderType.Market, 0, 0,
                      TimeInForce.Day, GetAtmStrategyUniqueId(), "AtmStrategyTemplate",
                      GetAtmStrategyUniqueId());
                      if (GetAtmStrategyUnrealizedProfitLoss("idValue") > 500)
                      AtmStrategyClose("idValue");

                      Comment


                        #12
                        Hello brucelevy,

                        Thank you for your response.

                        You would assign a string as AtmStrategyId, then use that in AtmStrategyCreate() and AtmStrategyClose().

                        For example:
                        Code:
                        				atmStrategyId = GetAtmStrategyUniqueId();
                        				orderId = GetAtmStrategyUniqueId();
                        				AtmStrategyCreate(...)
                        Take a look at the example under Tools > Edit NinjaScript > Strategy > SampleAtmStrategy, this will give you a better idea of how to assign the atmStrategyId and orderId.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        558 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        324 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        101 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        545 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        547 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X