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

LOGIN
Freqtrade

It’s possible to use freqtrade with multiple timeframes or timeframes that are not normally supported by the given exchange, say 6hr timeframes on Huobi.

We need to import a few functions and we need to install custom technical indicators.

from technical.util import resample_to_interval, resampled_merge

The idea is simple, freqtrade will construct the candles we want to use by using a smaller candle, so we always go from lower to higher, for example, from 1h to 6hr. We’ll need to create these on def populate_indicators function:

dataframe_6h = resample_to_interval(dataframe, 360)
dataframe_6h['ema150']=ta.EMA(dataframe_6h, timeperiod=150)

We created a 6hr candle and the ema150 for it, its important to note that the ticker you use will be converted to 6hr, in this case, you’ll need to use anything below 6hr that is multiple of 6h and its provided by the exchange.

Now we need to merge it back into the dataframe, in the same function, we’ll add:

dataframe = resampeld_merge(dataframe, dataframe_6h, fill_na=True)

That’s it, now we have created a 6hr interval and have OHLC of the 6hr in the regular dataframe, along with the ema150. Below we’ll show an example of how to use it inside def populate_buy_trend:

dataframe.loc[
    (
    (dataframe['resample_360_ema150']>dataframe['resample_360_close']) &
    (dataframe['resample_360_ema150'].shift(1)<dataframe['resample_360_close'])
     ),
     'buy'] = 1

In this case we want to buy when the price of current candle closes above ema150 of the 6hr candle AND close of last candle was below on the candle before last one (crossover from qtpylib can be used as well).

Leave a Reply

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

Privacy Settings
We use cookies to enhance your experience while using our website. If you are using our Services via a browser you can restrict, block or remove cookies through your web browser settings. We also use content and scripts from third parties that may use tracking technologies. You can selectively provide your consent below to allow such third party embeds. For complete information about the cookies we use, data we collect and how we process them, please check our Privacy Policy
Youtube
Consent to display content from Youtube
Vimeo
Consent to display content from Vimeo
Google Maps
Consent to display content from Google
Spotify
Consent to display content from Spotify
Sound Cloud
Consent to display content from Sound
Cart Overview