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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      35 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      12 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      18 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X