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

⚡️ Freqtrade Protections / Market Crash Protection #40

Open
denvers opened this issue Jun 5, 2021 · 15 comments
Open

⚡️ Freqtrade Protections / Market Crash Protection #40

denvers opened this issue Jun 5, 2021 · 15 comments
Assignees
Labels
Bug - Fix Needed Something isn't working as expected Feature - Enhancement Update or improvement to existing feature Needs Testing This feature, improvement or bugfix still is in need of testing
Milestone

Comments

@denvers
Copy link
Contributor

denvers commented Jun 5, 2021

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

@Rikj000 Rikj000 added Feature - Enhancement Update or improvement to existing feature Bug - Fix Needed Something isn't working as expected labels Jun 5, 2021
@Rikj000
Copy link
Owner

Rikj000 commented Jun 5, 2021

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 🙂 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
Copy link
Owner

Rikj000 commented Jun 5, 2021

Added Protection example to the development branch, however I tested this and I think we can still do better 9acd555

@Rikj000 Rikj000 changed the title When the market crashes the unclogger will keep unclogging profits away Freqtrade Protections / Market Crash Protection Jun 5, 2021
@Rikj000 Rikj000 added Feature - New New feature or pull request and removed Feature - Enhancement Update or improvement to existing feature labels Jun 5, 2021
@Rikj000 Rikj000 self-assigned this Jun 5, 2021
@Rikj000
Copy link
Owner

Rikj000 commented Jun 5, 2021

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 Rikj000 added the In Progress This is being worked on label Jun 5, 2021
@Rikj000
Copy link
Owner

Rikj000 commented Jun 6, 2021

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 Rikj000 added this to the v0.12.0 milestone Jun 6, 2021
@Rikj000 Rikj000 added Planned Planned feature, improvement or bugfix (not being worked on yet) and removed In Progress This is being worked on labels Jun 12, 2021
@Rikj000 Rikj000 assigned Rikj000 and unassigned Rikj000 Jun 12, 2021
@Rikj000 Rikj000 added In Progress This is being worked on and removed Planned Planned feature, improvement or bugfix (not being worked on yet) labels Jun 14, 2021
@Rikj000
Copy link
Owner

Rikj000 commented Jun 14, 2021

@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 🙏

@v-anton
Copy link

v-anton commented Jun 14, 2021

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

@Rikj000
Copy link
Owner

Rikj000 commented Jun 15, 2021

@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

@v-anton
Copy link

v-anton commented Jun 15, 2021

@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.

@Rikj000
Copy link
Owner

Rikj000 commented Jun 15, 2021

`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.

@v-anton
Copy link

v-anton commented Jun 15, 2021

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

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

@nuaimat
Copy link
Contributor

nuaimat commented Jun 15, 2021

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

@Rikj000
Copy link
Owner

Rikj000 commented Jun 15, 2021

@nuaimat and @v-anton if #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:

After this issue (#40) is closed I'll update back to the latest Official Freqtrade development, then I will look at issue #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!

@v-anton
Copy link

v-anton commented Jun 15, 2021

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 :(

@Rikj000
Copy link
Owner

Rikj000 commented Jun 15, 2021

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 #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 Rikj000 added the Planned Planned feature, improvement or bugfix (not being worked on yet) label Jun 16, 2021
@Rikj000 Rikj000 removed this from the v0.12.0 milestone Jun 16, 2021
@Rikj000 Rikj000 removed their assignment Jun 22, 2021
@Rikj000 Rikj000 added Feature - Enhancement Update or improvement to existing feature and removed Feature - New New feature or pull request labels Sep 5, 2021
@Rikj000 Rikj000 changed the title Freqtrade Protections / Market Crash Protection ⚡️ Freqtrade Protections / Market Crash Protection Sep 5, 2021
@Rikj000 Rikj000 self-assigned this Jan 2, 2022
@Rikj000 Rikj000 added In Progress This is being worked on and removed Planned Planned feature, improvement or bugfix (not being worked on yet) labels Jan 2, 2022
@Rikj000 Rikj000 added this to the v0.13.0 milestone Jan 2, 2022
@Rikj000
Copy link
Owner

Rikj000 commented Jan 2, 2022

Linking to issue: #221

@Rikj000 Rikj000 added Needs Testing This feature, improvement or bugfix still is in need of testing and removed In Progress This is being worked on labels Jan 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug - Fix Needed Something isn't working as expected Feature - Enhancement Update or improvement to existing feature Needs Testing This feature, improvement or bugfix still is in need of testing
Projects
None yet
Development

No branches or pull requests

4 participants