1. Stock Screener Step: In pre-trading, ~2,000 stocks are monitored (No trading takes place, data resolution doesn't need to be tick level). Based upon rule criteria, by 9.29am ~500 of the ~2,000 stocks are chosen to be 'trade eligible' that day. (500, or the max number that can reliably run each day - TBD)
2. Live Trading Step: The ~500 stocks are then watched closely with tick data resolution, with trades entered/exited throughout the day.
I've been able to setup a list of 2,000 stocks and run a strategy against it (basket test) that streamwriter outputs the 500 stocks to trade each day. I've also created a separate strategy that works (basket backtest) against a separate, fixed list of ~500 stocks. Unfortunately I'm a little stuck at:
A) how to actually run a live automated strategy against multiple stocks at once (not basket backtesting, "basket live running")
B) how to dynamically stop following/watching the ~1,500 or so stocks that are not selected for trading on a given day, and subscribe to only the 500 chosen. E.g. I can't be subscribed to 2,000 stocks all day everyday, the system will fallover - I think I need to have the system run against 2k, then when 9.29am-9.30am is reached, reset all of the states to load in a new, reduced list of stocks from a file.
Any advice on A & B would be really helpful please. Ideally if anyone has a super basic Moving Average code example/framework that works on say 5 stocks, that'd be a massive help just to see how it can run. Likewise any code examples showing how to dynamically subscribe/unsubscribe to stocks would be a dream (but don't want to push my luck!). Thanks in advance!
ChainsawDR
Comment