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

Downloads

  • 2024.15.Chispei.zip

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

Content

Intro

Hi there, and welcome to another post where I dive into another trading algorithm for cryptocurrency bot trading.

This time I will analyse the Chispei algo that I found on Github. So let's start quickly.

The strategy

The code for this trading strategy is pretty short. Less than 65 lines. So this video will probably be a short one.

Unfortunately there is no author in the description of this code so if you recofnize this as your own work or know who made this. All the kudo's are for you or your friend who made this code.

When I searched what Chispei meant, I found out that it could be Portugese. Since translating Chispei from Portugese into English means Sparked. But that's the only clue I have from this code.

Anyway, Let's begin with the strategy itself.

From what I understand from this code:

Timeframe

There is no timeframe set, so this will come from your config or the commandline with which you executed this algo.

Take profit

There are multiple ROI levels where profit can be taken after a certain amount of time.

class Chispei(IStrategy): # Minimal ROI designed for the strategy. minimal_roi = { "5127": 0, "1836": 0.676, "2599": 0.079, "120": 0.10, "60": 0.10, "30": 0.05, "20": 0.05, "0"

Stop loss

The stoploss is set to over 32 percent, which is quite large. But it is probably needed to let this strategy breathe.

stoploss = -0.32336

Furthermore there are a few simple indicators set.

Indicators

A Fast moving average, slow moving average and the Momentum indicator from the TA library.

def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # SMA - Simple Moving Average dataframe['fastMA'] = ta.SMA(dataframe, timeperiod=13) dataframe['slowMA'] = ta.SMA(dataframe, timeperiod=25) dataframe['mom'] = ta.MOM(dataframe, timeperiod=21) return dataframe

As for the enter and exit signals.

Trade enter

The trade will be entered when the 21 period momentum indicator gets below the 15 level. And the 13 period fast moving average will get or is above the 25 period slower moving average.

Trade exit

And besides the ROI and stop loss, the trade will also get an exit signal when the momentum indicator is above 80 and the fast MA gets or is below the slow moving average.

Backtest results

And this is basically it. THe complete strategy that is turned into code for automatic trading and , in my case, automatic backtesting.

So let's quickly turn to the results I got of this test.

According to the backtest I did over multiple timeperiods, the 4 hour timeframe has the best results.

It had a total winpercentage of 244 percent with a winrate of 52 percent. It's nice to see that the amount of wins and losses are almost equal and that the profit factor of above 1 causes this simple strategy to be profitable in this backtest.

But if you look at the performance ratio's then you see that this strategy does have lower numbers. If these are below one, then you should be aware of the risks involved using this strategy.

And what better way to see the performance of a strategy by looking at the profit curve and the drawdown curve.

You can see that using this strategy under the right conditions can be quite profitable. Especially during bull cycles. But when the bears arrive, it's better to put this algo in the closet for some time.

BEcause during those times you have a high chance to give your profits back to the market.

This behavious makes the strategy always zigzag around the 0 line if you look at the average profit and loss line on this plot.

And comparing the performance indicators of this simple strategy with those of the 10 strategies that score the highest. We clearly can see the weak points here.

No visible profit column, but the highest drawdown. Minimal CAGR, Sharpe, Sortino and Calmar ratio's and other bad performances here.

So the fact that a strategies code is available in multiple git repositories if you search for trading algo's will not guarantee that it is always a good strategy. Except for the special bullish market conditions it will thrive ofcourse.

But we already knew that ofcourse over the time I make these videos.

Strategy League

So what I told you in the beginning of this video is true. The video is nice and short and will only contain the bare necessary information.

This strategy is profitable and optimizing it may be the answer to make it perform better. But it will introduce curve fitting and the possibility that it will perform even worse in the future.

That's why I will leave it at this. So to not waste anymore of your valuable Youtube time.

Thanks for reading this post and I will see you in the next one with hopefully some better results.

Goodbye!

Comments

No comments found for this post.