Algorithmic Trading with Python Day 5 Tuning
Автор: Stephen Blum
Загружено: 2026-01-08
Просмотров: 101
Day 5! We are working on algorithmic trading with Python, building our own AI using PyTorch. I am really excited because we actually got the algorithms running last week. Now our next step is tuning and optimizing, since the model processes and learns from data but the results on the screen have not changed much.
If you are just joining after Day 4, the setup is the same but I had some ideas to improve efficiency. For example, when we input data, the model keeps recalculating static embeddings, which wastes compute, so we could store or cache those embedding vectors to speed things up. The main goal is to build an AI for algorithmic trading in specific markets, starting with Bitcoin because it has lots of data.
We are using historical prices and news headlines as input, and the model gives buy, sell, or hold signals, running on PyTorch with a transformer and outputting three classes. Even though we managed to train the model, its performance is not where we want it, so we have to get the loss consistently below one. That means experimenting, like increasing the number of layers from one to four, or trying different optimizers such as AdamW and SGD, which is my favorite.
You can see the loss value on the screen and we want it lower, so another idea is to train on more data using Y-Finance as our source. We are also adjusting hyperparameters like learning rate and batch size, and we can play with dropout or activations for more tuning. Right now, I am pulling in more data and making small changes to see what helps the model improve.
As we try out tweaks, sometimes results get a little better, sometimes not, but recently the indicators look really strong for buy and sell signals, so I am happy about that. Next, we need more data, finish the download script, do more training and tuning, and then finally test the model against real market data.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: