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 pechtri, 06-22-2023, 02:31 AM
    9 responses
    122 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, 04-18-2024, 09:08 AM
    16 responses
    65 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by habeebft, Today, 01:18 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by benmarkal, Today, 12:52 PM
    2 responses
    13 views
    0 likes
    Last Post benmarkal  
    Started by f.saeidi, Today, 01:38 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X