Fully Automated Stocks Trading

Discussion in 'Journals' started by ValeryN, Jun 14, 2020.

Thread Status:
Not open for further replies.
  1. ValeryN

    ValeryN

    Plan is to post random stuff about my trading, hopefully valuable for others, to attract like-minded individuals and perhaps to help others to find their trading edge.

    I believe lots of "trading wisdom” is misinterpreted due to a lack of context. Posting my stuff in this one journal, hopefully, will create this context to maximize value for readers.

    In a past I traded stocks, forex, futures and options. In last few years narrowing it down to just stocks using algorithmic/mechanical/quantitive trading systems, whatever you wanna call it. My most consistent discretionary trading was around shorting stocks, but that glued me to a screen for way too long and I went entirely mechanical.

    Few random facts to start with:
    1. In my early 30-ies, not trading for a living. Just don't trust anyone to manage my money
    2. Trading account: 100-500k USD with Interactive Brokers
    3. Performance target: anything above 20% per year with under 12% max drawdown I consider excellent. Ideally with 9 out of 12 months making money or better. Note that normally my combined systems' model performance is around 40-60% / annual return, but I am giving it lots of rooms for mistakes and potentially broken models.
    4. Live Performance YTD: +54.52% with -14.86% max drawdown. 228 long/360 short trades
    5. Trading Edge: statistical, execution, account size
    6. Trading Vehicle: US Stocks (liquid enough, approx. 3000 at any time)
    7. Strategies: multiple long/short strategies, normally between 3-5. Mostly variations of mean reversion, mostly <5 days hold. If anyone read Bensdorp's book Automated Stock Trading Systems - mine is basically the same approach, just different strategies & execution.
    8. Backtesting: use to be my own and AmiBroker, but since about a year ago it is RealTest (working name), which my trader friend has developed.
    9. Execution software: my own - Kotlin/MongoDB/Docker. Back when I started developing it there were no retail software available to run multiple strategies over a large universe of stocks on a single trading account. I'm fairly certain it doesn't today, but who knows.
    10. Data: Norgate for research, IB for intraday quotes. Use to use IQFeed, but found IB sufficient for my current needs.
    11. The way I trade is shaped by my otherwise very busy schedule. All signals generation, execution and reporting is automated and running on servers. I've built some management tools on top to control remotely if needed. My own "Slack" bot proved to be the most useful.
    Let me know if there are particular topics you're interested in to get this started.

    Included my live "algos" vs SP500 comparison, as for stocks it seems it is a common practice to use it as a benchmark.

    Live Account.png
    Val
     
    Last edited: Jun 14, 2020
  2. qlai

    qlai

    Hi looking forward to reading your journal. What does above mean - you may have up to 3000 positions?
     
  3. Did the short bias in May correct by itself within your system or did you make manual adjustments around that time (and what were the general risk adjustments)?
     
  4. ValeryN

    ValeryN

    Great! Hopefully it will be helpful.

    That means that I'd trade any US stock regardless of index membership. But since most won't have enough liquidity or volatility that normally leaves about 3000 each day, as candidates. I call it tradable universe. Then a bunch of calculations run by each strategy to calculate what hits their criteria and anywhere from 0 to 30 setups are selected for next trading day. Normally under 100 total.

    That is what execution software picks up as an input and does its' magic if they meet certain intraday criteria to "trigger".

    There are daily new/total positions limits per strategy for risk management.
     
  5. ValeryN

    ValeryN

    Checked my records - no changes to short strategies were made in May. It certainly felt like maybe it's worth to stop the bleeding on a short side at times when I looked at daily reports. But they were within their expected parameters in terms of drawdown under similar market conditions so I didn't touch them. Was prepared for way worse.
     
  6. Looking forward to following the journal too. Are you using 2x leverage at IB with these mean reversions systems ? Regarding the data, does the fact that you are using Norgate for research mean that your systems are constructed using EOD data only or have you been able to improve them by incorporating intraday data ? Or is the intra-day data from IB for systems to monitor entries/exits only ? I have not read that book but will grab a copy. Thanks again for posting
     
    tetramorium likes this.
  7. ValeryN

    ValeryN

    The book is certainly worth it. My friend sent it to me and I was so surprised to see such a good quality material. Over first few years I read more than 100 of books on a subject and most turned out to be garbage. This one has great explanation of key principles, exact strategies rules author uses (or used) and not too much story telling. If friends ask me how my stuff works I just tell them to read it.

    Back to the questions:

    1. Yes, x2, a normal margin account, not a portfolio margin even. At times it would be used close to max but on most days there is no borrowing on margin. I don't have easy way to check it but my guess would be - around 70% of account is invested on average over most months.

    2. Right. Vast majority of research is done on EOD data.

    There is no doubt that my systems would benefit from using intraday data. Historical intraday data has way more limitations than people might realize though. Most of my test runs are done on the whole US Market universe including delisted companies (around 26,000 since 1950). Some data vendors who claim to have the best quality of intraday data charge something like 500$ per symbol for TICK level data and majority will offer only fairly recent data, 10-15 years or so. So if a vendor who would have an ideal data set exist it would hypothetically cost ~13mil USD before discounts. Silly math but still. On multiple occasions I tried to develop strategies using intraday data but not seeing it as a viable options anymore due to availability/performance/quality and cost.

    The way I do use intraday data (a) lots of stats are recorded intraday including correlations with index / volatility (b) for one-off researches such as entry/exit order, executions probability, slippage assumptions validation on some particular exceptional days (c) if I see something funny with my trade like executed outside of official EOD bar or executed in a backtest but not live I'd do manual analysis of intraday chart/tape and make some notes that might be helpful in the future.

    IB data is aggregated few times per second (not a real TICK data) but it is fast enough for my entries / exits use. Also, lots of my orders are resting with exchange somewhat in advance.
     
    Last edited: Jun 14, 2020
  8. guru

    guru


    Quite interesting stuff. I also develop algos, based on 1-15 min intraday data, but only have 12 years of historical data, while the intraday data may actually be adding more noise than necessary. I have more luck with penny stocks where I can at least test 50,000 trades in some backtests.

    Anyway, how much fundamental analysis vs technical analysis do you use in your trade decisions?
     
  9. ValeryN

    ValeryN

    Great to hear it works for you!

    Undoubtably there is lots of hidden gold in intraday data, including edges that only exist on that level. I personally found EOD working well enough not to bother too much considering the challenges mentioned. Though, lots of my early backtesting was done basically just using intraday from IQFeed and I studied tons of examples of big intraday moves when was discretionary shorting stocks. Even purchased per ticker on some occasions for that. Maybe I'm subconsciously using some of those observations or they gave me enough confidence in my underlying assumptions when using EOD.

    Btw, I did see your website and some posts. Very interesting. What would the best place to learn about your approach a bit more? I'm not sure I understand correctly to what extend "Deus" trades are live.

    As for the fundamentals vs technical - only price data so technicals. Most of my testing is done on 1990-current sliced into periods of few years. I love to see a statistical edge holding up longer than that but not all do. Using 1950-1990 data for that. Been talking to GFD about getting more data, as they claim to have the most data going back a century ago, but a price is too high at this point. Their offering is really designed for institutions.

    In terms of number of trades - it is really great to see as many as possible like you mentioned. Some of my tests will actually generate ~10k trades per decade which would give similar sample size to yours over all of my data. I might not choose to trade such a high trade count version of single strategy but will study for risk management / sizing / worst case scenarios modeling.
     
    guru likes this.
  10. guru

    guru

    Cool, so I'm pretty much also using just TA.



    I came up with my system from scratch and didn't read any books, as I wanted to make sure that I come up with original ideas on my own. But it started with brute force testing of every indicator and combination of indicators, as well as coming up with my own indicators. Then evolved into a self-adjusting or self-evolving system.

    None of the specific "Deus" strategies streamed online are live (but they're very realistic real-time paper trades) because I don't have a way of continually improving and modifying them without resetting the statistics and starting over, but then it would look like I'm manipulating them. So I just let them run unmodified, but they are all real-time and pretty much the same as those that I'd trade live. Internally I use different variants of those strategies (I have millions of variants) for trading/shorting penny stocks, as well as for trading UVXY and VXX options based on my TVIX strategies/signals. So basically the main strategy that I traded live (in various variants) was my strategy called "Plutus Shortus" for trading/shorting penny stocks.

    But trading penny stocks isn't that scalable, so actually I'm not too happy as I haven't found clear edges in trading large cap stocks, so I don't even trade those at all.
    I setup the other online strategies, like for large cap stocks, mainly because of couple friends who trade options asked me to extract whatever strategies I can and they'd try to use them as signals for trading options. So I only turned-on couple large cap strategies that seem to have consistent win rates, but with unpredictable losses. This way options can be used to limit losses while having decent win rate. Couple other people also told me that they're doing really well trading large caps directly using my trades/signals, but they review each trade, decide to get in or not, and manage their own stops and exits. I imagine this working well when you know, for example, which stocks may be affected positively or negatively by specific news. While an algo cannot know that.

    I may also have an edge in trading leveraged ETFs, but drawdowns can be large and the edge difficult to confirm, so this is on my back burner.

    Anyway, recently I've put all my live/internal trading on hold because I was unhappy that I didn't make sufficient progress with creating a system for trading options. So now I'm fully focused just on options and basically want to figure out whatever can be figured out in that area.

    Trading isn't even my goal in general, unless I find very solid edges. I love creating software and have many other ideas not related to trading, so I may stick to trading only when I am able to identify very clear edges. Otherwise I may move on and do other things, besides maybe finalizing some penny stock strategies that could run mostly unattended.
    Though from my initial tests, options do show some potentially powerful edges that I need to explore further, so this is my plan for this year. Maybe I can even combine both systems in the future, to trade options automatically based on whatever trades or signals my stock strategies generate.
     
    #10     Jun 15, 2020
    .sigma, Angelo_60, ValeryN and 3 others like this.
Thread Status:
Not open for further replies.