Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add AtmStrategy StopStrategy to my strategy entries

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

    Add AtmStrategy StopStrategy to my strategy entries

    The AtmStrategy and ATM StopStrategy templates are quite good.


    If I have my entry order condition how I want it, can I call the AtmStrategy and orStopStrategy

    #2
    To be more explicit and easier to answer.
    I can enter long on criteria but I do not know how to invoke the AtmStrategyCreate properly


    EnterLong works
    ApplyATMLong Does not work




    if (CrossAbove(GetCurrentAsk(0), MyEntryCriteria, 1))
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    //ApplyATMLong();
    }

    }


    protected void ApplyATMLong(){

    atmStrategyId = GetAtmStrategyUniqueId();
    atmStrategyOrderId = GetAtmStrategyUniqueId();

    AtmStrategyCreate( OrderAction.Buy,
    OrderType.Market, 0, 0,
    TimeInForce.Day,
    atmStrategyOrderId,
    "MyAtmStrategy",
    atmStrategyId, (atmCallbackErrorCode, atmCallbackId) =>
    {
    if (atmCallbackId == atmStrategyId) /// checks that the call back is returned for the current atmStrategyId stored
    {
    if (atmCallbackErrorCode == Cbi.ErrorCode.NoError) /// check the atm call back for any error codes
    {
    isAtmStrategyCreated = true; /// if no error, set private bool to true to indicate the atm strategy is created
    }
    }
    });
    }​
    Attached Files

    Comment


      #3
      Hello BartMan,

      Thanks for your post.

      Atm Strategy Methods would be used to place an entry order with protective orders attached that are handled by an Atm Strategy Template using the AtmStrategyCreate() method.

      Atm Strategy Methods: https://ninjatrader.com/support/help...gy_methods.htm
      AtmStrategyCreate: https://ninjatrader.com/support/help...tegycreate.htm

      The SampleAtmStrategy script that comes default with NinjaTrader could be viewed for an example of how Atm Strategy Methods can be used in a NinjaScript Strategy. To view the script, open a New > NinjaScript Editor window, open the Strategies folder, and double-click on the SampleAtmStrategy file.

      Using ATM Strategies in NinjaScript: https://ninjatrader.com/support/help...strategies.htm

      Let me know if I may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment


        #4
        Thank you, I had read the //support/help links but had missed the SampleAtmStrategy.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        134 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        118 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X