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

pending orders getting canceled

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

    pending orders getting canceled

    I have a strategy running and has a long position.it submits a pending stop and target order.now when i reload the data from historical data manager,the strategy is automatically disabled and again enabled.It also cancels my pending orders.
    This brings me to a situation where the strategy is running and has a long position and no target and stop orders.
    my question is when i reload the data ,how can i keep the stop and target orders running and avoid getting them cancelled
    Thank you

    #2
    Hello easyfying,

    Thanks for opening the thread.

    If you would like to have your strategy resume if data has been reloaded or if the strategy has briefly been disabled, I would suggest to look into using Immediately Submit instead of the default Wait Until Flat Start Behavior.

    Immediately Submit will try to match any active orders that were made by the strategy, while Wait Until Flat will cancel any active orders that were previously made.

    I would suggest to review the documentation on syncing account positions for more information on how these start behaviors work exactly, and testing the behavior when disabling and re-enabling a simple strategy that can enter a position quickly. The SampleOnOrderUpdate strategy is a good example that can be used to test start behaviors quickly.

    Syncing Account Positions is documented here: https://ninjatrader.com/support/help..._positions.htm

    SampleOnOrderUpdate strategy - http://ninjatrader.com/support/forum...ead.php?t=7499

    Additionally, there are NinjaScript settings that can cancel entry and exit orders when a strategy is disabled. Please see the 'Understanding the NinjaScript tab' section of the Options menu documentation here: https://ninjatrader.com/support/help...tegies_tab.htm
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by The_Sec, Yesterday, 03:37 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by vecnopus, Today, 06:15 AM
    0 responses
    1 view
    0 likes
    Last Post vecnopus  
    Started by Aviram Y, Today, 05:29 AM
    0 responses
    5 views
    0 likes
    Last Post Aviram Y  
    Started by quantismo, 04-17-2024, 05:13 PM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    36 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X