Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Applying the current active ATM strategy to new orders (not template)

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

    Applying the current active ATM strategy to new orders (not template)

    Hi - Chart Trader buttons have a feature that whenever a new order is placed then the ATM strategy stop and targets that are applied to each new order are the same as that of the currently active ATM strategy for the active position. Please see the attached GIF to demonstrate what I am referring to. This is really helpful as it allows managing the full position. Please can you help me direct me toward the code which will help me select the active ATM strategy for the existing position?


    I am trying to do the same for an indicator I am programming. It has chart buttons to submit new order and it uses the following code to apply the selected ATM strategy template to each new order. However, this creates multiple stops and targets for each new order unlike the Chart Trader method demonstrated in GIF.

    My code below

    Code:
    NinjaTrader.Gui.NinjaScript.AtmStrategy.AtmStrategySelector atmSelector = (Window.GetWindow(ChartControl.Parent).FindFirst(" ChartTraderControlATMStrategySelector") as NinjaTrader.Gui.NinjaScript.AtmStrategy.AtmStrategySelector);
    
    myOrder = account.CreateOrder(Instrument, OrderAction.Buy, OrderType.Limit, OrderEntry.Manual, TimeInForce.Gtc, myQuantity, Math.Min(Low[1], GetCurrentBid() - 1 * TickSize), 0, string.Empty, "Entry", DateTime.MaxValue, null);
    
    if (atmSelector.SelectedAtmStrategy != null)
    
    {
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrategy(atmSelector.SelectedAtmStrategy, myOrder);
    }
    Attached Files
    Last edited by samanruptrader; 08-02-2023, 11:11 AM.

    #2
    Hello samanruptrader,

    Unfortunately, there is not a method to scale into an existing Atm.

    A request for this feature was submitted, tracked with ID # SFT-2522, and I will be happy to add your vote to that request.

    In the meantime, you could submit the entry, and then modify the quantity of the stop and target with <Account>.Change().


    This example below may provide some ideas on how to find orders by the atm strategy.
    This indicator serves to provide labels for Atm strategies that are present on your chart. Each new Atm strategy will rotate through the colors defined in your Brush Collection. Simply add to a chart, select the data series you want to have labels added to, choose your font and add all the brushes/colors you want [&#8230;]
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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