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 funk10101, Today, 09:43 PM
        0 responses
        3 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        36 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        44 views
        0 likes
        Last Post bill2023  
        Started by yertle, Today, 08:38 AM
        6 responses
        26 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        24 views
        0 likes
        Last Post algospoke  
        Working...
        X