Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add an ATM Strategy to an automated Strategy

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

    How to add an ATM Strategy to an automated Strategy

    Hello, I created my first automated strategy after watching a few tutorials on the Strategy Builder. I defined my exit criteria in the automated strategy but I would also like to create an ATM strategy and link it to the automated strategy. Please can you guide me step by step on how i can achieve this? Thanks.

    #2
    Hello aliyuabu,

    Thank you for your post.

    The Strategy Builder is not able to use ATM strategy templates. Using an ATM strategy would require unlocking your script.

    In the Strategy Builder, modifying the price of exit orders can be done with logic. Here is a forum post with examples of how to do this in the Builder:

    https://forum.ninjatrader.com/forum/...jU1#post806596


    Please see the following links to the help guide on ATM Strategy Methods.

    ATM Strategy Methods - https://ninjatrader.com/support/help...gy_methods.htm

    Using ATM Strategy Methods - https://ninjatrader.com/support/help...strategies.htm


    For an example of how to use an ATM Strategy with your automated strategy, please see the SampleATMStrategy script that comes with the platform for example code.

    If you have any questions, please let me know.

    Comment


      #3
      I have added the ATM to my Strategy using the Ninjascript editor. I tried compiling the code but i got the error message "The name 'ATMMethod' does not exist in the current context. So i added the namespace 'using NinjaTrader.Cbi;' at the top of the code but still getting the error. Below is the part of the script where i added the ATM Strategy where the ATMMethod was referenced. else if (State == State.Configure)
      {
      AddDataSeries(Data.BarsPeriodType.Range, 22);
      AddDataSeries(Data.BarsPeriodType.Tick, 1);
      AddDataSeries(Data.BarsPeriodType.Range, 8);

      // Define the ATM strategy parameters
      AtmStrategyCreate("TrendFollowingATM", ATMMethod.Market, Sensivity, TradeSize, TimeInForce.Day, 60, 60, 60, Close[0]);
      }

      Please can you assist?​

      Comment


        #4
        AtmStrategyCreate needs to be called from OnBarUpdate() after a atmStrategyID and orderIdD have been generated.


        Help Guide page for AtmStrategyCreate:

        https://ninjatrader.com/support/help...tegycreate.htm



        AtmStrategyCreate(OrderAction action, OrderType orderType, double limitPrice, double stopPrice, TimeInForce timeInForce, string orderId, string strategyTemplateName, string atmStrategyId, Action<Cbi.ErrorCode, string> callback)



        The call to AtmStrategyCreate() must match the method signature above.


        'ATMMethod' is not a NinjaScript object. Is this something custom you have created? Please provide the code used to define this custom class.


        Please see the SampleATMStrategy script that comes with the platform for example code on how to properly call AtmStrategyCreate().

        Comment

        Latest Posts

        Collapse

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