• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 KonalGondal, Today, 10:18 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by Jorge.andres.o, Today, 09:24 AM
        2 responses
        9 views
        0 likes
        Last Post Gland1
        by Gland1
         
        Started by Oracletrades, Today, 09:02 AM
        4 responses
        8 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by JTizz, Today, 08:17 AM
        7 responses
        25 views
        0 likes
        Last Post JTizz
        by JTizz
         
        Started by Johnny Santiago, 07-30-2020, 07:30 PM
        9 responses
        37 views
        0 likes
        Last Post brucerobinson  
        Working...
        X