Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access/Link ATM Strategy from a custom inidcaor code

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

    Access/Link ATM Strategy from a custom inidcaor code

    Hi Ninja experts, I need some advice to get through the use of atm strategies from the custom developed indicators. From my past experience, I know that it is possible to link a conventional custom strategy to an ATM strategy using function like AtmStrategyCreate() and the stop loss/target profit can be dynamically changed using functions like AtmStrategyChangeStopTarget().

    I tried to study the help guide of NT8 but could not clearly understand whether it is possible to access/link an atm strategy from a custom indicator in the same way as that of a custom conventional strategy? Moreover, I have studied a function called StartAtmStrategy(). I learned that this function can be used from the NT Tab Add ONs. Can the same function of StartAtmStragegy() be used from a custom indicator code.

    Please guide me about this. Thank you very much for your attention.


    #2
    Hello Mubeen Haider,

    For indicators to place trades or do other account related actions you can use the addon framework section of the help guide. The addon section of the help guide is documented to compliment the addon sample, that code in large can be used from most every type and not just the addon.

    From an indicator You would have to first find an account:


    You can then see the sample of using StartAtmStrategy, the sample is in an addon tab so you really just need the following few lines which is finding the account and creating the order:

    Code:
    private Account account;
    private Order entryOrder;
    
    
    lock (Account.All)
    account = Account.All.FirstOrDefault(a => a.Name == "Sim101");
    
    if (account != null)
    {
    entryOrder = account.CreateOrder(Cbi.Instrument.GetInstrument(" AAPL"), OrderAction.Buy, OrderType.Market,
    TimeInForce.Day, 1, 0, 0, string.Empty, "Entry", null);
    
    // Submits our entry order with the ATM strategy named "myAtmStrategyName"
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy("myAtmStrategyName", entryOrder);
    }


    If you wanted to use the chart trader for some of the control you can use the properties shown here: https://ninjatrader.com/support/foru...15#post1136415

    Much like a strategy you can attach to the accounts execution events to drive logic as well. Indicators have no performance so you will need to use the control center to view trade performance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    574 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X