Fully Automated Stocks Trading

Status
Not open for further replies.
It was a very rigorous task.. it would exhaust me even thinking about it to write the story up again.. it was 3 years ago to the day that I started going live with it.. i cant find the old screencasts I had of it in action but heres what it looked like .. it would try to achieve a balance between immediacy of execution and getting a rebate for providing liquidity... it was very rigorous, thats why I was able to run it without it exploding.. there are more advanced versions of this idea based on optimal stochastic control of Hawkes processes which are realistic models of order flow but I got tired of that game, though the underlying models were very instrumental in me gaining an intuition for how orderflow aggregates from the micro level up to the macro level. See https://dornsife.usc.edu/assets/sites/350/docs/Aditi-USC_Colloqium.pdf.

Building the model: Stylized facts 1-2

*Markets are highly endogenous, meaning that most of the orders have
no real economic motivations but are rather sent by algorithms in
reaction to other orders, see Bouchaudet al., Filimonov and Sornette.

*Mechanisms preventing statistical arbitrages take place on high
frequency markets, meaning that at the high frequency scale, building
strategies that are on average profitable is hardly possible.
InbJD07.png
the corresponding Hawses process is the "almost unstable" case where the limit of the branching ratio approaches one which is a process always poised on the edge of criticality in the sense that it never dies out or explodes. The mathematics is very advanced, "limit theorems for nearly unstable Hawkes processes"
https://arxiv.org/pdf/1310.2033.pdf
 
Did a little retrospect recently on my automation. Flat this year but capital was preserved and still managed have no 2 negative months in a row. Couple of new strategies launched in March did well. Automation failure cost me around 5% early in the year. An adjustment for one strategy was done during peak DD, in next 2 days original version bounced back but new one didn't, another 8-9% down the drain. This is pretty normal stuff. No excuses just facts. No individual event like that could be fully avoided but if they happen one after another, as they occasionally do, it feels more significant than it is.

Watch out for those periods. That is when worst and irrational decisions tend to be made. Eg. rushed strategy changes, stop/start decisions, discretionary trading etc. Step out of it, analyze each event independently, see if you would have done it differently, learn from it, make changes only if needed and move on.

Right now everything is working as expected. Every now and then I do have time to do a deep dive to reflect on making things even better. Been way too busy with business and life for that recently. Perhaps this summer.

2022-06-10_07-48-06.png
 
Below is my main account vs SPX this year. Correlation is 0.26. Longs combined had ~0.5 and shorts -0.3.

Everything is within expected parameters. Fraction of this account was moved to real estate for unrelated to trading reasons.

2 cash accounts (long only) did well and "outperformed" SPX by having 1/3 and 1/2 of its YTD loss.

upload_2022-7-30_9-58-10.png


upload_2022-7-30_10-11-43.png


Val
 
Last edited:
stochastix thats pretty impressive...do you have a Phd in Math ? or Stats ?
hope you are killing it ...
math skills i wish i had. I did a under grad degree in pure and applied but i know the difference between Ave joes like me and the gifted ones in Math :)


best
John

the corresponding Hawses process is the "almost unstable" case where the limit of the branching ratio approaches one which is a process always poised on the edge of criticality in the sense that it never dies out or explodes. The mathematics is very advanced, "limit theorems for nearly unstable Hawkes processes"
https://arxiv.org/pdf/1310.2033.pdf
 
Status
Not open for further replies.
Back
Top