kikocis/freqtrade-strategies public
Changesets · Branches · Tags · Compare
| Changeset | d775fe5e59f25110c84ba0a0a96f3f47811bea2b425a6a3d9e6cec2643ffd429 |
|---|---|
| Author | Bryan Chain <bryan.chain@cerner.com> · 2021-03-27 20:21 -04:00 |
| Committer | Bryan Chain <bryan.chain@cerner.com> · 2021-03-27 20:21 -04:00 |
| Parents | d9f1602c54d9 |
3 files changed
modified hyperopts/SolipsisHyp_v3.py +5 −2
| @@ -171,12 +171,14 @@ | ||
| 171 | 171 | |
| 172 | 172 | return [ |
| 173 | 173 | Categorical([True], name='droi_enabled'), |
| 174 | + # Categorical([True], name='droi_enabled'), | |
| 174 | 175 | Integer(200, 500, name='droi_profit_factor'), |
| 175 | 176 | Integer(0, 50, name='droi_rmi_start'), |
| 176 | 177 | Integer(50, 90, name='droi_rmi_end'), |
| 177 | 178 | Integer(0, 180, name='droi_grow_delay'), |
| 178 | 179 | Integer(360, 1440, name='droi_grow_time'), |
| 179 | - Categorical(['table', 'atr', 'roc', 'roc-table', 'atr-table'], name='droi_fallback'), | |
| 180 | + Categorical(['table'], name='droi_fallback'), | |
| 181 | + # Categorical(['table', 'atr', 'roc', 'roc-table', 'atr-table'], name='droi_fallback'), | |
| 180 | 182 | Real(0.0, 0.015, name='droi_min_roc_atr') |
| 181 | 183 | ] |
| 182 | 184 | |
| @@ -214,7 +216,8 @@ | ||
| 214 | 216 | Real(-0.05, 0, name='cstp_roc_bail'), |
| 215 | 217 | Integer(30, 70, name='cstp_rmi_trend'), |
| 216 | 218 | Categorical(['atr', 'immediate'], name='cstp_bail_how'), |
| 217 | - Categorical([True, False], name='cstp_pos_trail'), | |
| 219 | + Categorical([False], name='cstp_pos_trail'), | |
| 220 | + # Categorical([True, False], name='cstp_pos_trail'), | |
| 218 | 221 | Real(0.0, 0.03, name='cstp_pos_threshold'), |
| 219 | 222 | Real(0.005, 0.03, name='cstp_trail_dist') |
| 220 | 223 | ] |
| No newline at the end of the file |
modified strategies/Solipsis.py +50 −141
| @@ -12,30 +12,19 @@ | ||
| 12 | 12 | |
| 13 | 13 | LAST OPTIMIZED: |
| 14 | 14 | |
| 15 | -EXCHANGE: Kraken, full pairlists with some personally selected blacklisted coins | |
| 15 | +EXCHANGE: | |
| 16 | 16 | |
| 17 | -USD - 03/25/2021 | |
| 18 | -BTC - 03/27/2021 | |
| 19 | -ETH - 03/27/2021 | |
| 17 | +USD - | |
| 18 | +BTC - | |
| 19 | +ETH - | |
| 20 | 20 | |
| 21 | 21 | USD - |
| 22 | 22 | Global: |
| 23 | 23 | 5m / 1h |
| 24 | 24 | 20210301- / Sharpe / DROI / CSTP |
| 25 | - 1038 trades. 929/0/109 Wins/Draws/Losses. Avg profit 0.86%. Total profit 557.30976144 USD ( 889.87Σ%). Avg duration 436.9 min. Objective: -303.93860 | |
| 26 | - | |
| 25 | + | |
| 27 | 26 | Pairlists (Sorted/grouped by avg. profit in global backtests): |
| 28 | 27 | |
| 29 | - ('KNC/USD', 'OXT/USD', 'QTUM/USD', 'YFI/USD', 'BAL/USD', 'WAVES/USD', 'FIL/USD', 'ANT/USD', 'REPV1/USD', 'ETC/USD', 'MANA/USD', 'LSK/USD', 'CRV/USD', 'MLN/USD') | |
| 30 | - 143/1000: 1292 trades. 1168/13/111 Wins/Draws/Losses. Avg profit 0.74%. Total profit 586.33656072 USD ( 957.50Σ%). Avg duration 197.1 min. Objective: -402.24916 | |
| 31 | - | |
| 32 | - ('ZEC/USD', 'REP/USD', 'GRT/USD', 'UNI/USD', 'FLOW/USD', 'DASH/USD', 'KEEP/USD', 'AAVE/USD', 'BCH/USD', 'ALGO/USD', 'KAVA/USD', 'BAT/USD', 'KSM/USD', 'ETH/USD', 'SC/USD', 'EOS/USD', 'XMR/USD', 'LTC/USD', 'NANO/USD', 'GNO/USD') | |
| 33 | - 81/704: 1744 trades. 1590/24/130 Wins/Draws/Losses. Avg profit 0.65%. Total profit 735.77585861 USD ( 1136.05Σ%). Avg duration 231.8 min. Objective: -535.37970 | |
| 34 | - | |
| 35 | - ('EWT/USD', 'ADA/USD', 'ATOM/USD', 'XTZ/USD', 'LINK/USD', 'XLM/USD', 'TRX/USD', 'DOT/USD', 'OMG/USD', 'ICX/USD', 'OCEAN/USD', 'COMP/USD', 'STORJ/USD', 'SNX/USD') | |
| 36 | - 213/392: 1292 trades. 1130/4/158 Wins/Draws/Losses. Avg profit 0.46%. Total profit 332.13998403 USD ( 599.07Σ%). Avg duration 135.4 min. Objective: -322.25214 | |
| 37 | - | |
| 38 | - | |
| 39 | 28 | """ |
| 40 | 29 | # Sub-strategy with parameters specific to USD stake |
| 41 | 30 | class Solipsis_USD(Solipsis): |
| @@ -95,135 +84,14 @@ | ||
| 95 | 84 | stoploss = custom_stop['decay-start'] |
| 96 | 85 | use_custom_stoploss = True |
| 97 | 86 | |
| 98 | - custom_pair_params = [ | |
| 99 | - { | |
| 100 | - 'pairs': ('KNC/USD', 'OXT/USD', 'QTUM/USD', 'YFI/USD', 'BAL/USD', 'WAVES/USD', 'FIL/USD', 'ANT/USD', 'REPV1/USD', 'ETC/USD', 'MANA/USD', 'LSK/USD', 'CRV/USD', 'MLN/USD'), | |
| 101 | - 'buy_params': { | |
| 102 | - 'base-mp': 73, | |
| 103 | - 'base-rmi-fast': 53, | |
| 104 | - 'base-rmi-slow': 24, | |
| 105 | - 'inf-guard': 'none', | |
| 106 | - 'inf-pct-adr-bot': 0.02261, | |
| 107 | - 'inf-pct-adr-top': 0.89013, | |
| 108 | - 'xbtc-base-rmi': 63, | |
| 109 | - 'xbtc-inf-rmi': 10, | |
| 110 | - 'xtra-base-fiat-rmi': 42, | |
| 111 | - 'xtra-base-stake-rmi': 36, | |
| 112 | - 'xtra-inf-stake-rmi': 15 | |
| 113 | - }, | |
| 114 | - 'dynamic_roi': { | |
| 115 | - 'enabled': True, | |
| 116 | - 'profit-factor': 372, | |
| 117 | - 'rmi-start': 40, | |
| 118 | - 'rmi-end': 52, | |
| 119 | - 'grow-delay': 23, | |
| 120 | - 'grow-time': 652, | |
| 121 | - 'fallback': 'roc', | |
| 122 | - 'min-roc-atr': 0.005 | |
| 123 | - }, | |
| 124 | - 'custom_stop': { | |
| 125 | - 'decay-time': 1316, | |
| 126 | - 'decay-delay': 103, | |
| 127 | - 'decay-start': -0.28, | |
| 128 | - 'decay-end': -0.004, | |
| 129 | - 'cur-min-diff': 0.022, | |
| 130 | - 'cur-threshold': -0.035, | |
| 131 | - 'roc-bail': -0.045, | |
| 132 | - 'rmi-trend': 35, | |
| 133 | - 'bail-how': 'immediate', | |
| 134 | - 'pos-trail': False, | |
| 135 | - 'pos-threshold': 0.005, | |
| 136 | - 'pos-trail-dist': 0.015 | |
| 137 | - } | |
| 138 | - }, | |
| 139 | - { | |
| 140 | - 'pairs': ('ZEC/USD', 'REP/USD', 'GRT/USD', 'UNI/USD', 'FLOW/USD', 'DASH/USD', 'KEEP/USD', 'AAVE/USD', 'BCH/USD', 'ALGO/USD', 'KAVA/USD', 'BAT/USD', 'KSM/USD', 'ETH/USD', 'SC/USD', 'EOS/USD', 'XMR/USD', 'LTC/USD', 'NANO/USD', 'GNO/USD'), | |
| 141 | - 'buy_params': { | |
| 142 | - 'base-mp': 63, | |
| 143 | - 'base-rmi-fast': 52, | |
| 144 | - 'base-rmi-slow': 22, | |
| 145 | - 'inf-guard': 'lower', | |
| 146 | - 'inf-pct-adr-bot': 0.05986, | |
| 147 | - 'inf-pct-adr-top': 0.76319, | |
| 148 | - 'xbtc-base-rmi': 68, | |
| 149 | - 'xbtc-inf-rmi': 17, | |
| 150 | - 'xtra-base-fiat-rmi': 51, | |
| 151 | - 'xtra-base-stake-rmi': 32, | |
| 152 | - 'xtra-inf-stake-rmi': 16 | |
| 153 | - }, | |
| 154 | - 'dynamic_roi': { | |
| 155 | - 'enabled': True, | |
| 156 | - 'profit-factor': 204, | |
| 157 | - 'rmi-start': 14, | |
| 158 | - 'rmi-end': 75, | |
| 159 | - 'grow-delay': 85, | |
| 160 | - 'grow-time': 630, | |
| 161 | - 'fallback': 'roc', | |
| 162 | - 'min-roc-atr': 0.005 | |
| 163 | - }, | |
| 164 | - 'custom_stop': { | |
| 165 | - 'decay-time': 934, | |
| 166 | - 'decay-delay': 47, | |
| 167 | - 'decay-start': -0.22, | |
| 168 | - 'decay-end': -0.039, | |
| 169 | - 'cur-min-diff': 0.0336, | |
| 170 | - 'cur-threshold': -0.003, | |
| 171 | - 'roc-bail': -0.01, | |
| 172 | - 'rmi-trend': 57, | |
| 173 | - 'bail-how': 'immediate', | |
| 174 | - 'pos-trail': False, | |
| 175 | - 'pos-threshold': 0.005, | |
| 176 | - 'pos-trail-dist': 0.015 | |
| 177 | - } | |
| 178 | - }, | |
| 179 | - { | |
| 180 | - 'pairs': ('EWT/USD', 'ADA/USD', 'ATOM/USD', 'XTZ/USD', 'LINK/USD', 'XLM/USD', 'TRX/USD', 'DOT/USD', 'OMG/USD', 'ICX/USD', 'OCEAN/USD', 'COMP/USD', 'STORJ/USD', 'SNX/USD'), | |
| 181 | - 'buy_params': { | |
| 182 | - 'base-mp': 64, | |
| 183 | - 'base-rmi-fast': 48, | |
| 184 | - 'base-rmi-slow': 20, | |
| 185 | - 'inf-guard': 'upper', | |
| 186 | - 'inf-pct-adr-bot': 0.10287, | |
| 187 | - 'inf-pct-adr-top': 0.83482, | |
| 188 | - 'xbtc-base-rmi': 70, | |
| 189 | - 'xbtc-inf-rmi': 17, | |
| 190 | - 'xtra-base-fiat-rmi': 47, | |
| 191 | - 'xtra-base-stake-rmi': 18, | |
| 192 | - 'xtra-inf-stake-rmi': 17 | |
| 193 | - }, | |
| 194 | - 'dynamic_roi': { | |
| 195 | - 'enabled': True, | |
| 196 | - 'profit-factor': 272, | |
| 197 | - 'rmi-start': 44, | |
| 198 | - 'rmi-end': 84, | |
| 199 | - 'grow-delay': 116, | |
| 200 | - 'grow-time': 877, | |
| 201 | - 'fallback': 'roc', | |
| 202 | - 'min-roc-atr': 0.005 | |
| 203 | - }, | |
| 204 | - 'custom_stop': { | |
| 205 | - 'decay-time': 1081, | |
| 206 | - 'decay-delay': 27, | |
| 207 | - 'decay-start': -0.26, | |
| 208 | - 'decay-end': -0.035, | |
| 209 | - 'cur-min-diff': 0.016, | |
| 210 | - 'cur-threshold': -0.0358, | |
| 211 | - 'roc-bail': -0.032, | |
| 212 | - 'rmi-trend': 52, | |
| 213 | - 'bail-how': 'atr', | |
| 214 | - 'pos-trail': False, | |
| 215 | - 'pos-threshold': 0.005, | |
| 216 | - 'pos-trail-dist': 0.015 | |
| 217 | - } | |
| 218 | - } | |
| 219 | - ] | |
| 87 | + custom_pair_params = [] | |
| 220 | 88 | |
| 221 | 89 | """ |
| 222 | 90 | BTC - |
| 223 | 91 | Global: |
| 224 | 92 | 15m / 4h |
| 225 | 93 | 20210301- / Sharpe / DROI / CSTP |
| 226 | - 594/1000: 1254 trades. 1023/1/230 Wins/Draws/Losses. Avg profit 0.43%. Median profit 1.00%. Total profit 0.00605866 BTC ( 537.60Σ%). Avg duration 168.1 min. Objective: -338.21036 | |
| 94 | + | |
| 227 | 95 | |
| 228 | 96 | Pairlists (Sorted/grouped by avg. profit in global backtests): |
| 229 | 97 | |
| @@ -291,7 +159,7 @@ | ||
| 291 | 159 | """ |
| 292 | 160 | ETH - |
| 293 | 161 | Global: |
| 294 | - 15m / 4h | |
| 162 | + 1h / 4h | |
| 295 | 163 | 20210301- / Sharpe / DROI / CSTP |
| 296 | 164 | |
| 297 | 165 | |
| @@ -301,10 +169,51 @@ | ||
| 301 | 169 | # Sub-strategy with parameters specific to ETH stake |
| 302 | 170 | class Solipsis_ETH(Solipsis): |
| 303 | 171 | |
| 304 | - timeframe = '15m' | |
| 172 | + timeframe = '1h' | |
| 305 | 173 | inf_timeframe = '4h' |
| 306 | 174 | |
| 175 | + # Global for not in custom_pair_params | |
| 176 | + buy_params = { | |
| 177 | + 'base-mp': 60, | |
| 178 | + 'base-rmi-fast': 47, | |
| 179 | + 'base-rmi-slow': 20, | |
| 180 | + 'inf-guard': 'upper', | |
| 181 | + 'inf-pct-adr-bot': 0.17062, | |
| 182 | + 'inf-pct-adr-top': 0.7037, | |
| 183 | + 'xbtc-base-rmi': 27, | |
| 184 | + 'xbtc-inf-rmi': 69, | |
| 185 | + 'xtra-base-fiat-rmi': 32, | |
| 186 | + 'xtra-base-stake-rmi': 43, | |
| 187 | + 'xtra-inf-stake-rmi': 61 | |
| 188 | + } | |
| 189 | + | |
| 190 | + # Global for not in custom_pair_params | |
| 191 | + dynamic_roi = { | |
| 192 | + 'enabled': True, | |
| 193 | + 'profit-factor': 448, | |
| 194 | + 'rmi-start': 6, | |
| 195 | + 'rmi-end': 60, | |
| 196 | + 'grow-delay': 20, | |
| 197 | + 'grow-time': 1158, | |
| 198 | + 'fallback': 'roc', | |
| 199 | + 'min-roc-atr': 0.0025 | |
| 200 | + } | |
| 307 | 201 | |
| 202 | + # Global for not in custom_pair_params | |
| 203 | + custom_stop = { | |
| 204 | + 'decay-time': 1159, | |
| 205 | + 'decay-delay': 183, | |
| 206 | + 'decay-start': -0.25, | |
| 207 | + 'decay-end': -0.0225, | |
| 208 | + 'cur-min-diff': 0.0317, | |
| 209 | + 'cur-threshold': -0.04, | |
| 210 | + 'roc-bail': -0.034, | |
| 211 | + 'rmi-trend': 50, | |
| 212 | + 'bail-how': 'atr', | |
| 213 | + 'pos-trail': True, | |
| 214 | + 'pos-threshold': 0.0225, | |
| 215 | + 'pos-trail-dist': 0.01 | |
| 216 | + } | |
| 308 | 217 | |
| 309 | 218 | stoploss = custom_stop['decay-start'] |
| 310 | 219 | use_custom_stoploss = True |
modified strategies/Solipsis_v3.py +6 −6
| @@ -529,17 +529,17 @@ | ||
| 529 | 529 | custom_stop = self.custom_stop |
| 530 | 530 | dynamic_roi = self.dynamic_roi |
| 531 | 531 | |
| 532 | - if self.custom_pair_params: | |
| 532 | + if self.custom_pair_params and pair != 'backtest': | |
| 533 | 533 | custom_params = next(item for item in self.custom_pair_params if pair in item['pairs']) |
| 534 | - if custom_params['buy_params']: | |
| 534 | + if 'buy_params' in custom_params: | |
| 535 | 535 | buy_params = custom_params['buy_params'] |
| 536 | - if custom_params['sell_params']: | |
| 536 | + if 'sell_params' in custom_params: | |
| 537 | 537 | sell_params = custom_params['sell_params'] |
| 538 | - if custom_params['minimal_roi']: | |
| 538 | + if 'minimal_roi' in custom_params: | |
| 539 | 539 | custom_stop = custom_params['minimal_roi'] |
| 540 | - if custom_params['custom_stop']: | |
| 540 | + if 'custom_stop' in custom_params: | |
| 541 | 541 | custom_stop = custom_params['custom_stop'] |
| 542 | - if custom_params['dynamic_roi']: | |
| 542 | + if 'dynamic_roi' in custom_params: | |
| 543 | 543 | dynamic_roi = custom_params['dynamic_roi'] |
| 544 | 544 | |
| 545 | 545 | if params == 'buy': |