-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: conservative sell strategy #585
Merged
chrisleekr
merged 8 commits into
chrisleekr:master
from
rando128:feat/conservative-sell-strategy
Jan 14, 2023
Merged
feat: conservative sell strategy #585
chrisleekr
merged 8 commits into
chrisleekr:master
from
rando128:feat/conservative-sell-strategy
Jan 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rando128
changed the title
Feat/conservative sell strategy
feat:conservative sell strategy
Jan 12, 2023
This looks really good @rando128 I found no test written, do you need help writing tests? |
Thx @chrisleekr. Yes I would need your help with the test cases as I’m not skilled enough yet to write them. |
chrisleekr
changed the title
feat:conservative sell strategy
feat: conservative sell strategy
Jan 14, 2023
Makes total sense. Thx for the code improvement @chrisleekr. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR provides the ability to reduce the sell trigger price as the grid gets deeper (i.e. with more executed buys). This is useful in bear market conditions as the user might want to maximize the possibility to breakeven rather than to maximize the profit. When the feature is enabled, a configurable
conservative ratio
reduces the sell trigger price proportionally to the executed grid depth, the objectif being to be less greedy as the grid gets deeper.The conservative sell doesn't apply for grids with only one executed buy. In such cases, the bot will sell normally, at the expected sell trigger percentage.
Changes:
default.json
model:conservativeMode.enabled
,conservativeMode.factor
get-indicators.js
to compute the selltriggerPercentage
in case the conservative mode is active.Caveats:
triggerPercentage
that becomes lower than the sell stop price percentage. This could produce a sell with a slight loss.Motivation and Context
When a coin starts going down in a grid with multiple buy steps, I often find myself reconfiguring the sell trigger percentage to a lower value with the objective to increase the possibility to make a smaller positive sell, rather than the original higher sell target (which might take too long to achieve, or even might never occur).
The capability goes a bit in the line of #579: the conservative mode is a way to offer a dynamic sell trigger based on the grid depth.
How Has This Been Tested?
It has been running on my production server since a couple of days.
Screenshots (if appropriate):
Conservative mode disabled
Conservative mode enabled and active
Sell Settings
First information pop-up
Second information pop-up