Creating Trend Lines systematically
Today, I would like to present the idea of how to systematically create trend lines to find trends in prices, find divergences in indicators and remove outliers in your trending data. #Trading #Cryptocurrency #AlgoTrading
I see a lot of people that base their systems on trend lines or divergences between some indicator and the price. Although my systems are not related to this kind of trading, it is really fun to come up with new ideas and try quantifying market relations.
Idea is to use quantile regression rather than simple linear regression. What we try to do is to estimate conditional quantile function - intuitively we do not estimate the mean for some population but rather a quantile of this population based on some variables.
Here we have some randomly generated data. It has some trend and we would like to find boundaries of this trend prices, just like we do often with finding divergences or removing outliers.
We can remove every data point that lies above the upper trend line generated by quantile regression and below the lower line generated. It can easily remove you with a systematic manner the outliers from trending data, but it is not the best utility that it has.
This is a plot of an hour of data from ETHUSDT for Binance Futures perpetual swap. You can see a downtrend and we will use quantile regression to find a specific trendline and countertrend in CVD (Cumulative Volume Delta) for this instrument.
We created a model just by doing something like that → statsmodels.formula.api.quantreg('CVD ~ ind', ethusdt).fit(q=0.01). We did the prediction using this model and it looks like that.
A really interesting pattern can be seen in CVD data for this particular hour. You can see quite a significant uptrend and also - as a conclusion - a divergence between price and CVD. I know that a lot of you guys using something like this to predict countertrend entry.
You should try to do something like this for yourself. Firstly on synthetic data created for yourself (it is also a good skill to create appropriate synthetic data very fast) and then on real data, but remember (!) that the most important are ideas - not the technique.
Think about how to use it. Do not focus on making money, but try to think about how this technique can be used in a broader range. The first thing that comes to my mind is something like this.
Find all of the situations on the market when there is the highest divergence between price and CVD measured by the difference between the slope of the trendline of price and CVD. Analyze all of the outliers in those values and check if something is interesting. Be creative.
As @therobotjames mentioned today → that’s it. That’s the tweet.
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
