We have decided to give EVERYTHING for free! What are you waiting for?


There are multiple ideas that you can use to trade with Ichimoku Cloud, we’ll trade using Tenkan over Kijun cross along with using the color of the ichimoku cloud at given candle.

We need to install custom indicators, you can read here how to do so.


The strategy is fairly simple, we will use the timeframe of 15 minutes and will buy when Tenkan crosses Kijun and the Ichimoku Cloud is Red, it will then take profits at 100% or trail the stop loss to 5% from entry price as soon as it reaches 20% from initial buy price.

The trailing stop will only start after the price reaches 20% and it will keep trailing with highest reached price until its either stopped or the pair reaches a 100% from entry.

This is how the strategy would look like on tradingview:

[tv-ideaview idea=”YHToFHfR” width=”980″ height=”980″ language=”en”]


After the installation it should be fairly simple. Copy test_strategy.py located on freqtrade/user_data/strategies to ichimoku.py:

user@computer:~/freqtrade$ cp user_strategies/strategies/test_strategy.py user_strategies/strategies/ichimoku.py 

After that, modify the ichimoku.py with your preferred editor. Add the following line below import numpy:

from technical.indicators import ichimoku

Modify the class name to ichis, it will look like this:

class ichis(IStrategy):

For roi and stop-loss, we’ll use the following settings:

    minimal_roi = {
        "0": 1
    stoploss = -0.1

    trailing_stop = True
    trailing_stop_positive = -0.15
    trailing_stop_positive_offset = 0.20
    trailing_only_offset_is_reached = True

This means that the strategy will take profit at 100% profit, initially it will set a stop loss of -10% and will trail the stop when it reaches 20% profits by moving the stop-loss to -15% from the 20% point, and then it will trail it with the highest reached price.

Find the function def populate_indicators and add the following lines:


Find the def populate_buy_trend function and add:

    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
                (dataframe['tenkan'].shift(1)<dataframe['kijun'].shift(1)) &
                (dataframe['tenkan']>dataframe['kijun']) &
            'buy'] = 1
        return dataframe

For the function def populate_sell_trend you can leave it empty as we’ll use ROI or Trailing stop-loss to sell the position rather than a specific sell trigger. It should look like this:

    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
            'sell'] = 1
        return dataframe
You can create your own sell conditions on bearish Tenkan over Kijun cross or use a simple smacross! Try it and let us know how it goes in the comments.

Now you should be able to backtest the strategy and modify accordingly to your preferences. You can read more about backtesting here and about the ichimoku cloud here.

  • berlinguyinca
    12:31 AM, September 2019

    credit should be given to the codes of freqtrade a d technical

    • CryptoCue
      3:06 AM, September 2019

      Hey Berlinguyinca, we appreaciate the work from freqtrade along with your own repository. We do cite the freqtrade technical github in the post where we explain how to add custom indicators.

  • James
    9:16 AM, December 2019

    I get these error , I cant see anything diff between your post anf my “py” script/file
    ” ichi=ichimoku(dataframe)
    NameError: name ‘dataframe’ is not defined”

    • CryptoCue
      10:52 PM, January 2020

      Please share your strategy file on a pastebin link and we’ll take a look.

  • Chirayu
    9:25 PM, April 2020

    Getting error, seems like trailing_stop_positive can have a value below zero. Is -0.15 the correct value?

    2020-04-24 21:21:20,494 – freqtrade.configuration.config_validation – CRITICAL – Invalid configuration. See config.json.example. Reason: -0.15 is less than the minimum of 0

    Failed validating ‘minimum’ in schema[‘properties’][‘trailing_stop_positive’]:
    {‘maximum’: 1, ‘minimum’: 0, ‘type’: ‘number’}

    On instance[‘trailing_stop_positive’]:
    2020-04-24 21:21:20,497 – freqtrade – ERROR – Fatal exception!
    Traceback (most recent call last):
    File “/freqtrade/freqtrade/main.py”, line 36, in main
    return_code = args[‘func’](args)
    File “/freqtrade/freqtrade/commands/optimize_commands.py”, line 48, in start_backtesting
    backtesting = Backtesting(config)
    File “/freqtrade/freqtrade/optimize/backtesting.py”, line 80, in __init__
    File “/freqtrade/freqtrade/configuration/config_validation.py”, line 80, in validate_config_consistency
    File “/freqtrade/freqtrade/configuration/config_validation.py”, line 58, in validate_config_schema
    raise ValidationError(
    jsonschema.exceptions.ValidationError: -0.15 is less than the minimum of 0

    • CryptoCue
      1:06 PM, April 2020

      Trailing stop is now a positive value so it needs to be higher than 0.

Leave a Reply

Your email address will not be published. Required fields are marked *