0% found this document useful (0 votes)
354 views2 pages

Adx 15m Strategy - Py

This document defines a trading strategy class called ADX_15M_USDT that uses technical indicators like ADX, plus DI, and minus DI to generate buy and sell signals on 15 minute candles. The strategy calculates these indicators on the original dataframe as well as a separate "sell" dataframe. It has a ROI table defining profits at different time periods and a stoploss of -12.55%.

Uploaded by

Mihaf Hahs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
354 views2 pages

Adx 15m Strategy - Py

This document defines a trading strategy class called ADX_15M_USDT that uses technical indicators like ADX, plus DI, and minus DI to generate buy and sell signals on 15 minute candles. The strategy calculates these indicators on the original dataframe as well as a separate "sell" dataframe. It has a ROI table defining profits at different time periods and a stoploss of -12.55%.

Uploaded by

Mihaf Hahs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

# --- Do not remove these libs ---

from freqtrade.strategy.interface import IStrategy


from pandas import DataFrame
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib

# --------------------------------

class ADX_15M_USDT(IStrategy):
ticker_interval = '15m'

# ROI table:
minimal_roi = {
"0": 0.26552,
"30": 0.10255,
"210": 0.03545,
"540": 0
}

# Stoploss:
stoploss = -0.1255

def populate_indicators(self, dataframe: DataFrame, metadata: dict) ->


DataFrame:
dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)
dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)
dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)
dataframe['sar'] = ta.SAR(dataframe)
dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)

dataframe['sell-adx'] = ta.ADX(dataframe, timeperiod=14)


dataframe['sell-plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)
dataframe['sell-minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)
dataframe['sell-sar'] = ta.SAR(dataframe)
dataframe['sell-mom'] = ta.MOM(dataframe, timeperiod=14)

return dataframe

def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) ->


DataFrame:
dataframe.loc[
(
(dataframe['adx'] > 16) &
(dataframe['minus_di'] > 4) &
# (dataframe['plus_di'] > 33) &
(qtpylib.crossed_above(dataframe['minus_di'],
dataframe['plus_di']))

),
'buy'] = 1
return dataframe

def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) ->


DataFrame:
dataframe.loc[
(
(dataframe['adx'] > 43) &
# (dataframe['minus_di'] > 22) &
(dataframe['plus_di'] > 24) &
(qtpylib.crossed_above(dataframe['sell-plus_di'],
dataframe['sell-minus_di']))

),
'sell'] = 1
return dataframe

You might also like