Post
Topic
Board Trading Discussion
Re: Gekko - a javascript trading bot for nodejs
by
whydifficult
on 27/01/2014, 16:20:17 UTC
I'm not sure, but does Gekko simulation take transaction fees into account? That might be the reason for your discrepancy. I also find it surprising you trade succesfully at cex. I thought that market only had one direction... down...

Yes, Gekko also takes fees into account. Though CEX.io doesn't have any trading fees. The different either comes from a calculation bug (I'm skeptical about this) or fees + slippage.

Currently the simulator assumes it's able to buy/sell at current market price (which is last trade price, does not look at the book) - fees - slippage. If the spread is large and the trade was on the other side of the book this is far removed from reality if slippage is not set accordingly (don't trust the defaults as this is way to market specific). The reason it doesn't look at the book now is because the system is agnostic to any live market: if you feed it a stream of trades it is able to simulate new trades according to the configured trading method. Eg. this also works for backtesting as is. I want to move to a system where we also save a historical ticker data.

Note that only having ticker data does not prevent not being accurately able to calculate slippage, just the part up to the spread (difference between last price and best ask in case of long), but if you are a whale slippage will eat in your profits hard after the top ask (which is the only information the ticker provides).