Automating Dennis Richard's turtle strategy


The Turtle strategy is one of the most famous and profitable trend-following strategies
Let's see how we can automate it

As well known for the legend that surrounds it as for its results, the "turtle" trading strategy is one of the simplest trend-following strategies
In this tutorial, we will see how we can automate it, and what returns we can expect from it using backtests. (spoiler: they're huge)
For those in a hurry, the strategy we'll be building is also available in the "pre-made strategies" section



1) The Turtle strategy


The turtle strategy's rules are simple.
  • Buy: when the current trading price is higher than the maximum of the highs of the last 30 candles
  • Sell: when the current trading price is lower than the minimum of the closes of the last 20 candles
turtle strategy
Our buy and sell orders, visualized



2) Automating it


As always, we're going to go in bots and click on "new bot"

turtle strategy
We'll be trading on XRP



We want to check if the max of the highs of the last candle is lower than the current trading price
We'll be doing: 0 < [MAX highs 1 period ago] < [Last trade's price]

We're going to click the middle value and set up a 2H, 30 periods MAX on highs.
On the "intervals back in time" field, select 1: we want the past candle's MAX.

turtle strategy
Only three more left!


Press enter, you'll see this:

turtle strategy


Now, it's your turn

With the above explanations and the given rules, you should be able to bootstrap your own custom automated turtle strategy by filling the last three values
Feel free to play with all the parameters: timeperiods, intervals, additional indicators ...
That's the key to profits!


If you're stuck or in a hurry, click on "pre-made strategies" in the bot interface, you'll find the turtle between other strategies.

The solution

Here's what you should have if you applied the rules to the letter :

Buy
turtle buy conditions


Sell
turtle sell conditions

3) Backtesting our strategy


To start a backtest, click on the simulate button

backtest results charts

backtest results recap
We're using binance's 0.1% standard fees
27% of net profits in two months of trading!
Those are quite good results. We should be able to push them even more by customizing a bit this strategy.

4) Running our strategy


After saving your strategy, click on the "enable" button and enjoy the results 😉
We encourage you to enable telegram notifications to be alerted whenever your bot enters a trade.
To be sure that our strategy is profitable, we encourage you to test it for a while on the sandbox exchange.
As a reminder, sandbox trading on kaktana is 100% free, forever.



Trade while you sleep


Skyrocket your returns on the first 100% configurable crypto trading bot.

No PhD required