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

enter with limits and handling partial fills

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

    enter with limits and handling partial fills

    Hello,

    Im using the managed approach and entering with limits

    longEntryOrder = EnterLongLimit(0,liveUntilCancelled,enter_qty,Low[1],"LongEntry1");

    for both long and short entries

    In OnExecution i am receiving the Fills or partial fills and have been tracking the
    execution.Order.Filled amount as it comes in.

    Now in the OnExecution this is where is set the targets

    ExitShortLimit(0,liveUntilCancelled,1,High[1]-(TgtTicks1*TickSize),"ShortTgt1","ShortEntry1");
    ExitShortLimit(0,liveUntilCancelled,1,High[1]-(TgtTicks2*TickSize),"ShortTgt2","ShortEntry1");
    ExitShortLimit(0,liveUntilCancelled,1,High[1]-(TgtTicks3*TickSize),"ShortTgt3","ShortEntry1");

    So at the moment i am entering a quantity of 3 for the enter limit and correspondingly setting 3 separate targets.

    My question is with the above - given i am using the 'entrysignal' to tie the exitshortlimit to the entry .. does it matter that i submit all 3 targets at once even if they are filled partially 1 at a time vs all filled at once in one call to onexecution?
    Should i be using the execution.Order.Filled amount and only submit based on this?
    However in my print statements i notice that the amount can go from 1 to 3 so i need to subtract from the Quantity to the filled to determine how much was filled? This is what i need to clarify.
    If in the case of managed and i dont need to worry as the managed approach will keep a count of how many fills there are for the original order tied with the entrysignal or do i need to manage this myself ? Or will i be left with 2 exitlimits out there as orders for which there are no entries in the case where i only get a fill of 1 for an original quantity of 3.
    Hope this makes sense -


    thanks
    Last edited by soulfx; 05-12-2017, 06:12 AM.

    #2
    Hello soulfx,

    Thanks for opening the thread.

    My question is with the above - given i am using the 'entrysignal' to tie the exitshortlimit to the entry .. does it matter that i submit all 3 targets at once even if they are filled partially 1 at a time vs all filled at once in one call to onexecution?
    You should not run into issue attaching multiple orders with the fromEntrySignal to achieve partial fills and multi leveled profit targets. You will want those targets to have their own tag, however.

    Should i be using the execution.Order.Filled amount and only submit based on this?
    Since market volatility can cause variance when submitting orders on a bar close and using the "Price To Enter" as the "Price Entered," you will get information more accurate with your broker when you place your protective orders using OnExecution() instead of using the data fed through OnBarUpdate()

    However in my print statements i notice that the amount can go from 1 to 3 so i need to subtract from the Quantity to the filled to determine how much was filled? This is what i need to clarify.
    If in the case of managed and i dont need to worry as the managed approach will keep a count of how many fills there are for the original order tied with the entrysignal or do i need to manage this myself ? Or will i be left with 2 exitlimits out there as orders for which there are no entries in the case where i only get a fill of 1 for an original quantity of 3.
    Partial fills are possible through the managed approach. If you have a target fill some of the order quantity, you can certainly have another order method from the managed approach fill the rest of that order quantity. Of course, using the same target signal names would only change that order, so unique target signal names would be required, which you are doing in the code provided.

    For reference, various information on what you can and cannot do with the Managed Approach can be found here: http://ninjatrader.com/support/helpG...d_approach.htm

    If you have any additional questions while implementing and testing this, please don't hesitate to write back.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    18 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    44 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    20 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    180 views
    0 likes
    Last Post jeronymite  
    Working...
    X