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

Average price strategy

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

    #16
    Hi Chris,

    I have done several tests in market replay and the logic works discreetly.

    It happens that orders accumulate for example long in a progressive way up to the set limit eg: 4 long.
    The profit order is activated in the correct Working state so that 4 Sell at the correct price limit.

    It happens though in some cases that this order of Profit 4 Sell does not find the full Filled which remain in portfolio example 2 Long orders. At this point they do not have more profit order so they remain hung until for example the closing market takes place.
    In this situation by entering the log I verified that the order status "Buyorder " is no longer filled but turns into part. Filled.

    Now I wonder what function I can introduce to set the profit even on a part. Filled order succeeded to a emptying order that failed to fill?

    Thanks a lot yet
    Last edited by marubozu79; 01-10-2019, 05:18 AM.

    Comment


      #17
      Hello marubozu79,

      Thank you for the reply.

      Using the unnamage approach you will need to keep track of partial fills in OnExecutionUpdate. An example of using OnExecution and OnOrderUpdate can be found below:



      Please let me know if I can assist further.

      Chris L.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by FrazMann, Today, 11:21 AM
      0 responses
      3 views
      0 likes
      Last Post FrazMann  
      Started by geddyisodin, Yesterday, 05:20 AM
      8 responses
      52 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      10 responses
      36 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by DayTradingDEMON, Today, 09:28 AM
      4 responses
      24 views
      0 likes
      Last Post DayTradingDEMON  
      Started by George21, Today, 10:07 AM
      1 response
      19 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Working...
      X