DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.22k stars 2.04k forks source link

Bugs with sold price - bought price at gdax #1489

Open ttrd06 opened 6 years ago

ttrd06 commented 6 years ago

System information

Describe the problem

Good morning,

First this trouble occurs even with a fresh install since days ago and i was thinking about other problems. And i already used these commands if someone ask me:

Zenbot use taker fees if you want this info.

So the problem is zenbot sell or buy at wrong prices and display false infos on screen tought the screen api or in terminal display. I use different strategies like bollinger, trend_ema and others. Same bug with it. So i decided today to share it with you with screen captures and tell you if someone already seen this. This mean zenbot think it buy or sell at correct prices but in fact it does not. Stats and others usefull tools are wrong. Below are the screen captures to show evidences of this trouble: First 3 pictures are the screen api and the last the real gdax fills.

copy1

copy2

copy3

copy4

As you can see, price bought or sold by zenbot are not the same of gdax. This mean the balance of ETH or EUR displayed in zenbot is wrong.

If you trust the bot, the profit is nice but in fact it is small as the reals fills of gdax showed it. What's wrong in the code ? Of course, i only use small amount to test and retest zenbot and i trade gdax with eth-eur.

A big thank to reply !

Haehnchen commented 6 years ago

fixed via https://github.com/DeviaVir/zenbot/pull/1482. tested changes for weekend also discord chat response was positive

ttrd06 commented 6 years ago

thank's for replying but this fix #1482 is not for this one. there are no canceled orders here. as i said before, i use latest commits.

i don't know if you seen the fills but:

the prices used & displayed by zenbot are wrong. this mean the bot believe to buy & sell at good prices but in fact it does not. and this continue until i stop the bot this afternoon.

ttrd06 commented 6 years ago

good morning,

i tried few hours this morning with latest updates and that's the same: zenbot sold at a price of 577.3 and the real price at gdax is 567.91 ... and i loose money...

i use taker fees and zenbot thought the terminal command show 0% slipage wich is normal. so why there is this difference between these prices ?

actually i can't leave zenbot trade for me until this issue will be fixed. someone use gdax and eth/eur pair ?

a big thank for your help !

EDIT: since the awesome updates, i always use darwin to find the best strategy to use. below is the one i used yesterday and this morning:

./zenbot.sh trade gdax.ETH-EUR --avg_slippage_pct=0.045 --buy_stop_pct=18 --markdown_buy_pct=2.9980126556944264 --markup_sell_pct=3.190197170894888 --max_buy_loss_pct=25 --max_sell_loss_pct=25 --max_slippage_pct=5 --min_periods=21 --neutral_rate=auto --order_poll_time=5000 --order_type=taker --oversold_rsi=24 --oversold_rsi_periods=50 --period=43m --period_length=43m --profit_stop_enable_pct=1 --profit_stop_pct=16 --rsi_periods=50 --sell_stop_pct=0 --strategy=trend_ema --trend_ema=25

if it can help someone to find what's wrong ...? thank's again for your help

ttrd06 commented 6 years ago

Morning,

after days of trading and investigations i seen the problem. this is with zenbot himself. as i expected, the bot use a 30sec loop to show prices from exchange and test the strategy we choosed then send a signal to buy or sell. am i right ? but during this 30sec loop, the price can change at high or less because of volatility and this is why we have differences between the bot's price & the real price traded from exchange.

this mean you think you have profits tought infos displayed but in fact if you check at the exchange your balance is less than expected.

i manually trade every days and if you choose an extrem volatility market such ETH/BTC the price can move in seconds and i'm sure the bot will stucks with this volatility and will show false bought/sold prices.

Enhancement: @DeviaVir @Haehnchen :

Why this 30sec loop ?

Is there a way to change this duration loop to match realtime / almost from exchange (may be an option --loop=realtime, 3s, 5s, ...) ?

during a trade of the bot , do you think it's possible to retrieve the real price traded from exchange with its trade ID and check if the bot's trading price match the exchange's trade --> prices displayed tought screen api / terminal / others will be reals and checked.

thank's for reply !

EDIT: Someone may tell me where is the timeout of 30 sec in the code ? Thank's

ttrd06 commented 6 years ago

morning ! some news after days of trading and with the help from @maybeyes, a helpfull guy from discord. he point me to play with the c.poll_trades of conf.js so i used differents amount of time against volatility and all is ok now ! the sold & bought price are almost the time equals better than days ago.

@DeviaVir you can close this issue but: do you think it's possible to add an option in the command line to avoid these troubles like --volatility=high, medium, normal and set the c.poll_trades to 5s, 15s, 30s ? Or explain in the readme.md what occurs if someone use high volatility maket like ETH/BTC where prices move in seconds ?

mrseeker commented 6 years ago

I have seen this issue at GDAX with taker orders, so please do not close this issue:

zenbots reports buying at MKT with price X and slippage 0, but actual buying price is X + slippage due to high volatility in the market when buying...

See image for example

image