Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

When strategy loses connection

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

  • cassb
    replied
    Exactly. I'm not sure why the strategy automatically disables when you disconnect from the broker, but it would be nice to have a switch to allow it to remain running while you reconnect so that it would stay in sync with the open positions at the broker.

    Leave a comment:


  • ashmanz80
    replied
    I have the same issue. Its not a frequent occurrence but would be nice to have this as a backup plan. I set the connection timeout to 180s and reconnection attempts to 5. The major obstacle is if you have to restart NT8 due to a crash and re-enable the strategy once restarted. I set start behavior on the strategy to sync with account and submit immediately. This way, you would have all original orders closed prior to enabling again and a fresh set of orders out in sync with the original order submission. Only drawback is you might enter the same position as a less favourable price (or better if your lucky).

    Leave a comment:


  • cassb
    replied
    OK thank you. But we had that option set to "Keep Running", but the problem was that it lost the connection and never reconnected. When we disconnected and reconnected to the provider, the strategy disabled and then was not able to manage the position. Is there a way around that to manually reconnect to the broker without disabling the strategy?

    Thanks!
    Bryan

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello Bryan,

    Go to Control Center>Tools>Options and under Strategy Categories, if you you set On Connection Loss>Handling> to Keep Running or Stop Strategy, then upon connection loss your strategy should behave as expected.

    Start Behavior will only affect the strategies when they are first started.

    I apologize for not following up on this sooner, I had forgot to include this ticket with the issue number and therefor couldn't follow up when it was explained to me.

    Please let us know if you need further assistance.

    Leave a comment:


  • cassb
    replied
    Hi Alan. Is this issue resolved yet? I would like to use it asap.

    Thanks!
    Bryan

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello Bryan,

    I have made a note to will follow up when the issue has been assigned an ID.

    Thank you for your patience.

    Leave a comment:


  • cassb
    replied
    Fantastic, thank you! Is there an issue number or something I can reference in the next Release Notes that would tell me it's working?

    Bryan

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello cassb,

    Correct, upon reconnect its not managing the position. I have submitted a bug report and would expect the issue to be resolved in a coming release of NinjaTrader 8.

    Please let us know if you need further assistance.

    Leave a comment:


  • cassb
    replied
    Thanks Alan. I think I'll try koganam's suggestion, but you are saying it doesn't work in the current version? I do use the managed approach with orders, so I would rather not have to use text files and change the code to use the unmanaged approach.

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello cassb,

    Koganam provides a good suggestion for how to set up your strategy to begin re-managing an open position upon restart, thank you Koganam, however I have just submitted a bug report as its not behaving as expected.

    Your question about writing and reading from a text file could work, however would require you use the unmanaged approach, which a more advanced programming topic. You could read more about that here,


    If you were interested in that approach, I have provided links to reading/writing from a text file.

    Indicator: Using StreamWriter to write to a text file

    Then you could have your strategy read from the file, a reference example,
    Indicator: Using StreamReader to read from a text file

    Please let us know if you need further assistance.

    Leave a comment:


  • cassb
    replied
    Yes, good point. And that goes with this flag:

    IsAdoptAccountPositionAware

    Definition

    Determines if the strategy is programmed in a manner capable of handling real-world account positions. Once set to true, your strategy's "Start behavior" options will include an additional parameter named "Adopt account position" which can bet set at run-time. Only set to true if you have specifically programmed your strategy to be able to adopt account positions.

    Leave a comment:


  • koganam
    replied
    Originally posted by NinjaTrader_AlanP View Post
    Hello Bryan,

    Thank you for writing in.

    No, once the strategy has disabled itself due to hitting its max reconnect attempts, you would manually have to handle the strategy/position.

    If you are having connection issues you might consider looking into a new internet provider or a VPS.

    Please let us know if you need further assistance.
    What about "StartBehavior.AdoptAccountPosition"? Is that not supposed to be its raison d'être.

    ref: http://ninjatrader.com/support/helpG...rtbehavior.htm

    Leave a comment:


  • cassb
    replied
    Thanks Alan. Is there any workaround for this? Saving the strategy variables to a file on every tick and restoring from the file when it comes back online? Something? Anyone?

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    Hello Bryan,

    Thank you for writing in.

    No, once the strategy has disabled itself due to hitting its max reconnect attempts, you would manually have to handle the strategy/position.

    If you are having connection issues you might consider looking into a new internet provider or a VPS.

    Please let us know if you need further assistance.

    Leave a comment:


  • cassb
    started a topic When strategy loses connection

    When strategy loses connection

    When a strategy has an open position it's managing, and it loses the broker connection and disables itself, is there a way to enable the strategy and pick up managing that same trade again from where it left off?

    Bryan

Latest Posts

Collapse

Topics Statistics Last Post
Started by CarlTrading, 05-11-2026, 05:56 AM
0 responses
67 views
0 likes
Last Post CarlTrading  
Started by CarlTrading, 05-10-2026, 08:12 PM
0 responses
40 views
0 likes
Last Post CarlTrading  
Started by Hwop38, 05-04-2026, 07:02 PM
0 responses
202 views
0 likes
Last Post Hwop38
by Hwop38
 
Started by CaptainJack, 04-24-2026, 11:07 PM
0 responses
366 views
0 likes
Last Post CaptainJack  
Started by Mindset, 04-21-2026, 06:46 AM
0 responses
283 views
0 likes
Last Post Mindset
by Mindset
 
Working...
X