binance-trading-bot
binance-trading-bot copied to clipboard
Maximum purchase amount set to %
Hi,
I have a feature request special for the "maximum purchase amount" that you can set. It will be nice to set a % value of the balance in place of a fixed amount.
With this option you gan use the profit with the next trade (for example when you set it to 100% of the balance).
+1 here... Would be a nice addition, specially once #52 gets implemented.
Hey @Dutchblue020
Thanks for your suggestion.
As I mentioned in issue #12, percentage buy calculation is tricky.
For instance, if you have a $100 USDT and I set 50%, then the first purchase would be $50 USDT. And for 2nd purchase, it would be $25 of left $50. So I just decided to go with a simple maximum purchase.
Good point Chris. You're absolutely right. Unless @Dutchblue020 has another suggestion on how to go about this, I think we can close it.
Do you agree @Dutchblue020 ?
@chrisleekr @chopeta
const percent = process.env.PERCENT_PER_TRADE
const use = openOrders == 0 ? (percent/100) * balance : balance / (100/percent - openOrders)
@fqueis Interesting point.
Although, your formula is just accounted for the case that you have open orders.
So for example,
Trade 1:
- Opening balance $100, Percentage 50%
- Purchased BTCUSDT $50, the order is executed, no open orders.
- Closing balance $50
Trade 2:
- Opening balance $50, Percentage 50%
- Purchased ETHUSDT $25, the order is executed
- Closing balance $25
As you can see above case, the buying amount is not consistent.
How can we overcome this inconsistency?
@chrisleekr yeah it keeps the open trades to split the entering amount by a certain percentage.
Btw your example is wrong. See:
Trade 1:
- Open trades: 0
- Balance: $100, percent: 50%
- Balance used in this trade: $50
Trade 2 (if the first one is not closed yet):
- Open trades: 1
- Balance: $50, percent: 50%
- Balance used in this trade: $50
Edit: Maybe the var name (openOrders) left you in doubt, I should have used openTrades
Oh, so you meant, we should track trade history for the coin?
Oh, so you meant, we should track trade history for the coin?
Not exactly.
From your documentation:
Buy signal: The bot will continuously monitor the lowest value for the period of the candles. Once the current price reaches the lowest price, then the bot will place a STOP-LOSS-LIMIT order to buy.
When this order get filled you'll have one openTrade
Sell signal: If there is enough balance for selling and the last buy price is recorded in the bot, then the bot will start monitoring the sell signal. Once the current price reaches the trigger price, then the bot will place a STOP-LOSS-LIMIT order to sell.
When this same coin get sold and the order is filled, the openTrade goes back to zero