Skip to content
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: show next best grid amount #540

Merged
merged 4 commits into from
Nov 19, 2022
Merged

feat: show next best grid amount #540

merged 4 commits into from
Nov 19, 2022

Conversation

rando128
Copy link
Contributor

@rando128 rando128 commented Nov 19, 2022

Description

The feature suggests the amount of money you would need to invest in a coin (as a new grid item or a manual trade) to expect closing the grid at break-event (i.e. without losing money) if the coin price eventually reaches your current sell percentage trigger.

The amount appears only for coins with active grid trades that have one selling grid.

The calculation is based on the following formula:

next best grid quantity = - qi * (1+(p - pi) / (gain * p)),

where gain = (triggerSellPercentage - 1)
and:

Current grid state Suggested best trade
Quantity bought (qi) Quantity to determine (q)
Last price (pi) Current price (p)
Spent amount (ai) Amount to spend (a)

Motivation and Context

When a coin goes deeper than expected for too long, I often find myself doing a lot of calculations to figure out the best next grid I would need to add to reactivate trading without losing money.

For new comers, it can be difficult to understand how to setup buy-grid-trades and this feature gives some better insight for grid management

How Has This Been Tested?

It's been running on my server.

Screenshots (if appropriate):

Screenshot 2022-11-19 at 11 32 59

@chrisleekr chrisleekr added the enhancement New feature or request label Nov 19, 2022
@chrisleekr chrisleekr self-requested a review November 19, 2022 12:09
key={'coin-wrapper-buy-next-grid-row-' + symbol}>
<div className='coin-info-column coin-info-column-price'>
<span className='coin-info-label'>
&#62; Next grid amount:
Copy link
Owner

Choose a reason for hiding this comment

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

So this is a suggested grid amount, not the amount the bot will execute it.
Can we rename the label to Suggested next grid amount?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure @chrisleekr. I have edited the PR description to clarify this is only a suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrisleekr, after more thought, I propose to rename 'Suggested break-even amount', which is really about closing the grid without losing money if the market moves up only the sell.triggerPercentage.

@rando128 rando128 removed their assignment Nov 19, 2022
@chrisleekr chrisleekr merged commit be43632 into chrisleekr:master Nov 19, 2022
@chrisleekr
Copy link
Owner

@rando128 merged!!!

@rando128
Copy link
Contributor Author

Thx @chrisleekr! Hope it will help better adapt our grids to the market changes.

@peweb
Copy link

peweb commented Nov 24, 2022

@chrisleekr when could you release this? The last one 0.93 is from Oct. 7

@chrisleekr
Copy link
Owner

@peweb Sorry, I will release now.

@peweb
Copy link

peweb commented Nov 30, 2022

@rando128 this is quite usefull feature but can we make it even better?

It is currently sugegsting the amount to buy at the current price. What if it could offer a purchase amount at a certain percentage difference from the current price?

When I analize the market I set up the next grid to be executed at say -3.5% from the last buy price. I want to profit of say 0.3% so... how to calculate the amount to buy?

@rando128
Copy link
Contributor Author

rando128 commented Nov 30, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants