Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

If My order is not filled

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

    If My order is not filled

    Hi,

    I have a strategy that uses the (EnterLongLimit) order which buys on a certain specific price
    It works just fine when market is not so volatile
    However, when market is so volatile, the price movement is so fast, and the order doesn't get filled, sometimes with an error message

    I'd like to introduce a minor change.. saying that if my (EnterLongLimit) is not fully filled (or partially filled)
    then, go for buy market (EnterLong)

    So, how can I write this condition in simple code. Which commands I should use? The action of the IF condition is clear to me
    Appreciating your support




    Thanks..

    #2
    Hello Abdullah_KSA,

    Thank you for your post.

    To accomplish this you would need to use OnOrderUpdate() and check if you have PartialFills by using something like if (order.OrderState == OrderState.PartFilled) followed by calling EnterLong(). See the SampleOnOrderUpdate() example script in the help guide documentation below which shows how to detect PartialFills in OnOrderUpdate()/OnExecutionUpdate().

    SampleOnOrderUpdate() - https://ninjatrader.com/support/help...and_onexec.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    553 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    100 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    543 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    546 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X