Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Downloads

  • KDA trading strategy.ipynb.7z

Missing 1 file, as this post has not yet been imported.

Content

The KDA Trading strategy

This post is a transcript of the following Youtube video: https://youtu.be/BjgPl96chUk

Hello, and welcome to another post where I challenge myself to make use of a well known person, band, movie or something else familiar and turn it into a profitable trading strategy. At the moment I am focussing to kpop bands and to be specific it is the virtual girl band called KDA.

As you might have seen with the ATEEZ trading strategy earlier, this challenge turned out to be one where I found one of the most profitable trading strategies under backtest circumstances so far. So not only markets can be random, also strategies can be like this. However with some well thought out principles behind this ofcourse.

The set up

The set up for this challenge is as follows. Take the name of a famous kpop artist and find the corresponding indicators. Then try to determine the best strategy that fits this indicator combination and backtest to find out the probability for future potential profits. Finally add it to the strategy league.

The indicators

Because KDA exists of three letters, I’ll make a combination of three indicators. Each letter will correspond to the indicator beginning with that letter. I am using the Pandas-TA librarie in this case and there I found the following three corresponding indicators:

  • K – will be the ‘Know Sure Thing’ indicator. The Know Sure Thing (KST) indicator is a technical analysis tool that combines multiple moving averages to identify trend changes and generate trading signals. It aims to provide a comprehensive view of market momentum and can be used to spot potential buying or selling opportunities.
  • D – This will be the DPO or Detrended Price Oscillator. The Detrended Price Oscillator (DPO) is comparable to a moving average as it helps eliminate price trends, enabling clearer identification of market cycles. The moving average will represent a horizontal line acting as a reference moving average here. The prices is plotted along this line based on their proximity to the moving average.
  • A – And finally there is the Average True Range. The ATR is a technical indicator used to measure volatility in the financial markets. It calculates the average range between the high and low prices of an asset over a specified period, providing insights into the level of price fluctuations.

Traders often utilize the ATR to set stop-loss levels, determine position sizes, or gauge potential market breakouts. And that’s exactly what I am going to do in this strategy. Determining the stoploss and takeprofit of this strategy with the help of the ATR.

Stratey rules

The rules of this strategy are kept as simple as possible.

To buy, the following conditions should be met:

  • The DPO oscillator should be above the horizontal 0 line
  • And the KST line should be crossing above the signal line
  • Stoploss is initially set to 2 times the ATR of the signalling candle
  • And the R:R ratio for take profit is 1:2. So we risk 1 for 2x profit.

For short trades I do the opposite.

  • DPO should be below the horizontal 0 line
  • And the KST line should be crossing below the signal line

The same stoploss and rewards apply here. Stoploss is set 2 times above the signalling candle and takeprofit is 2 times the risk (or in other words the stoploss distance).

One small remark here because I programmed this so that if the close gets above takeprofit or below stoploss in case of long trades, then the close price will determine the exact profits or losses and not the calculated takeprofit or stoploss. So be aware that these r:r values are not exact but can differ a little bit.

In this case there is more profit taken because the candle closes higher than the calculated tp point. And this can also occur with losing trades. You might have a candle that closes lower than the calculated stoploss.

Creating the actual rules in the notebook

The notebook is included in this post as a downloadable file for your own Jupyter notebooks environment.

Initial backtest results for spot trading

In the initial backtest result, where I use the KST and DPO with their default settings. And with the initial stoploss level of 2 times the ATR and a 1 to 2 risk: reward level I get the following results back.

The profits are very good and more than half of the trading pairs respond positive to this strategy. But overall I am a little bit dissapointed in the winrate, drawdown and the calculated ratio's.

For some reason I expected better results from a risk reward system in trading where a lot of traders are so stoked on about. Especially if you look at the lower timeframes it seems that calculating stoploss and takeprofit based on the ATR get's more and more risky because the winrate drops to a meager 30%.

Now this can be all about the setup of the strategy and the indicators I use here and might say nothing about the risk reward setup specific. But for some reason I expected higher numbers here.

Anyway, maybe the profit plot on a high level gives more insight.

The largest drawdown occurs during the start of the last bear market.

Also this strategy seems so suffer from pumps in certain crypto pairs as well. And might I say also dumps, as you can see from the CRV/USDT pair. Now I expected more of gradual increasing steps and not these large vertical lines because the takeprofit is set to 2 times the stoploss distance, which in my theory does not always runs up with the complete parabolic price increase but takes its profits somewhat early. Here it is not a trend is your friend principle but more take the profit and run principle.

Maybe I have more luck with the futures pairs in this case.

Initial backtest results futures

Now I always have to say that the results of futures trading cannot be compared 1 on 1 with the spot trading results. This is because of the differences in trading pairs available and the availability of the timerange data, which is smaller than spot data.

But since futures trading goes both long and short, it doubles the amount of chances a strategy gets to make trades.

Unfourtunately the results of futures trading are not that great either. I'm not too worried about the profit percentage. But I am mostly interested in the winrate, drawdown and ratio's involved with trading.

The ratios are somewhat better but the winrate and drawdown are almost the same. ALso the amount of pairs that respons positively to futures trading is almost the same as with spot trading.

Plot here

Looking at the overall profit plot of this trading system, the most noticable things are the better upward slope this bot has, which is very nice and gradual.

And also the paralellism shows that the bot is almost always busy with trading.

Also the drawdowns are comparable with the market sentiment, but here I have a mixed feeling because shouldnt this strategy also make profits when there are bearish market circumstances? So why is there a drawdown during these times and the profits go down there.

More research has certainly to be done of you think this still is the strategy for you.

Optimizing the stoploss and Risk to Rewards setting

Now that I know which type of trading and timeframe has the most change of future profitability, I had to find out next which settings are actually the optimal ones for setting the stoploss, based on the ATR and the Takeprofit point, which is a factor of the stoploss distance.

After I had done an optimization run with the help of machine learning algorithms I got some different settings than the original ones. Which I mentioned in the beginning of this video. Then I did another backtest run on the already best timeframe and got the following results back:

Now I actually did two runs of optimization here. One where I optimized the stoploss and rik to reward variables and one including the optimization of ROI and stoploss as well.

In the end, bot optimization runs did not manage to improve the original settings of the strategy in such a way it performed way better. The profit or winrate might have gotten better with these optimized settings, but the end score of all these variables stayed behind of the initial backtest.

So apparently there was nothing to improve much anymore.

You can surely argue that the way the stoploss and takeprofit points are wrongly set up or that the actual points where losses and profits are taken are not at the correct levels, or that a trade should be exited at the exact moment where the price hit the level and then exit the trade instead of waiting for a candle close.

Also the indicators that initiate the trade could have been optimized of might not have been the correct ones for this method.

And from a certain point of view these are all valid critiques.

Strategy League

However this is a challenge to create the KDA trading strategy and still a serious attempt to find the best trading strategy overall.

You have to fail fast and often to find the best trading algorithm in the end. And this is just one of these attempts.

But where does this attempt end up in the total strategy league overall?

It end up somewhere in the middle of the total list of trading strategies I tested so far.

So as you can see, not such a bad attempt overall.

And the good thing about this is that we have another tool in our toolkit to make use of in future trading strategies. The usage of stoploss and takeprofit points to use in a trading strategy.

End

And thus we come to the end of this post. I try to be bit more high level and get's quicker to the answer to the question if a strategy has a high chance to be profitable in the future or not.

I'm using the principle of 'fail quick, fail often' more and more.

By using this principle I will not only get more experience in creating and testing new strategies, but also have more change of finding a gem that has to be explored and exploited further. Like in my last video for example.

So if you like these kinds of strategy development posts, please go to the video (https://youtu.be/BjgPl96chUk) and give a thumbs up, subscribe to the channel and leave a comment if you have one.

For now, this is the end of this post.

And I will see you in the next one.

Goodbye...!

Comments

No comments found for this post.