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

What happens to limit orders (targets) if price moves too fast

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

    What happens to limit orders (targets) if price moves too fast

    I am using the Unamanged Approach to enter orders. Suppose that in a real trading environment, I set a buy stop above price and then a sell stop below price (at the same time). I can do this in the Unmanaged Approach.

    Now suppose that price spikes up through my buy entry price and gets filled. In OnOrderExecution, I am able to see this and now I want to set a profit target say 10 ticks above my entry price.
    But what happens if I try to do this, but when I submit my order, the actual price has already moved above the target price?

    In a perfect world, NinjaTrader would recognize that the price is already above the target price i wan and would therefore just close the trade. So does this happen? This is what I want to happen. It would be highly annoying if NT just rejects that order, but NT does all kinds of annoying things so who know.

    If this is not the default behavior, please tell me how to make sure that this target limit order is filled if price has already moved beyond that target limit price.

    #2
    Hello westofpluto,

    Thanks for your post.

    If you place Limit orders above the target price, the Limit orders will fill if the market price is better than the price of the Limit order. If you place a Stop Market order, the Stop Market orders would become rejected if the market price moves past the target price.

    You could use RealtimeErrorHandling to determine the behavior of a strategy when the strategy places an order that is returned "Rejected". The default behavior is to stop the strategy, cancel any remaining working orders, and then close any open positions.

    RealtimeErrorHandling could be set to IgnoreAllErrors to ignore any order errors received or StopCancelCloseIgnoreRejects to perform the default strategy behavior on all errors except order rejections. Please note that setting this property value to IgnoreAllErrors can have serious adverse affects on a running strategy unless you have programmed your own order rejection handling in the OnOrderUpdate() method. To do this you could trap the rejected order by checking if the OrderState is Rejected within OnOrderUpdate() followed by defining your own order rejection handling behavior for the rejected order.

    Please see the example in the help guide link below that demonstrates using RealtimeErrorHandling and trapping a rejected order in OnOrderUpdate().
    RealtimeErrorHandling — https://ninjatrader.com/es/support/h...orhandling.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,605 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    8 views
    0 likes
    Last Post jaybedreamin  
    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
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    13 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X