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 fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,404 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      95 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      160 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      9 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X