Home Creators Posts Import Register Favorites Logout

Content

This post is a in depth follow up on my original idea that I have posted on my dutchalgotrading.com blog. I thought it would be nice to give you a more in depth view on how what I think about these subjects.

I hope you like these!

So, In the exhilarating realm of algorithmic trading, Machine Learning-based approaches stand as a testament to the incredible power of data. As a trader, you can unleash the potential of cutting-edge algorithms and artificial intelligence to gain valuable insights, recognize patterns, and make data-driven decisions that can lead to enhanced trading performance.

And that's what we are trying to accomplish as algorithmic traders, using defined algorithms that use data to decide when to take a trade or ext a trade.

At the heart of Machine Learning-based trading lies the ability to process vast amounts of historical market data. The algorithms you employ uses this relevant data points to identify hidden correlations and trends that the human eye might overlook or is not able to act on for some reason (youre asleep..?).

One of the potent machine learning techniques embraced by traders is the Support Vector Machine (SVM). Understand that SVM is a powerful tool for classification tasks. SVM takes historical data as input and "learns" from past outcomes, discerning intricate relationships and patterns between various market variables.

With SVM, you can venture into two key areas of Machine Learning-based trading: trend prediction and signal identification. For trend prediction, the algorithm analyzes historical price movements and associated data to forecast potential future market trends. This predictive ability empowers you to make informed decisions on whether to go long or short on a particular asset.

On the other hand, SVM also excels in signal identification - recognizing moments when certain market conditions trigger buy or sell signals. By feeding the SVM algorithm with data on historical market behavior and the corresponding outcomes, you enable it to "learn" to identify optimal entry and exit points for trades.

This is also roughly what the Freqtrade bot's AI capacities do. Identify the signals, based on machine learning and classify them as a signal to trade or not.  

So, let's explore a practical generic example to illustrate the prowess of Machine Learning-based approaches in the trading world:

Imagine you are trading a prominent cryptocurrency such as Ripple (XRP). The market for XRP is notoriously volatile, making it challenging for manual traders to spot favorable entry and exit points.

As a trader utilizing SVM-based strategies, you input vast amounts of historical XRP price data, along with relevant market indicators and sentiment analysis. The SVM algorithm diligently learns from this data, discerning the subtle relationships between price movements and various market factors.

With your SVM model trained and fine-tuned, you deploy it to predict potential price trends for XRP. The algorithm indicates that a bullish trend might be on the horizon, backed by a confluence of positive factors, including favorable technical indicators and maybe positive news sentiment.

Based on the SVM's prediction, you decide to go long on XRP, expecting the price to rise. As the days unfold, the market aligns with the SVM's forecast, and XRP experiences an upward surge.

However, SVM's capabilities do not stop at trend prediction. It also excels at identifying buy/sell signals within a broader trend. As the bullish trend progresses, SVM identifies a precise moment when it anticipates a short-term retracement. Trusting the algorithm's analysis, you act on this signal, selling your position just before the retracement.

The retracement plays out as expected, and the price of XRP temporarily dips before resuming its upward trajectory. By following SVM's guidance, you successfully navigated the volatility of the crypto market and capitalized on both the broader bullish trend and the short-term retracement.

Machine Learning-based approaches offer traders a competitive edge in a fast-paced and data-rich environment. With the ability to process vast amounts of information and learn from historical data, SVM and other machine learning techniques open up a new realm of possibilities. By harnessing the power of data-driven decisions, you venture into the ever-evolving world of algorithmic trading with confidence, adaptability, and a vision for potential market opportunities.

Using a trading bot

With the use of a trading bot, you can automate the execution of your Machine Learning strategies, allowing you to act on signals and insights instantaneously. The trading bot can monitor markets 24/7, rapidly process data, and execute trades with split-second precision, ensuring you do not miss out on lucrative opportunities even when you are away from the trading terminal.

Moreover, as I said and wrote numerous times earlier, trading bots also eliminate the emotional aspect of trading, ensuring consistency in decision-making. Emotions, such as fear and greed, can often lead to impulsive and irrational actions that deviate from the trading strategy. By entrusting your Machine Learning-based approach to a trading bot, you maintain discipline and adhere strictly to your data-driven models, increasing the potential for long-term success.

Comments

Sander van der Have

This is probably a beginner's question. How does Freqtrader Hyperopt differ from FreqAI? As far as I understand the story and have experience with Hyperopt I see a lot of similarities. You give them as much data as possible and a strategy and you get ideas about when you can best buy and sell.

Dutch Algotrading

This is a question I had and still have myself. As far as I know is that the proposed benefit of AI is that it adapts to new market circumstances by retesting and adapting parameters. Where the Hyperopt session is a one time event and will not automatically adapt (except when you do this by hand ofcourse). Also there are other minor factors in play, but this is mainly it I believe.

Sander van der Have

I always thought i could Hyperopt with a K-fold cross-validation method so i could prevent overfitting. Maybe FreqAI does that automatically, which would be a really nice!

GrantandSarah

I’ve been trying to get FreqAI up and running myself with lightGBM and XGBoost (haven’t tried PyTorch yet) and have gotten a few decent results to start, but have a real hard time running any substantial training period due to RAM requirements. And adding loads more features doesn’t always seem to produce better models vs few parameters it “learns” well. I think 128 GB+ could be needed. Do you know when you plan to release more content on developing and testing FreqAI strategies? And what kind of hardware are you planning to use?

Dutch Algotrading

At the moment I have 64 Gigs installed on my machine and I must say that I am also frequently running into problems when I try to use 10 or more features with my default 50 pairs. I also have a suspision that using these ML techniques do not add such a substantial amount of benefit in comparison with using a good backtested strategy. But besides this my main concern is that I now have a cloud instance server running 2 bot instances with a 'normal' strategy that costs me around 5 dollar per month. If I wanted to use an AI bot, then server capacity has to be a lot bigger, with the additional increased cost factor :-(

GrantandSarah

I think more of the optimization would be with regard to modifying the ML library, model parameters, training periods. I think if given enough data on a few high quality features it might still find a better solution, especially on lower timeframe trends that may escape human perception, or take to long to figure out. PCA also improved results for me on larger feature sets. I spun up an AWS instance to train a larger one and it did better but did cost about $20 for just the training. But, Amazon renewed sells refurbished blade servers from older data centers for a very reasonable price ($300-$400) with 128-192GB RAM, some with server grade gpus ($800-$1400 for 1-2 cpus and 4 k80s). I’m looking at getting the latter soon

GrantandSarah

Classification models on a data frame including a lot of signals to decide when to buy based on which signals trigger together also sounds like a promising avenue to me.

CryptoTee

Bro, use an AWS Spot instance for 90% cost savings. Ping me if you need to know how or for a screenshot. I am running one for 9 years now without any issue!

GrantandSarah

Ran one on AWS for regular freqtrade strategy, but the ram and compute requirements (graphics cards/ #cores) were going to cost $7-$20 per hour for a p, g, or inf type instance capable of doing a freqAI enabled strategy. What kind of workload are you running in your instance and what type of instance you got? Glad to know it’s been working for you so long

frederic auricombe

Do you have tools to predict the size of RAM needed to avoid hardware limitation during training and/or running period?

Dutch Algotrading

Good question. I beleive it is possible to calculate hardware requirement at the major cloud providers. No direct links on hand though. However this amount is also depending on the algorithm and the vectors it uses. Which can be totally different every time. Since I assume we all are small players and the amount of ram needed is in our PC's or virtual machines with low to moderate budget we are mostly 'stuck' to our existing situation.