server based auto strat - futures io
futures io futures trading



server based auto strat


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 2 posts (2 thanks)
    2. looks_two NetTecture with 2 posts (2 thanks)
    3. looks_3 gparkis with 1 posts (0 thanks)
    4. looks_4 liquidcci with 1 posts (0 thanks)
    1. trending_up 1,401 views
    2. thumb_up 4 thanks given
    3. group 5 followers
    1. forum 5 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

server based auto strat

(login for full post details)
  #1 (permalink)
New York City, NY/USA
 
Experience: Intermediate
Platform: NT
Trading: 6E, ZN, CL
 
Posts: 121 since Dec 2010
Thanks: 3 given, 74 received

when employing a server based auto strategy with regards to NT7 and the server goes down then in all respects so does the auto strategy.

when server and NT7 are back up and on, does the auto strat pick up where it left off or does it start anew?

Started this thread Reply With Quote

 
 
(login for full post details)
  #2 (permalink)
Szczecin
 
Experience: Intermediate
Platform: Ninja, writing own now
 
Posts: 212 since Mar 2010

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.

Reply With Quote
 
(login for full post details)
  #3 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,728 received



NetTecture View Post
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.

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.

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Szczecin
 
Experience: Intermediate
Platform: Ninja, writing own now
 
Posts: 212 since Mar 2010


Fat Tails View Post
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.

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Austin, TX
 
Experience: Master
Platform: ninjatrader, r-trader
Trading: NQ, CL
 
liquidcci's Avatar
 
Posts: 865 since Jun 2011
Thanks: 610 given, 1,070 received


NetTecture View Post
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.

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."
Reply With Quote
 
(login for full post details)
  #6 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,728 received


NetTecture View Post
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.

@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).



NetTecture View Post
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.

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.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > server based auto strat


Last Updated on September 18, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts