-
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: next buy grid calculator #554
feat: next buy grid calculator #554
Conversation
@chrisleekr can you please push this release? I am wating for this for a long time. Thanks! |
@peweb Sorry, I've been busy recently. I just reviewed it. :) @rando128 Thank you for your contribution. First of all, are you using VS code? It seems auto linting is not applied when you save the file. Secondly, I've fixed the missing production build code change - af3b87f Lastly, I may not understand completely or misunderstand. But the following scenario (this is a test server), is "Suggested breakeven amount" correct? And it's showing a negative purchase amount. Is this correct too? |
Thx @chrisleekr for the review. Sorry to have missed the production change (I'm running docker-compose in build mode on my production server...). Also I'll try not mess up with lint in my next submission (I'm using PyCharm). With regards to your scenario, something is definitely wrong. I suspect this is due to your grid having a manual trade (which is indicated I believe by the grey clock icon of grid #1). My calculations don't take into this case. I'll look into how to handle it. |
All good @rando128 :) To replicate the attached scenario:
And I also executed the manual trade with the suggested amount. |
… hits the current sell trigger price
@chrisleekr, I have updated the logic to account for pointless grid scenarios (where the user expects a rebound that hits the profitable sell price target). I'll try and replicate your scenario to double-check the calculations. |
@chrisleekr, it turns out that we can't make recommendations of the next grid if we don't know all the historical price and quantity information. So I have hidden the breakeven section when a buy grid includes manual trades. So we should now be good with my latest commit. |
@rando128 Thanks for your changes. Yap, looks good. Although I wish you could have handled the manual trade as well. I do understand the manual trade is not returning from the latest data. Anyway, let me merge in first. 🎉 Ah, one more thing. I saw your commit message is not following the conventions I forced to follow. How did you bypass naming convention rules? 🤣 |
@chrisleekr, I could easily support manual trades if the With regards to not respecting conventions, my PyCharm setup is definitely broken. I will move to VSC to respect the development rules 😁 |
Hello @rando128 I am trying to figure it out right now. However, I have this:
I think something is wrong with the buy price 0.503 or that's correct? |
Sorry @rando128 |
@habibalkhabbaz, I know it can be confusing at first. I originally designed the feature with absolute prices and true percentages, but I eventually decided to stick to the grid configuration principles (with multipliers) to educate users on the bot settings principles. |
@rando128 Why it advices to buy higer amount if I increase the buy trigger percentage difference from last buy price? I have |
@peweb, increasing the buy trigger percentage (from -18,73% to -28,70% in your example), means buying at a lower price. Because the last buy price is the Another way to intuitively see it with the calculator graph:
|
@rando128 Would it be possible to add the calculated prices in USDT as well? On the screenshot it says buy trigger precentage on last buy price 0.85 resulting in difference from current price in %, could you please add the USDT amount as well? You can enhance the summary by adding USDT in three places, I think. On Results - executong new grid at -15% / {USDT} from your current last buy price {USDT} with a purchase amount of 490.11 USDT , would allow you to break even if the market price rebounds 10.00% {USDT} I hope this will make our calculations easier and more efficient. Thing is, working with % is tricky (for me). When I see the chart, I might want to make a new buy at 0.35 and hope to profit at 0.39. What amount should I buy at 0.35 and what % should I enter in the pair configuration? This is how I see this improvement working for me, what about you? |
@peweb, the current UX is indeed based on % to be aligned with the symbol grid settings paradigms, but I understand your point. I guess you noticed that the USDT price is indicated for the rebound percentage (e.g. 'Equivalent market price') so you can play with the % until it matches your target price. I can easily extend this to the buy trigger: Would that cover your needs? That said, keep in mind that the trigger prices are just triggers for placing stop orders and won't never correspond to the actual price the bot will buy or sell. |
@rando128 yes that would be great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bot
Description
This PR provides an enhancement to the next-buy-grid-amount feature introduced in #540 with a new grid calculator.
The calculator allows to determine the amount you would need to purchase at a specific buy trigger point and achieve break-even if the market price rebounds to a targeted percentage.
The calculator is available from buy grid section and replaces #540 popup.
Related Issue
The enhancement was suggested by @peweb in #540 (comment)
How Has This Been Tested?
This is working on my production server.
Screenshots (if appropriate):