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 GPX10, Yesterday, 06:10 PM
    24 responses
    619 views
    1 like
    Last Post atokunade  
    Started by TraderJosh, Today, 06:46 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Started by Day_Storay1, Today, 11:32 AM
    0 responses
    5 views
    0 likes
    Last Post Day_Storay1  
    Started by GKonheiser, 10-02-2012, 06:08 AM
    97 responses
    9,776 views
    0 likes
    Last Post Malletto  
    Started by donto, 12-01-2023, 01:06 PM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Working...
    X