please make sure your hardware doesn't generate ( random ) errors , and also triple check your random number generator , which in modern computers is normally software generated ( Pseudo Random Number Generator ) , unfortunately erroneous input data is hard to detect quickly ( essential if you need rapid execution of transactions )I've spent the last rainy Melbourne week exploring AI and whether or not it could be usefull in trading.
This is something that I've attempted before, but given up as i didn't have the time. I still don't have the time, but I do have chatGPTwhat could go wrong !!!.
My system/setup is :
- Visual Studio 2022.
- Python.
- TensorFlow (GPU Version).
- Norgate Data Platinum.
Last week I did set all this up and got everything working to run a simple test. WHY does setting up anything have to be soooo damn hard. NOTHING installed correctly, modules that should work didn't etc, trying to get the TensorFlow to use the GPU.... This was probably the hardest step of all and took over 2 days. ChatGPTwas more useless than ever here.
This rainy week, I spent arguing with ChatGPT, but i initially managed to get a model built and trained on AAPL data. It was really only after i ditched chatGPT and started exploring the code it gave me that i was finally able to build something that worked and could be expanded on.
My initial testing is on the Nasdaq100. I have now trained a simple network on the Nasdaq100 from 2000 up until the start of 2021. My simple strategy was that the AI would buy the 5 best stocks and sell them in a week. SO, it had to pick the 5 stocks with the highest probability of the highest returns for 1 week and then sell. To get a reasonable sample it did this every day, ie every day it bought the 5 best stocks and sold them 5 days later, so on any given day it had 25 parcels.
Here's the results of my latest Bot that i've run on the NDX for 2021 (ie, data it wasn't trained on).
- NDX Index UP 26%
- @Nick Radge TLT UP 13%
- AI Bot was UP 43% (with a number of anomalies, probably to do with the data importing or public holidays)
** Note i may have some delisted bias as i haven't incorporated that code yet, this is all still a test **
While i have NO definitive answer yet and the initial testing was mixed between encouraging and disheartening, the more i play the more i wonder if the Bot can trade better than me.
Time to switch off for the weekend.
anythingHi Divs,
What sort of random errors ?
I would hope that TensorFlow generates any random numbers from a clock seed(CPU/GPU or RTC).
It is definitely something i should look at though, especially since in a Neural Network it would be impossible to find.
Not sure how often i should train, potentially each weekend, but this is also something to test. ie, compare results on a model trained each year vs each month vs each year and work out a point.ive followed along a tutorial before doing some AI on gold futures. so there are some resources out there. i'm sure more will come available as more get involved. though i think the edge will disappear by then. but theoetrically you could also run similar models on some large etf's, groups of indexes, groups of futures, or do it all on individual stocks as well. so plenty of room for ideas. i think once you find the right kind of learning/training model, and a good balance of IS/OS material, etc., it'll become easier. also, how often do you tune/opt your model? AI models drift...always hard questions to answer even for Data Scientists.
90 is a lot. My inputs need a LOT of work, it's what i'm doing today actually. I'm culling them down to perhaps just the series of RSI(), ROC() and maybe V/MA(V) then build or cull from there to see if it helps.90 seems like a lot. Though, maybe it's not? probably fewer indicators too, as a lot of them just express similar things but in slightly different ways. I think maybe finding something that is highly correlated but quicker reacting could be an attempt at a leading indicator. I wonder if, say, changes in FX could be something? Why? FX tends to change quickly to world events, news, etc. Though maybe I'm completely off. Don't know. I know some have tried to use seasonal data for weather to help predict direction of agriculture futures. Maybe a data input that is not price could help aid in training?
i think that's a good plan, with the rolling windows.Not sure how often i should train, potentially each weekend, but this is also something to test. ie, compare results on a model trained each year vs each month vs each year and work out a point.
It also leads to how far back should it be trained, Is a rolling window of 5 years better than a start point of 2000. How valid is the old data vs newer data OR do we train from 2000 to see how it handles 2000,2008,2011.
My current thinking is to test a 5Y rolling window. and shorten the periods, ie, 1 year, 6months between training sessions to see if there's improvements.
RSI and ROC are good. Including volume I think would be useful. And a volatility measure would also be useful as well, I think. Which vol meausre you use will probably depend on the data set (that is, vol measure for indexes such as ASX300, or S&P500? etc)90 is a lot. My inputs need a LOT of work, it's what i'm doing today actually. I'm culling them down to perhaps just the series of RSI(), ROC() and maybe V/MA(V) then build or cull from there to see if it helps.
Interesting and not surprisingly:. You face the same problem as we do building system by hand and optimising parametersRSI and ROC are good. Including volume I think would be useful. And a volatility measure would also be useful as well, I think. Which vol meausre you use will probably depend on the data set (that is, vol measure for indexes such as ASX300, or S&P500? etc)
volatility ?? in the current scenario where there are reports of an increase in trading zero days ( to expiry)options at the expense of other option tradingRSI and ROC are good. Including volume I think would be useful. And a volatility measure would also be useful as well, I think. Which vol meausre you use will probably depend on the data set (that is, vol measure for indexes such as ASX300, or S&P500? etc)
Not to mention future leaks.Interesting and not surprisingly:. You face the same problem as we do building system by hand and optimising parameters
Do not over fit, take volatility into account, which realm , what about volume and not just price, etc
I am 100 certain AI can help , but by hiding part of the process, it can be even more dangerous than the manual big prone approach where we are least try to understand what is done.
Having faith with this approach and substantial of your own money involved will not be easy in chaotic times.
Well done and following with great interest
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?