Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

⚡️ Weighted Signal: PVT - Price Volume Trend #54

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions user_data/Total-Average-Signal-Importance-Report.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Signal importance report
--------------------------------------------------------------------
Stake currency: USDT

Total Overall Signal Importance:
--------------------------------------------------------------------
avg | down | side | up
adx_strong_up_down: 53.17% | 46.5% | 50.0% | 63.0%
bollinger_bands: 32.67% | 15.5% | 20.0% | 62.5%
ema_long_golden_death_cross: 43.5% | 67.5% | 49.5% | 13.5%
ema_short_golden_death_cross: 43.17% | 30.0% | 35.5% | 64.0%
macd: 32.83% | 10.0% | 25.0% | 63.5%
rsi: 52.5% | 46.5% | 50.0% | 61.0%
sma_long_golden_death_cross: 43.17% | 63.0% | 42.5% | 24.0%
sma_short_golden_death_cross: 40.5% | 59.5% | 14.5% | 47.5%
vwap_cross: 67.0% | 70.0% | 76.0% | 55.0%
pvt_cross: 30.83% | 77.5% | 11.0% | 4.0%

Total Overall Buy Signal Importance:
--------------------------------------------------------------------
avg | down | side | up
adx_strong_up: 91.33% | 93.0% | 100.0% | 81.0%
bollinger_bands: 30.67% | 0.0% | 0.0% | 92.0%
ema_long_golden_cross: 16.0% | 35.0% | 13.0% | 0.0%
ema_short_golden_cross: 46.33% | 48.0% | 20.0% | 71.0%
macd: 19.33% | 20.0% | 11.0% | 27.0%
rsi: 55.0% | 47.0% | 45.0% | 73.0%
sma_long_golden_cross: 49.33% | 74.0% | 26.0% | 48.0%
sma_short_golden_cross: 51.33% | 100.0% | 29.0% | 25.0%
vwap_cross: 90.33% | 100.0% | 71.0% | 100.0%
pvt_cross: 28.67% | 64.0% | 22.0% | 0.0%

Total Overall Sell Signal Importance:
--------------------------------------------------------------------
avg | down | side | up
adx_strong_down: 15.0% | 0.0% | 0.0% | 45.0%
bollinger_bands: 34.67% | 31.0% | 40.0% | 33.0%
ema_long_death_cross: 71.0% | 100.0% | 86.0% | 27.0%
ema_short_death_cross: 40.0% | 12.0% | 51.0% | 57.0%
macd: 46.33% | 0.0% | 39.0% | 100.0%
rsi: 50.0% | 46.0% | 55.0% | 49.0%
sma_long_death_cross: 37.0% | 52.0% | 59.0% | 0.0%
sma_short_death_cross: 29.67% | 19.0% | 0.0% | 70.0%
vwap_cross: 43.67% | 40.0% | 81.0% | 10.0%
pvt_cross: 33.0% | 91.0% | 0.0% | 8.0%

Losing Open Trade Sell Unclogger:
--------------------------------------------------------------------

minimal_losing_trade_duration_minutes: 36
minimal_losing_trades_open: 4
trend_lookback_candles_window: 24

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion user_data/mgm-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"max_trend_total_signal_needed_candles_lookback_window_value": 6,
"search_threshold_weighted_signal_values": 10,
"search_threshold_trend_total_signal_needed_candles_lookback_window_value": 1,
"number_of_weighted_signals": 9
"number_of_weighted_signals": 10
},
"stoploss_spaces": {
"stoploss_min_value": -0.02,
Expand Down
17 changes: 13 additions & 4 deletions user_data/mgm_tools/Total-Overall-Signal-Importance-Calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class TotalOverallSignalImportanceCalculator:
"buy_downwards_trend_sma_long_golden_cross_weight": 100, # value loaded from strategy
"buy_downwards_trend_sma_short_golden_cross_weight": 29,
"buy_downwards_trend_vwap_cross_weight": 66,
"buy_downwards_trend_pvt_cross_weight": 88,
"buy_sideways_trend_adx_strong_up_weight": 75,
"buy_sideways_trend_bollinger_bands_weight": 64,
"buy_sideways_trend_ema_long_golden_cross_weight": 50,
Expand All @@ -52,6 +53,7 @@ class TotalOverallSignalImportanceCalculator:
"buy_sideways_trend_sma_long_golden_cross_weight": 37,
"buy_sideways_trend_sma_short_golden_cross_weight": 100, # value loaded from strategy
"buy_sideways_trend_vwap_cross_weight": 81,
"buy_sideways_trend_pvt_cross_weight": 74,
"buy_upwards_trend_adx_strong_up_weight": 73,
"buy_upwards_trend_bollinger_bands_weight": 100, # value loaded from strategy
"buy_upwards_trend_ema_long_golden_cross_weight": 49,
Expand All @@ -60,7 +62,8 @@ class TotalOverallSignalImportanceCalculator:
"buy_upwards_trend_rsi_weight": 61,
"buy_upwards_trend_sma_long_golden_cross_weight": 80,
"buy_upwards_trend_sma_short_golden_cross_weight": 100, # value loaded from strategy
"buy_upwards_trend_vwap_cross_weight": 43
"buy_upwards_trend_vwap_cross_weight": 43,
"buy_upwards_trend_pvt_cross_weight": 26
}

# Sell hyperspace params:
Expand Down Expand Up @@ -92,6 +95,7 @@ class TotalOverallSignalImportanceCalculator:
"sell_downwards_trend_sma_long_death_cross_weight": 44,
"sell_downwards_trend_sma_short_death_cross_weight": 72,
"sell_downwards_trend_vwap_cross_weight": 5,
"sell_downwards_trend_pvt_cross_weight": 87,
"sell_sideways_trend_adx_strong_down_weight": 100, # value loaded from strategy
"sell_sideways_trend_bollinger_bands_weight": 0, # value loaded from strategy
"sell_sideways_trend_ema_long_death_cross_weight": 44,
Expand All @@ -101,6 +105,7 @@ class TotalOverallSignalImportanceCalculator:
"sell_sideways_trend_sma_long_death_cross_weight": 100, # value loaded from strategy
"sell_sideways_trend_sma_short_death_cross_weight": 44,
"sell_sideways_trend_vwap_cross_weight": 49,
"sell_sideways_trend_pvt_cross_weight": 67,
"sell_upwards_trend_adx_strong_down_weight": 14,
"sell_upwards_trend_bollinger_bands_weight": 19,
"sell_upwards_trend_ema_long_death_cross_weight": 80,
Expand All @@ -109,7 +114,8 @@ class TotalOverallSignalImportanceCalculator:
"sell_upwards_trend_rsi_weight": 62,
"sell_upwards_trend_sma_long_death_cross_weight": 19,
"sell_upwards_trend_sma_short_death_cross_weight": 18,
"sell_upwards_trend_vwap_cross_weight": 78
"sell_upwards_trend_vwap_cross_weight": 78,
"sell_upwards_trend_pvt_cross_weight": 27
}

####################################################################################################################
Expand Down Expand Up @@ -270,6 +276,7 @@ def main():
'sma_long_golden_cross',
'sma_short_golden_cross',
'vwap_cross',
'pvt_cross'
]

sell_indicator_names = [
Expand All @@ -281,7 +288,8 @@ def main():
'rsi',
'sma_long_death_cross',
'sma_short_death_cross',
'vwap_cross'
'vwap_cross',
'pvt_cross'
]

combined_indicator_names = {
Expand All @@ -293,7 +301,8 @@ def main():
'rsi': ['rsi'],
'sma_long_golden_death_cross': ['sma_long_golden_cross', 'sma_long_death_cross'],
'sma_short_golden_death_cross': ['sma_short_golden_cross', 'sma_short_death_cross'],
'vwap_cross': ['vwap_cross']
'vwap_cross': ['vwap_cross'],
'pvt_cross': ['pvt_cross']
}

# Check if loading parameters from a JSON file
Expand Down
16 changes: 14 additions & 2 deletions user_data/strategies/MoniGoManiHyperStrategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
# Weighted Buy Signal: SMA short term Golden Cross (Short term SMA crosses above Medium term SMA)
'sma_short_golden_cross': lambda df: (qtpylib.crossed_above(df['sma9'], df['sma50'])),
# Weighted Sell Signal: VWAP crosses above current price
'vwap_cross': lambda df: (qtpylib.crossed_above(df['vwap'], df['close']))
'vwap_cross': lambda df: (qtpylib.crossed_above(df['vwap'], df['close'])),
# Weighted Buy Signal: PVT crosses above PVT_SMA (Price and volume increase)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: please fix the # identation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 8f2b61f

'pvt_cross': lambda df: (qtpylib.crossed_above(df['pvt'], df['pvt_sma']))
}

sell_signals = {
Expand All @@ -51,7 +53,9 @@
# Weighted Sell Signal: SMA short term Death Cross (Short term SMA crosses below Medium term SMA)
'sma_short_death_cross': lambda df: (qtpylib.crossed_below(df['sma9'], df['sma50'])),
# Weighted Sell Signal: VWAP crosses below current price
'vwap_cross': lambda df: (qtpylib.crossed_below(df['vwap'], df['close']))
'vwap_cross': lambda df: (qtpylib.crossed_below(df['vwap'], df['close'])),
# Weighted Sell Signal: PVT crosses below PVT_SMA
'pvt_cross': lambda df: (qtpylib.crossed_below(df['pvt'], df['pvt_sma']))
}

# Returns the method responsible for decorating the current class with all the parameters of the MGM
Expand Down Expand Up @@ -117,6 +121,10 @@ class MoniGoManiHyperStrategy(MasterMoniGoManiHyperStrategy):
},
'RSI (Relative Strength Index)': {
'rsi': {'color': '#7fba3c'}
},
'PVT (Price Volume Trend)': {
'pvt': {'color': '#19038a'},
'pvt_sma': {'color': '#ae231c'}
}
}
}
Expand Down Expand Up @@ -182,6 +190,10 @@ def do_populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFr
# VWAP - Volume Weighted Average Price
dataframe['vwap'] = qtpylib.vwap(dataframe)

# PVT - Price Volume Trend
dataframe['pvt'] = qtpylib.pvt(dataframe)
dataframe['pvt_sma'] = ta.SMA(qtpylib.pvt(dataframe), timeperiod=21)

return dataframe

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