Username: Password:

Author Topic: Gunbot Sold at a Loss for no obvious reason  (Read 10549 times)

Offline rareshb

  • Rookie
  • *
  • Posts: 1
    • View Profile
Gunbot Sold at a Loss for no obvious reason
« on: February 14, 2018, 10:00:33 AM »
Gunbot sold at a loss and I can't figure out why. Please help.
I Attached the log.
Screenshots:





my strategy (from GUI)

NAME emotionless
TRADING_LIMIT 0.002
FUNDS_RESERVE 0.2
PERIOD 15
BUY_LEVEL 0.6
GAIN 1.6
EMA1 16
EMA2 8
HIGH_BB 49
LOW_BB 49
STDV 2
SMAPERIOD 50
RSI_BUY_ENABLED TRUE
RSI_SELL_ENABLED FALSE
RSI_BUY_LEVEL 20
RSI_SELL_LEVEL 70
PANIC_SELL FALSE
DOUBLE_UP TRUE
DU_METHOD HIGHBB
DOUBLE_UP_CAP 1
DU_CAP_COUNT 8
DU_BUYDOWN 2.5
RSI_DU_BUY 30
STOP_LIMIT 99
BUY_ENABLED TRUE
SELL_ENABLED TRUE
TA_ALWAYS_ON FALSE
MIN_VOLUME_TO_BUY 0.0001
MIN_VOLUME_TO_SELL 0.0001
TRADES_TIMEOUT 600
MICROTRADES TRUE

Offline PookztA

  • Rookie
  • *
  • Posts: 26
    • View Profile
Re: Gunbot Sold at a Loss for no obvious reason
« Reply #1 on: February 15, 2018, 11:48:25 PM »
This happened to me recently as well. I think I figured out why it's doing it. GunBot will sometimes inappropriately average together two buy prices, then sell based on that falsely low buy price, even though the old buy was closed with a sale. The bot thinks it's selling at a profit, but it's actually at a loss since it's using a falsely low, averaged buy price, instead of the correct buy price. At first I thought this was from a glitch in Double Up / Average Down, so I disabled that, but it just happened again, so clearly it's not that. I think it's an error in how the bot determines closed sales and thus when it should average together two buy prices instead of just using the most recent one. Please see the attached screenshots.

Notice that the most recent sale was 100% of the coins from the most recent buy, so a totally closed sale, but it was sold at a loss despite stop limit not being hit. Also notice that in the previous closed trade (buy and sell), there were 24 CND coins left over, which equates to 0.1% of the transaction. Thus, perhaps only 0.05% of that 0.1% was used for the transaction fee (I use Binance with BNB for fees, so the transaction fee is 0.05%), and the remaining 0.05% was carried over to the most recent trade. Thus, the most recent trade attempted to average the buy prices, even though the sale was really made of 95-99% the most recent buy price, and only 1-5% the previous buy price. But by weighting the two buys equally and averaging the two buys, it resulted in a negative trade for 1%. Definitely a bot calculation error, and not Double Up's / Average Down's fault.