Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I call AtmStrategyClose from an Add On?

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

    How can I call AtmStrategyClose from an Add On?

    Hi,

    I am using NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy to start an ATM strategy from an AddOn.

    // Submits our entry order with the ATM strategy named "myAtmStrategyName"
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy("myAtmStrategyName", entryOrder);

    What is the equivalent to AtmStrategyClose(string atmStrategyId) that I can call from an AddOn to close my ATM?

    In other words, how can I close the position, hence the ATM strategy, from an add on?

    Thank you!
    jmneto

    #2
    Hello jmneto,

    In this case, this is not going to be similar to a NinjaScript strategy as you are submitting manual orders.

    If you want to close the position, you could use the Account object and its Positions collection to close the position that was opened. You can also use the Flatten method if you wanted to specify an instrument rather than using logic to pick the position.



    a simple example of closing the first located position:

    Code:
    account.Positions[0].Close();



    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 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
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X