Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

failsafe on disconnect or crash

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

    failsafe on disconnect or crash

    After months, I've finally figured out my indicator for sending orders.
    Now I want a failsafe for in case of disconnections or crashes.

    Obviously I'll need to send a stop loss order or something during/after I send any open position order.
    I did a little search. Any suggestions for what I should do? thanks

    #2
    Note that a disconnection is not really the same thing as a crash.

    If you want a fail-safe for disconnections and crashes, this is not
    a trivial thing to do -- and also, it can be difficult to test well.

    By crash, what do you mean, exactly?

    Do you mean your strategy has crashed? Such as an unhandled
    exception? Or do you mean NinjaTrader.exe has crashed and its
    Windows process has terminated?

    Lucky for us,
    Monitoring for disconnections could probably be done inside the
    strategy itself -- the 'watchdog' for disconnections is already
    available here, but try also this and this.

    But reacting to a crash is another story.

    You want some code to react to the crash?
    The basic idea is have your strategy emit a 'heartbeat' of some
    kind, and to write a separate 'watchdog' monitor (which is ideally
    a separate program) to react if the heartbeat fails to appear a
    certain number of times.

    Like I said, this kind of automated heartbeat/watchdog coding is
    not exactly trivial, and is not exactly guaranteed to work in every
    case. Fault-tolerant software and hardware are not cheap.

    Oh, you want your brain to react to the crash?
    Having your strategy notify you when a trade occurs and then
    being able to pause your life to actively watch the trade visually
    is probably the best defense against crashes.

    You should have your Broker's help desk number on speed dial
    and, when a crash occurs, be ready to call for help to exit the
    position.

    You asked for some solutions to a very broad but complicated
    problem. IMHO, there aren't many to choose from.

    Just my 2˘.

    Comment


      #3
      I meant for when my internet connection gets severed for a few days or for when my ninjatrader just terminates or my windows crashes or my computer losses power. Looking for solutions to more severe things. I cant watch since I work and the only way for me to end an order is to remote in from my phone to my computer then to NT to change an order (IF everything is still working).

      Comment


        #4
        Those are all catastrophic outage events.

        Sounds to me like in all the cases you specify, you would need
        to call your broker and get their help to exit the position.

        If 'calling your broker' is the action you would take if any of the
        above events happen, ok, well, now you need a way to watch
        for the occurrence of the above outage events.

        Obviously,
        Having a server-side stop loss is the first and best idea.
        Using a VPS also has particularly fine merits.

        After that, like I said, it's a rather difficult problem to solve
        to automatically monitor and be notified of these kind of
        catastrophic outage events.

        Geez, in the worst of the worst catastrophes, even the ability
        to call your broker may be severed. Electrical power outages
        could affect cell phone towers, and/or landlines could be severed.

        Maintaining a home phone via traditional landline (not VOIP or internet
        based phone service) is actually a good idea -- if for nothing but having
        an alternate method to call your broker in an emergency.

        You want hardware/software/electrical fault-tolerance which means
        you basically need to think in terms of backups for the backups.

        Well, like I said, it won't be easy and it won't necessarily be cheap.
        Pick your battles wisely.

        Good luck!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        595 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        554 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X