Pretty irrelevant - firs, nInja is not terribly good at syncing, second if you check ninja you see the strats do not autostart.
Anyhow, in a server failure scenario you can have massive losses simply because you may be in a position without stop (execution not reported, ninja never puts the stop in as it is not running). Ninja syncing is your smallest problem - you should manually make sure your account and positions are in order.
This post has been selected as an answer to the original posters question
When running a strategy, it is possible to
-> let NinjaTrader manage the exits (OCO either profit, trailing stop or initial stop)
-> add a hard stop at the exchange which is far away from the stop managed by Ninjatrader
In case that the server goes down, you still have the hard stop at the exchange. With the hard stop you may suffer from larger losses than usual, but you are still covered against a major event. The hard stop would also protect you, if a larger move occurs intrabar (not applicable to range or Renko bars), when your strategy only executes at bar close.
Another way of protecting oneself against a major move would be an out-of-the money option, but this would rather apply to position trading than intraday trading.
No, you do not have a hard stop at the exchange - not under ALL conditions. This is the classical distributed transaction problem most people can not solve. Yes, you ahve the hard stop - IF it is at the exchange. But if the server dies EXACTLY at the right moment, then no, the stop is not in place yet. Because the entry order was sent, but Ninja diedd before getting the execution. Plus, you also may have targets in place, in which case - unless you run that at a broker that does broker side OCO (not sure ninja can do that) - you loose the OCO part even if the target + stop are in place, so you may end up getting hit at both, resulting in an unprotected market condition again.
The ONLY sensible solution is a dead man switch - a second server ,separate data center, taht gets regularly pinged by the Ninja instance (dummy strategy). If the ping is not received, then it connects to the broker, evaluates all orders and positions and flattens the account. Having 2 of them can be seen as sensible baseline security for any larger account, but even one is easy to do and QUITE cheap. I would put one home, one at amazon and one at Azure to be safe - tehy do not need a LOT of code, so the instances can be small.
This is a timing issue, but 10 years designing server software has teached me to look for worst case scenarios.
The following 2 users say Thank You to NetTecture for this post:
Interesting solution to a potential problem I never considered. Thanks
"The day I became a winning trader was the day it became boring. Daily losses no longer bother me and daily wins no longer excited me. Took years of pain and busting a few accounts before finally got my mind right. I survived the darkness within and now just chillax and let my black box do the work."
@NetTecture: Thank you for your answer. I understand that there is a low probability scenario that NinjaTrader or the internet connection stalls just when you send the stop order, such that the position has been entered and the hard stop is not being sent. But if this is to happen, Ninjatrader must break down exactly during the few milliseconds that elapse between sending the entry order and sending the stop order.
Very unlikely. There are other higher probability scenarios (failure of the broker, failure of the connection exchange broker, etc.) which will induce a higher risk.
NinjaTrader does broker side OCO, depending on whether the broker API offers it. With NinjaTrader/Interactive Brokers the OCO functionality is not managed by NinjaTrader, but by Interactive Brokers. In case that NinjaTrader or the internet connection to the broker fails, the OCO will still be correctly executed. However, if the broker fails, it will not work, as OCO is not supported by most of the exchanges (there are exceptions, but then the broker will need to implement the interface with the exchange to transfer the OCO orders).
I would evaluate the probability that NinjaTrader fails during the few milliseconds when an entry order and a stop order is placed as negligable compared to other risks that can not be altered - such as a failure of the broker or the exchange. The protection in such a case can be
-> limited position sizing
-> a long options position
Operational risk can be reduced to a reasonable level, but it can never be excluded.
The following 2 users say Thank You to Fat Tails for this post: