Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

one order is divided into multiple executions

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

    one order is divided into multiple executions

    Hi

    at some point I issue an entry order (can be long or short)

    EnterLongStopLimit(1,true,2,HighOfRange + 2*TickSize,HighOfRange + 2*TickSize,"MyLongEntry");

    I need it to be ASAP but not market. and close to the trigger. so I use a stop limit.

    I can see it in trace. I see the line like :

    11/8/2017 10:19:15 AM Strategy 'MW7/120585512': Entered internal SubmitOrderManaged() method at 11/8/2017 10:19:15 AM: BarsInProgress=1 Action=Buy OrderType=StopLimit Quantity=2 LimitPrice=13413 StopPrice=13413 SignalName='MyLongEntry' FromEntrySignal=''

    when I run it on historical data all is ok.
    when its live data or even Playback, I sometimes (not always) get several entry points instead of the Quantity I ordered. for example above I can get two entries, each with Qty1. in total its 2. and when I exit the position, obviously I get two exits.

    what can be the reason ?

    #2
    Hello dadarara,

    Thanks for opening the thread.

    It sounds like you are getting a partial fill on that order in which it partially gets filled for one contract and then partially filled for another contract.

    You can check this by placing a print in OnOrderUpdate() to see the update of each order in your strategy.

    Code:
    protected override void OnOrderUpdate(Cbi.Order order, double limitPrice, double stopPrice, 
    			int quantity, int filled, double averageFillPrice, 
    			Cbi.OrderState orderState, DateTime time, Cbi.ErrorCode error, string comment)
    		{
    			Print(order.ToString());
    		}
    OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm

    Partial fills are normal and can be expected when using limit and stop limit orders.

    If you have any additional questions, please don't hesitate to write back.
    JimNinjaTrader Customer Service

    Comment


      #3
      hi

      normal even if its not a live trading. the orders are not really executed at the broker side?
      and in the Playback mode?

      Comment


        #4
        Hello dadarara,

        Thanks for your additional question.

        Only orders submitted with your live account get filled by the broker/exchange. When you are not trading with your live account, orders are filled by the Simulator. These orders are filled locally and mimic that of the broker/exchange. This would also mean that the Playback connection and Sim101 accounts will all have their orders filled by the Simulator.

        Additional reading on the Simulator can be found here: https://ninjatrader.com/support/help...simulation.htm
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by RookieTrader, Today, 09:37 AM
        4 responses
        18 views
        0 likes
        Last Post RookieTrader  
        Started by PaulMohn, Today, 12:36 PM
        0 responses
        5 views
        0 likes
        Last Post PaulMohn  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        40 views
        0 likes
        Last Post love2code2trade  
        Started by junkone, Today, 11:37 AM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X