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

How to fill a partially filled order?

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

    How to fill a partially filled order?

    How do I fill a partially filled order?
    i.e.
    I order quantity 10 but only partially quantity 1.

    Do I need to code how much is the partial fill and to fill the remaining (I hope not)
    or is there a method to keep trying until filled?
    I would like all my orders to be filled at any cost.

    Code:
    protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
    {
    
    if (
    order.Name == "LONG MNQ 03-21"
    )
    {
    entryOrderLongMNQ = order;
    }
    
    if (entryOrderLongMNQ != null && entryOrderLongMNQ == order)
    {
    Print(order.ToString());
    if (order.OrderState == OrderState.PartFilled)
    {
    [B]// Keep trying to fill at any cost[/B]
    }
    }
    
    }

    #2
    It will actually continue to fill. So you dont worry about it

    Comment


      #3
      Hello johnnybegoode,

      cincai is correct, an order that part fills is only partially complete, depending on the market it should fill the remainder when possible.

      Generally when you see PartFilled used with order based logic like you provided that is to manage the scripts variables or do other tasks related to the orders but not try to force fill or otherwise modify the existing order.

      For general trading concepts like fill or part fill I could make the suggestion of using external public trading resources like investopedia for their definitions. Our help information mainly will detail how those concepts can be used in the platform but will provide very little real world examples or descriptions. Here is a link to the public investopedia definition of fills which has an example of a part fill. https://www.investopedia.com/terms/f/fill.asp



      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cre8able, Today, 01:16 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by chbruno, 04-24-2024, 04:10 PM
      3 responses
      48 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by samish18, Today, 01:01 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by WHICKED, Today, 12:56 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by WHICKED, Today, 12:45 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X