Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop management and partial fills

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

    Stop management and partial fills

    I discovered to my great dismay that ATM has a major shortcoming, and my question here has to do with resolving it via an automated strategy.

    First to the problem:
    I have some simple ATM strategy templates. Basically it is a fixed trailing stop, but from my discussion with customer support it would seem that this would affect any stops. If i put an order and the order gets filled with multiple partial fills, then NT places a separate stop order for each and every fill, rather than manage a single stop order for the entire position. Since my broker charges a flat commission per order (not per lot or %), this results in a hugely inflated commission. If I get 4 fills I pay commission on the exit 4 times!

    According to customer support, this it how it is and that's that. Nothing can be done. This pretty much rules out limit orders for me, and makes even market orders dicy unless there is huge liquidity in the stock.

    So I am looking to resolve this by writing my own strategy rather than relying on ATM.

    Now to the question:
    My question then would be - if I create a strategy to manage my own stops, and then use the "managed" set of API calls, and in this code I put in my OnOrderUpdate method code that would SetStopLoss() or SetTrailStop() to update the stop to the full size of all the fills I received so far, would that result in a single order to the broker or would it break it up to multiple orders as well? In pseudo-code it would look like this:

    void OnOrderUpdate(order)
    {
    if (order == MyEntryOrder)
    {
    SetStopLoss(ComputeStopPrice()) // or SetTrailStop(...)
    }
    }

    It sounds clear to me that I could always resort to the "unmanaged" API and simply submit a stop loss order using SubmitOrder() and then when I get new fills cancel the stop order and submit a new one. This would clearly result in a single stop order for the entire fill every time (with exposure during the time that the order is changed). The question is - would the "managed API" approach listed above work as I expect or would it also result in one stop order per fill as the ATM behavior is?

    #2
    Hello arnonmoscona,
    In an NinjaScript strategy its depends on the stop/target submission type you choose (in the strategy parameter box, look for the field “Stop and target submission”).

    Alternatively you can place the stop order when it gets completely filled. Like
    Code:
    if (order == MyEntryOrder && order.OrderState == OrderState.Filled)
    {
    	//place stop orders
    }
    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thank you very much.
      ATM should really have this feature as well...

      Comment


        #4
        Hello arnonmoscona,
        Thanks for your feedback. I will forward the feature request to development.

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hello arnonmoscona,
          I have submitted your suggestion for the enhancement of NinjaTrader to our development team and it has been assigned the unique tracking ID # 1540. We appreciate your commitment in helping us to improve NinjaTrader.
          JoydeepNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

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