Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programatically updating positions with ATM strategy active

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

    Programatically updating positions with ATM strategy active

    Hi,
    My indicator creates entry orders and attaches current selected ATM strategy like so:
    Code:
    var entryOrder = account.CreateOrder(instrument, OrderAction.Buy, OrderType.Market, OrderEntry.Manual, TimeInForce.Gtc, int.Parse(_quantityBox.Text), 0, 0, null, "Entry", DateTime.Today.AddDays(1), null);
    var atm = ((NinjaTrader.NinjaScript.AtmStrategy)_atmBox.SelectedItem);
    AtmStrategy.StartAtmStrategy(atm, entryOrder);​
    Everything works as expected. Now when i execute same code again, i have two SL and two TP orders, ATM strategy adds separate SL and TP for each entry. Is it possible to somehow have ATM strategy update existing SL/TP orders once new entry order is executed and position quantity changed?

    Thanks

    #2
    You should be able to fix this by changing the settings in chart trader properties to increase quantity of preexisting order instead of summit new order for additional quantity

    Comment


      #3
      Hello rokups,

      Thank you for your post.

      Unfortunately, at this time there is no method to scale into an existing Atm.

      As a workaround, after submitting the entry, you could then modify the quantity of the stop and target with <Account>.Change().



      You can loop through the Orders collection to find the orders on the account.

      Comment

      Latest Posts

      Collapse

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