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 DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      6 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Working...
      X