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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      66 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X