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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      72 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X