binance-trading-bot
binance-trading-bot copied to clipboard
feat(configuration): execute stop-loss before buy
Version
0.0.78
Description
I set my stop loss to 0.95, and the bot would normally sell when price drops to 5%. I'm not sure if it's the bug in this version, because stop loss works well on the previous versions.
Screenshots
The % of difference to stop loss is also showing negative value but not triggering. Now I'm losing more than 20% of my portfolio haha.
Hm.
So in this case, what happened is, buy action got the priority of the stop-loss action. When the bot determines the action to do, it checks whether it should buy or not. And if not, it checks whether to stop-loss or not.
In your case, the grid trade 2 trigger price is higher than the stop-loss trigger price, so the bot is trying to buy, no stop-loss. But buy action couldn't be executed due to not enough USDT.
It's correct (expected) behaviour because buy action is determined and I don't want the bot to stop-loss without buying grid trade 2. But in your case, you may want to stop-loss first? Hm... I am not sure what is the best strategy.
Code reference:
- https://github.com/chrisleekr/binance-trading-bot/blob/master/app/cronjob/trailingTrade/step/determine-action.js#L307
- https://github.com/chrisleekr/binance-trading-bot/blob/master/app/cronjob/trailingTrade/step/determine-action.js#L371
Hm.
So in this case, what happened is, buy action got the priority of the stop-loss action. When the bot determines the action to do, it checks whether it should buy or not. And if not, it checks whether to stop-loss or not.
In your case, the grid trade 2 trigger price is higher than the stop-loss trigger price, so the bot is trying to buy, no stop-loss. But buy action couldn't be executed due to not enough USDT.
It's correct (expected) behaviour because buy action is determined and I don't want the bot to stop-loss without buying grid trade 2. But in your case, you may want to stop-loss first? Hm... I am not sure what is the best strategy.
Code reference:
- https://github.com/chrisleekr/binance-trading-bot/blob/master/app/cronjob/trailingTrade/step/determine-action.js#L307
- https://github.com/chrisleekr/binance-trading-bot/blob/master/app/cronjob/trailingTrade/step/determine-action.js#L371
Oh I see, I think the bot, in my case, should do the stop-loss as the first priority for safety, and cancel grid buy if not have enough money.
My other question is my "Add new grid trade" for sell button is greyed out, how can I configure grid sell?
Thanks.
Oh I see, I think the bot, in my case, should do the stop-loss as the first priority for safety, and cancel grid buy if not have enough money.
Hmm, that is depending on your strategy. But at his point, it does not have the configuration for it.
I will add it to TODO to be able to configure it in the future.
My other question is my "Add new grid trade" for sell button is greyed out, how can I configure grid sell?
That is because you sell 100% of your coin in the grid trade 1. Reduce sell quantity percentage, then you will see "Add new gird trade" available.