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 GLFX005, 10-10-2019, 02:44 PM
    20 responses
    2,172 views
    0 likes
    Last Post emtrader1  
    Started by tak145, 09-09-2023, 11:17 AM
    4 responses
    43 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by burtoninlondon, 09-11-2023, 03:48 AM
    15 responses
    161 views
    3 likes
    Last Post rtwave
    by rtwave
     
    Started by epete, 04-08-2019, 01:55 PM
    7 responses
    850 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by speedytrade02, 09-06-2023, 03:35 AM
    22 responses
    134 views
    0 likes
    Last Post speedytrade02  
    Working...
    X