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

Reconnection of strategy after disconnect of NinjaTrader

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

    Reconnection of strategy after disconnect of NinjaTrader

    I have recently developed an algorithmic swing trading strategy. I am currently demo trading this strategy and have come across an issue which I would like to resolve.

    I left my computer on overnight as I was in an active trade on the GBPUSD. Upon waking up and checking my computer, it seemed to have restarted overnight and NinjaTrader was no longer open. I reopened NinjaTrader and enabled my strategy, neither my stop nor my target had been hit and I was still active in the trade, but because NinjaTrader had disconnected, the strategy was no longer managing the trade by adjusting stops and targets which are specified in the algorithm.

    Is there a way to include a fail safe into Ninjascript such that if NinjaTrader crashes/disconnects in any way, upon reopening NinjaTrader if a trade is still active, the algorithm continues to manage the trade.

    #2
    Hello Sudonega,

    Thanks for your post.

    You may keep your strategy from disabling when losing a connection by changing how NinjaTrader controls the NinjaScripts Strategies in the Tools > Options window.

    Please follow the steps below to do so.
    • In the Control Center select Tools > Options.
    • Click the Strategies tab on the left-hand side.
    • On the right-hand side click the 'On connection loss' drop-down arrow.
    • Set 'Handling' to 'Keep Running'.
    • Set the 'Disconnect delay seconds' to a high enough value to be able to ride out brief disconnections so the strategy does not disable.
    • Click OK
    See this help guide documentation for more information — https://ninjatrader.com/support/help...riptProperties

    When re-enabling a strategy, you can use a start behavior to "Immediately submit" in the parameters of the strategy. Immediately Submit automatically submits working orders from when the strategy processed historical data, and assumes the strategy position and account position are where you want it when you enable the strategy. This is typically used to have a strategy resume a position after disabling/enabling. If the strategy already had live orders running, the orders will resume with the new enablement of the strategy if they match the historically calculated orders. If the orders calculated from historical data do not match the live working orders, the live working orders will be canceled and replaced by those calculated from historical data.

    See this help guide page for more information about Start Behaviors — https://ninjatrader.com/support/help..._positions.htm

    Please let us know if we may further assist
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    6 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    7 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Yesterday, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Working...
    X