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

change order type automatically

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

    change order type automatically

    Hello. excuse my English. When I place a buy stop limit order and the price is above the ninja order it warns me of my mistake.
    Is it possible to program that when this ninja error occurs, it automatically launches a limit order at the same price that I wanted to place the stop limit order? Thank you

    #2
    Hello julifro,

    Thanks for your post.

    You could consider using 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 me know if I may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by samish18, Today, 03:53 AM
    0 responses
    1 view
    0 likes
    Last Post samish18  
    Started by binzel, Today, 03:18 AM
    0 responses
    1 view
    0 likes
    Last Post binzel
    by binzel
     
    Started by stalt, 12-28-2015, 01:36 PM
    8 responses
    1,569 views
    0 likes
    Last Post Víitnnhatrangdotvn  
    Started by Rocksworx, Today, 02:29 AM
    0 responses
    5 views
    0 likes
    Last Post Rocksworx  
    Started by lcgamarra_pinnacle, 06-15-2024, 09:33 AM
    2 responses
    33 views
    0 likes
    Last Post AlexMocc  
    Working...
    X