-
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: Customise the last buy price removing threshold #206
feat: Customise the last buy price removing threshold #206
Conversation
@pedrohusky I think the main issue with the code was not using VSCode which gives you auto-formatting. Once you correct all comments, then needs to test whether that works or not. |
-Indenting -Renaming to lastBuyPriceRemoveThreshold -Fixing ${maxPurchaseAmount} where it shouldn't be -Setting -1 to lastBuyPriceRemoveThreshold default value. -Removing non-sense comments that I've made
@chrisleekr Of course. I'm working on them. Never wrote a test file. I'm using reverse engineering on yours. Sorry for the wait. |
I just tested manually, and I found you need to update one more file It has a function call |
Done. Will send the commit.
@chrisleekr
Why last price threshold would be useful here? Just to verify if the coin value is higher than the last price threshold? Coin actual value: 10$ Then we calculate if there is a last buy price, and see if is higher than minimum notional value (which can't be less than 10$ in usd). Then we verify if it is higher than the last buy threshold?
I'm a little confused. I still didn't made the test files. Sorry. I'm a little busy. |
- description, - last buy remove threshold now appears in symbol settings (frontend arrow), -Using destructing assignment, -removed .vscode from gitignore, sorry
…/binance-trading-bot into last-buy-under-amount
There is a scenario that
As you configured $20, you would expect the bot removes the last buy price because the balance is less than configured threshold. However, the bot will determine action as In that case,
It's ok. Thanks for your contribution. Take your time. :) |
Now last buy remove threshold appears in symbol 'configuration arrow' in frontend; Sorry for the wait.
Done! Sorry for the delay, had returned from my vacation yesterday. Can you tell me how can I setup apprise? (It is python) Already tried python-shell, but didn't had success (maybe I've done something wrong)... |
Dammit. VS couldn't commit or push, then when it done it, it pushed that all. lol I just changed one phrase. Sorry for that. Don't know why it did it. |
Welcome back :)
Oh, damn. Sorry, to be honest, I didn't check in detail. |
baseAssetBalance: { total: baseAssetTotalBalance }, | ||
sell: { currentPrice: sellCurrentPrice, lastBuyPrice } | ||
} = data; | ||
|
||
return ( | ||
lastBuyPrice > 0 && | ||
baseAssetTotalBalance * sellCurrentPrice > parseFloat(minNotional) | ||
baseAssetTotalBalance * sellCurrentPrice > parseFloat(minNotional) && |
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.
I have tested manually, this line does not work. You gotta remove the below line because the bot is now relying on the lastBuyPriceRemoveThreshold
baseAssetTotalBalance * sellCurrentPrice > parseFloat(minNotional) &&
You can see from the below screenshot, the bot didn't remove the price, it still determines the action as sell-wait
.
controlId={'field-min-last-buy-remove-threshold-limit-percentage-' + quoteAsset} | ||
className='mb-2'> | ||
<Form.Label className='mb-0'> | ||
Last Buy Price Remove Threshold for {quoteAsset}{' '} |
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.
As mentioned earlier, the global setting screen does not match with the symbol setting screen.
- The symbol setting screen has
Remove last buy price when under
but in the global setting screen hasLast Buy Price Remove Threshold for USDT
. I thinkRemove last buy price when under
is easier to understand. So let's go with it. - One more suggestion is let's display the field with the quote asset like the below screenshot. | 10 | USDT |
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.
I've already edited the description and name in my other fork that I would like to open a pull request soon. I think you will like it.
I'll make those changes here.
Sure! Can you send me the code to do this? Don't forget I'm newbie in js.
Don't need to send me anything.
I can use the manual trade code to do that. Thanks for the heads up!
@pedrohusky I just left some comments. I think almost there, but I will definitely need tests to make sure all working as expected. I really appreciate your effort and time in this PR. |
Chris, I need help setting up the tests. When. I run npm test I get something about "spawn error", don't know what to do. Btw: I've set up the multilanguage in frontend. But I need to write the tests from lastbuy to open a pull request. |
Hey @pedrohusky
Have you run Try
And some more note, if you open the project folder, you will see a new folder/file If you still need help, please let me know. :)
Sure, that is good. Thanks for all your contributions. 👍 |
Hey @pedrohusky Sorry for the delay. I have updated your repo including Setting UI and tests. Can you take a look and let me know whether you are happy with the changes? Thank you for your contributions. :) |
Hi @chrisleekr . All seems good to me. Thanks for it. I think we can merge. Btw, I'm gonna have a look on how I will split my changes. Right now I've covered this issues:Add sudden drop buy strategy - [#67 ] Support Grid strategy for buy/sell to mitigate loss/increasing profit - [#158 ] Add minimum required order amount - [#84] Somewhat the #106 too, but I can't find a way to implement Apprise. Right now it is just telegram and slack. Support cool time after hitting the lowest price before buy - [#105] <- My indicator covers it I think. Filter symbols in the frontend - [#120] Reset global configuration to initial configuration - [#97] Support multilingual frontend - [#56] Develop simple setup screen for secrets With the other changes that I did like theme and such. My readme is updated at my language-telegram-lastbuy branch. Right now I'm working in these:Backtest. Need help loading the .csv into an array. Add frontend option to disable sorting or improve sorting And this I think is my priority right now: Manage setting profiles (save/change/load?/export?) - [#151] All time profit or All trades executed (successfully executed trades or trades at loss). But this we can merge. |
As you asked, here is only the last buy function. I appreciate any critics.
You can set threshold amount in settings and in symbol settings. The bot will only remove the last price if it is below the threshold.