REpost: The Stray Kids Strategy – The BEST trading strategy I found yet! (Patreon)
Content
In this blog post, I will continue my search for the best trading strategy. This time I will be inspired by the famous kpop band Stray Kids.
SEE POST: https://www.patreon.com/posts/83997043 FOR THE STRATEGY FILES!!
And for the real fans of Stray Kids, they know ofcourse that the band also has a symbol that contains the letters SKZ.
This time I will try to create a strategy with indicators that start with these letters. Hopefully for us it is also a very profitable one. At least, proven in the backtests that is and hopefully in real trading after that as well.
For the indicators I will use the pandas_ta library, and I have found some well known ones this time. SO let’s start off with the first one and that is the:
- S – For the S I will use the supertrend indicator. Now this is a popular technical analysis tool that helps identify the direction of a trend and potential entry or exit points in the market. It plots a line above or below the price chart, indicating the current trend’s direction. Traders can use the Supertrend indicator to generate buy or sell signals, with a change in color or position of the line suggesting a possible trend reversal or continuation. But here I am going to use the supertrend to make a distictin between the bull and bear markets. Here I will use a ATR length of 10 and a heafty ATR factor of 5.
- K – The K will be the Kijun sen. This is also known as the “baseline,” is a component of the Ichimoku indicator. The Kijun Sen acts as a support or resistance level, reflecting the equilibrium price in the market. Traders often observe the interaction between the price and the Kijun Sen to assess trend strength and potential reversal points. The kijun sen will be used here to identify medium trends in the bull or bear markets and I will use the default Ichimoku settings for this since they are generic and most people use these.
- Z – And finally there is the Z which will be the Z-score. The Z-score is a tool used in trading to understand how far away a data point is from the average. It tells you if something is unusually high or low compared to what is typical. By looking at the Z-score, traders can identify extreme price levels or situations where the market might be overreacting, which can help in making decisions about when to buy or sell. The Z-score will be used to measure momentum and is sort of a filter to prevent unnecessary trades. I will use 14 periods in this case.
Trading rules
This time, mostly based on the indicators, the strategy will be trend trading. The strategy will both go long and short, but I will test later which one does have better changes to profite future gains.
For now the following enter rules apply:
- Only enter LONG trades when the supertrend indicates a bullish trend
- Also the price should crossong above the Kijun sen
- Finally the zscore should be above 0 to determine the last part of a valid signal for long trades here.
To exit this trend, the price should close again below the Kijun. This Kijun sen acts also as a initial stoploss and as a trailing stop loss in this case.
ROI of 100 percent or Stoploss of 25% loss are also allowed in this strategy to exit the trade. Mind you that these will be optimized later so the initial backtest results can be better later on.
The trigger setting on the Z score tries to prevent overtrading and zigzagging around the kijun sen without first having the market to cool down.
For SHORT trades all these rules are reversed. So enter a trade here where Supertrend is bearish and close price crosses below Kijun. The z-score should also be below 0 to make this a valid signal.
The trade is closed again when the close price gets above the Kijun again.
First I will install Pandas TA library into Colab since it is not part of the default library set here.
!pip install pandas_ta
Requirement already satisfied: pandas_ta in c:\users\bas\anaconda3\lib\site-packages (0.3.14b0)
Requirement already satisfied: pandas in c:\users\bas\anaconda3\lib\site-packages (from pandas_ta) (1.4.2)
Requirement already satisfied: pytz>=2020.1 in c:\users\bas\anaconda3\lib\site-packages (from pandas->pandas_ta) (2021.3)
Requirement already satisfied: numpy>=1.18.5 in c:\users\bas\anaconda3\lib\site-packages (from pandas->pandas_ta) (1.21.5)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\bas\anaconda3\lib\site-packages (from pandas->pandas_ta) (2.8.2)
Requirement already satisfied: six>=1.5 in c:\users\bas\anaconda3\lib\site-packages (from python-dateutil>=2.8.1->pandas->pandas_ta) (1.16.0)
Then I’ll load all the necessary modules in my notebook
import pandas as pd from pandas import DataFrame import numpy as np import pandas_ta as pta pd.options.display.max_rows = None
After this is done I will load the necessary data like this:
# from google.colab import files
# uploads = files.upload()
# Load local file (same dir as notebook)
df = pd.read_json("./BTC_USDT-1d.json")
Followed by the creation of the dataframe and then showing it’s contents
df = pd.read_json("BTC_USDT-1d.json")
df.columns=['date','open','high','low','close','volume']
df['date']=(pd.to_datetime(df['date'],unit='ms'))
df.head()

Now that everything is set up, let me add the necessary indicators to the dataframe so that they can be used for the trading rules.
If you want to know more on how these indicators can be added or how to configure them, then use the help() function and add the inditacor name to it so to get the help output to the screen.
I have given examples in my earlier trading video’s about this so please watch those if you are not so sure on how to do this.
SO, lets add the z-score, supertrend and Ichimoku indicator to the dataframe next.
First the Z-score
df['zscore'] = pta.zscore(close = df['close'], length = 50)
Next I’ll configure the supertrend. And note here that the variables are configured separately for ease of configuration.
Also the supertrend will give two values here. 1 for bullish trend and -1 for bearish trend. Very convienient…
st_length = 10
st_mult = 5.0
df['st'] = pta.supertrend(high=df['high'], low=df['low'], close=df['close'], length=st_length, multiplier=st_mult)[f'SUPERTd_{st_length}_{st_mult}']
And finally I’ll ad the Kijun sen to the dataframe. I have made another video series especially around strategy building and the Ichimoku indicator, so watch those for more information about this indicator.
TS = 9
KS = 26
SS = 52
CS = 26
OS = 0
df['kijun'] = pta.ichimoku(high=df['high'], low=df['low'], close=df['close'], tenkan=TS, kijun=KS, senkou=SS, offset=OS)[0][f'IKS_{KS}']
And not that this is all set up, let’s see how the dataframe looks at this point.
df
This looks good so far. Let’s continue with the actual trading signals next.
The long signal is when the supertrend is bullish, close price is above the kijun sen and zscore above 0. So let’s add that signal to another dataframe column here.
df['long'] = (df['st'] == 1) & (df['close'] > df['kijun']) & (df['zscore'] > 0)
And ofcourse for shorts everything is reversed here.
df['short'] = (df['st'] == -1) & (df['close'] < df['kijun']) & (df['zscore'] < 0)
Let’s show the dataframe and the long and short signals here:
df[df['long'] == True].tail(15)

df[df['short'] == True].tail(15)

Coding the strategy into bot language
Now it is time to code this strategy in Python so that the Freqtrade bot can understand it and can act on the signals for backtesting this strategy.
I will create a file for futures trading and one for spot trading to compare the differences. I will also test on multiple timeframes as you already might know, so that I can find out on which timeframe this strategy has the highest chance to make money in the future as well.
And finally I will optimize some settings to try to find out if the initial settings are sufficient or can be improved so that this strategy has higher chances in the future.
Initial backtest results for Futures trading
Now when I started this fun series on trading strategies based on kpop groups, I never thought that such a simple concept would deliver me such profitable strategies. This really, really, really blows my mind blows my mind. I have never seen these backtest results on the futures pairs. Most of the time the futures pairs stay behind the performance of the spot pairs. But in this case it is just a super result.
The numbers are good all over the place. over 64 percent of the pairs respond very well to this strategy. Even almost 70% on the 4 hour timeframe.
The ratios are also very nice, see that Calmar and sortino ration. Even the Sharpe ratio does not complian.
The Drawdow is also very good. Only 17 percent on the daily timeframe is very respectable.
And these profits are unbeleivable high. Now please remember that these are backtest results and do not guarantee anything for the future here. And also the winrate is pretty low here so you’ll might have to endure a lot of losing trades before the big winners set in.
A quick look on the profit plot shows that this strategy has a very good looking inclining profit line. And the drawdown period here is also very short. Which keeps the profits in your pockets.
Now Gala here had a major pup here which the backtest caught. You’ll have to remember that this probably wont happen in the future anymore, so do not count on these pumps.
But overall this chart is very admirable and I honestly cannot say much negative things anymore here.
So let’s quickly hop over to the backtest results of the spot trades and see if these are as spectacular as what we see here.
Initial backtest results for Spot trading
As if the futures results were not spectacular enough, the spot trading version proves to be even more profitable in the backtest. This version scored much lower thouhg because the amount of pairs that respond is lower and also the ratios score a little bit worse.
Furthermore the drawdown is double of that of the futures trading, while the winrate stays roughtly the same.
You can see that as well on the profit charts. The drawdown is much larger and goes deeper, while the buildup of the total profits looks like stairs. Something you actually do not want to see. The end amount of profits clearly depend too much on some caught crypto pumps here.
So let’s quickly find out if the futures trading can be optimized further by tweaking its ROI and stoploss settings. I think that the inital other parameter settings are good enough at the moment here.
Optimizing the strategy with hyperopt
And after optimizing the ROI settings and the Stoploss distance and backtesting over the same pairs, timeframe and timerange I get the following results back.
As you can see here the amount of pairs that respond well to this strategy is almost 78 percent. And that is the highest I have seen so far.
Now funny enough, except for the Sharpe ratio, all the other numbers did not increase. So apparently again I found the optimal settings right at the first time of creation. For the total score it did not matter much though because that only dropped 15 points to a total score of 300.
And the profit chart shows here a little bit what happens at a higher level. There is indeed a somewhat deeper and longer drawdown here. And the bot does not seem to be that active with these settings strangely enough.
The distribution of the profit per coin is pretty gradual, that is, no staircase pumps but a steady increase per pair.
So knowing this, let’s see where this simple but very effective strategy ends up in the strategy league…
Strategy League
If you followed my videos up to this one, you will probably remember what score the best performing strategy was until now.
And it should not be a surprise anymore that you are now looking at the new number one strategy.
By looking at the scores you can also see why this is such a good performing strategy.
The profits are off the chart and so the Calmar ratio as well. Adding up the lowest drawdown in the top 10 and a good high amount of pairs that respond well and you can summarize that this strategy is certainly worth a try.
It is even so simple that you can backtest or trade it by hand and maybe find tweaks that optimize this strategy even further.
And I think that is even more valuable than testing and scoring with this methodology. Finding an easy to understand and doable trading strategy that you can even do by hand and does not require much parameters but still will make you lots of money.
End
So I hope you are as delighted as I am to find this strategy and I will certainly pick this one up myself to improve even further.
As said in the ATEEZ strategy, it is funny how things go in the world of finding good trading strategies. It started as a joke, but up until now I found the best trading strategies with it so far… Which makes me wonder how will future strategies perform and can I find even better algos in the future?
So thank you very much for reading this post and I will see you in the next one…
Goodbye…