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

Selling 75% at once #6

Open
pasakahaka opened this issue Feb 21, 2021 · 3 comments
Open

Selling 75% at once #6

pasakahaka opened this issue Feb 21, 2021 · 3 comments

Comments

@pasakahaka
Copy link

How can I change so it would do 1 off purchase 75% of my BTC instead of multiple smaller ones?

Thanks :)

@BinaryDevil
Copy link
Owner

function handlePrice() {
if (symbol) {
if (!price) return

if (price) {
  if (BUY_UPON_SYMBOL && !initialBought) {
    initialBought = true
    market_buy()
  }
}

change market_buy() to market_buy(0.75) would work

@pasakahaka
Copy link
Author

pasakahaka commented Feb 22, 2021

Thanks. I've updated that one to 100% = 1. Also I deleted multiple functions on selling smaller quantities and replaced it with this one:

function market_buy(percent) {
  if (percent === undefined || percent === null || isNaN(percent)) {
    percent = 1
  }
  if (balance[TRADE_IN]) {
    const available = balance[TRADE_IN].available

    const fullQuantity = (available / price) * percent

    binance.marketBuy(
      symbol,
      getCorrectQuantity(fullQuantity * 1),
      (error, response) => {
        if (error) {
          console.error(error.body ? error.body : error)
          console.log(chalk.red('BUY FAILED'))
          return
        }
        console.info(
          chalk.bgGreen(`Market Buy ${percent * 100 * 1}% SUCCESS`)
        )
        // Now you can limit sell with a stop loss, etc.
        if (price) {
          snapshot_buy_price = (' ' + price).slice(1)
        }
        setTimeout(getBalance, 1500)
      }
    )
  }
}

^^
| |
This doesn't work, however I added 0.75 to the original code and it does work, I just want it to make 1 transactions instead of 4.

@IceWinterBot506
Copy link

@pasakahaka check the modified bot I made here: https://github.com/Frost-Binance-Pump-Bot/The-Bot

I already fixes the bugs, buy market with 100% and added some few touches.
I also updated the description of the configs for less confusion

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

No branches or pull requests

3 participants