MoniGoMani icon indicating copy to clipboard operation
MoniGoMani copied to clipboard

⚡️ Freqtrade Protections / Market Crash Protection

Open denvers opened this issue 3 years ago • 15 comments

When the market crashes the unclogger will keep unclogging profits away. Freqtrade protections should help to prevent this.

denvers avatar Jun 05 '21 08:06 denvers

Better crash prevention is still needed, but might also be reachable with better configured Freqtrade protections https://www.freqtrade.io/en/latest/plugins/#protections Please report back if you can find a good protection configuration for MGM :slightly_smiling_face: But be sure to use minutes and not candles so it won't interfere with TimeFrame-Zoom And you'll need to append the --enable-protections flag to your BackTest/HyperOpt commands It will add some time to the duration of the tests though, but I think this is truly needed to help us keep our profits during market crashes

Rikj000 avatar Jun 05 '21 11:06 Rikj000

Added Protection example to the development branch, however I tested this and I think we can still do better https://github.com/Rikj000/MoniGoMani/commit/9acd555c5971d2b6c9d76fcfcf0dd1188d9a1b79

Rikj000 avatar Jun 05 '21 12:06 Rikj000

I haven't found a configuration that I'm happy with yet and testing these takes quite some time.
Please explore these too so we can hopefully find a good setup more quickly!

Rikj000 avatar Jun 05 '21 21:06 Rikj000

Since the Drawdown and Cooldown protections activate after X lost trades (sell signals) we should be weary of using these together with the unclogger.
The unclogger has an intended side effect of creating sells at a small loss to hunt for more profitable trades again more quickly.

We could try to:

  • Loosen these protections up so they will only trigger in real bad scenarios
  • See what results we can reach without these

Rikj000 avatar Jun 06 '21 09:06 Rikj000

@3ylo though that protections and the unclogger might be interfering with each other.
Due to this reason I'm currently testing with only a couple of StoplossGuard protections.

Finding good protections already has taken up quite some time, please if you have time, help out in the search for a couple of good ones for MGM :pray:

Rikj000 avatar Jun 14 '21 19:06 Rikj000

@Rikj000 Please let me know if you need any help there. I could run some HO as well :)

v-anton avatar Jun 14 '21 21:06 v-anton

@Rikj000 Please let me know if you need any help there. I could run some HO as well :)

Yes that would be truly welcome! So the goal is to look for a couple of good Freqtrade Proctections to go along with MGM.
It's not hard either to look for some, just takes a lot of CPU crunching (which takes time):

  • Switch to the latest MGM development
  • Do a vanilla 1000 epoch 1st Run HyperOpt without Protections, so we can compare later on if there where improvements, take note of the Random State being used
  • Read the Freqtrade Proctections documentation and then configure a couple in your mgm-config.json
  • Fire up a new 1000 epoch 1st Run HyperOpt with Protections this time and the same random state as used in our vanilla test (To do this append following to your HyperOpt/BackTest commands: --enable-protections --random-state <from previous test>)

Wait and see if improvement happened, then report back here. We'd like to get our drawdown more tight and our losses less overall without cutting down our overall profit (too much).

FYI: 1st HyperOpt Runs are simply without any mgm-config-hyperopt.json present on your device

Rikj000 avatar Jun 15 '21 07:06 Rikj000

@Rikj000 Trying to HO, but for now I have such error: 2021-06-15 11:02:35,710 - freqtrade.resolvers.iresolver - WARNING - Could not import /Users/antonvozghrin/Developer/MoniGoMani/user_data/strategies/MoniGoManiHyperStrategy.py due to 'No module named 'user_data.strategies.MasterMoniGoManiHyperStrategy'' 2021-06-15 11:02:35,710 - freqtrade - ERROR - Impossible to load Strategy 'MoniGoManiHyperStrategy'. This class does not exist or contains Python code errors.

v-anton avatar Jun 15 '21 08:06 v-anton

`2021-06-15 11:02:35,710 - freqtrade.resolvers.iresolver - WARNING - Could not import /Users/antonvozghrin/Developer/MoniGoMani/user_data/strategies/MoniGoManiHyperStrategy.py due to 'No module named 'user_data.strategies.MasterMoniGoManiHyperStrategy''

Are you sure you updated to the latest MGM development? Seems your MasterMoniGoManiHyperStrategy file is missing.

Rikj000 avatar Jun 15 '21 08:06 Rikj000

Снимок экрана 2021-06-15 в 11 16 03

Nope, it exists. Rly now sure what's the reason:( Will proceed later a bit

v-anton avatar Jun 15 '21 08:06 v-anton

i just had the same error few minutes ago, it's related to this issue https://github.com/Rikj000/MoniGoMani/issues/59 the fix for me was: in MasterMoniGoManiHyperStrategy line 21 change: from freqtrade.state import RunMode to from freqtrade.enums import RunMode

nuaimat avatar Jun 15 '21 08:06 nuaimat

@nuaimat and @v-anton if https://github.com/Rikj000/MoniGoMani/issues/59 is the issue you guys are struggling with, then I'm guessing you guys are not on the correct Freqtrade fork + branch + commit anymore? Currently MGM still requires:

  • My fork: https://github.com/Rikj000/Freqtrade
  • My branch on which I made the PR: https://github.com/Rikj000/freqtrade/tree/Rikj000/Freqtrade/moni-go-mani/v0.11.0
  • My unmerged PR: https://github.com/Rikj000/Freqtrade/commit/bd44deea0dbfbcf3a651d1533f04b019ec5291f5

After this issue (https://github.com/Rikj000/MoniGoMani/issues/40) is closed I'll update back to the latest Official Freqtrade development, then I will look at issue https://github.com/Rikj000/MoniGoMani/issues/59 and for other breakage/bugs that might have happened with updating. This will be the very last thing done before officially releasing MGM v0.12.0, so please keep using my Freqtrade fork until v0.12.0 has been officially released!

Rikj000 avatar Jun 15 '21 08:06 Rikj000

i just had the same error few minutes ago, it's related to this issue #59 the fix for me was: in MasterMoniGoManiHyperStrategy line 21 change: from freqtrade.state import RunMode to from freqtrade.enums import RunMode

Didn't help :(

v-anton avatar Jun 15 '21 11:06 v-anton

i just had the same error few minutes ago, it's related to this issue #59 the fix for me was: in MasterMoniGoManiHyperStrategy line 21 change: from freqtrade.state import RunMode to from freqtrade.enums import RunMode

Didn't help :(

Then please post your new error at issue https://github.com/Rikj000/MoniGoMani/issues/59 and then stick to the version I just mentioned in my previous message until I will work on updating to the latest Official Freqtrade

Rikj000 avatar Jun 15 '21 11:06 Rikj000

Linking to issue: https://github.com/Rikj000/MoniGoMani/issues/221

Rikj000 avatar Jan 02 '22 19:01 Rikj000