Note: this is the technical bug tracker, please use other platforms for getting support and starting a (non technical) discussion. See the getting help page for details.
I'm submitting a ...
[ ] bug report
[ ] question about the decisions made in the repository
Action taken (what you did)
Expected result (what you hoped would happen)
Actual result (unexpected outcome)
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)
Hi !
Like askmike says in an other topic,
Gekko had to make a choice between a very accurate simulation which requires a lot of very hard to get data (orderbook data) or require little data for a default simulation which works pretty reliable for bigger markets but requires tweaking (to spread and slippage) for smaller ones like the one you tested.
But, I'm a novice and I need help to parameters my strategy. I use the market Binance BNB - OST with the strategy entitled neuralnet.
In simulation, I see that I can multiply by 5000% my earnings. However like askmike says, the market is very volatile and I need your help to parameters my strategy because in trade bot,the robot does very few trades most of the time losing.
Moreover, I did not understand this notion of "spread and slippage".
Thanks
I'll be writing a forum post explaining exactly what this means. But it comes down to:
Binance says that right now the price of OST (in BNB) is currently 0.004333.
Unfortunately this does not mean that you/Gekko/anyone can currently buy and sell for that price. Buying and selling happens by being matched with someone else: I either need to accept someone's current offer (to buy from or sell to), or I need to create a new offer. Here is a screenshot of the orderbook:

Imagine you/Gekko want to buy right now, there are 2 ways of doing this:
0.004368).0.004326 if you are lucky someone will come along to sell to you for your price.Note that though this concept is the same for all markets, the differences is huge. In the biggest crypto market (bitmex USD/BTC swap) the difference between buy and sell price is almost always $0.50, which when btc is $8000 is only a tiny % (see below).
Spread
The spread is the difference between the price of the current best buyer and best seller. And when Gekko is simulating trades half of the time it's simulating buys and half of the time sells. But unfortunately it does NOT have these prices since Gekko has no way of getting them for any point in the past.
So the simulator does not take spread into account, instead users should do some research on the market they simulate over, figure out average spread and configure this is the paper trader, so it will calculate using an "average spread" that is reflective for your market.
Slippage
(This is only the simplest form of slippage, there are can be more) Imagine you are trying to buy 20,000 OST right now. As you can see (in the pic) the best seller is only offering to sell 9,566 OST. So after you buy all of those you still need more than 10,000 which you can buy from the new best seller at 0.004369 etc. etc. In the end you'll buy from 7 different sellers at different prices. Your "average buy price" is not 0.004368 but higher. Slippage is also something present in all markets, but in the case of that bitmex swap it's not unusual to see over a $1 million dollars in the the highest buy and lowest sell price. See bottom.
Same as the spread, Gekko does not have this data for any point in time since Binance does not provide it (they only provide it in realtime). So you need to this research again if you want highly accurate results.
*Sample orderbook from bitmex USD/BTC swap:

Size is in dollars meaning you can sell $1.5 million dollars worth of bitcoin for the best price. While you can "only" buy $270,000 dollars without having to buy at a worse price. So as you can see how different these numbers are depends on:
I've cleaned up the docs a bit to hopefully make the simulation more clear: https://gekko.wizb.it/docs/features/backtesting.html#Simplified-simulation
As to spread and slippage, I've linked to my explanation above. As such I am now closing this :)
Most helpful comment
I'll be writing a forum post explaining exactly what this means. But it comes down to:
Binance says that right now the price of OST (in BNB) is currently
0.004333.Unfortunately this does not mean that you/Gekko/anyone can currently buy and sell for that price. Buying and selling happens by being matched with someone else: I either need to accept someone's current offer (to buy from or sell to), or I need to create a new offer. Here is a screenshot of the orderbook:
Imagine you/Gekko want to buy right now, there are 2 ways of doing this:
0.004368).0.004326if you are lucky someone will come along to sell to you for your price.Note that though this concept is the same for all markets, the differences is huge. In the biggest crypto market (bitmex USD/BTC swap) the difference between buy and sell price is almost always $0.50, which when btc is $8000 is only a tiny % (see below).
Spread
The spread is the difference between the price of the current best buyer and best seller. And when Gekko is simulating trades half of the time it's simulating buys and half of the time sells. But unfortunately it does NOT have these prices since Gekko has no way of getting them for any point in the past.
So the simulator does not take spread into account, instead users should do some research on the market they simulate over, figure out average spread and configure this is the paper trader, so it will calculate using an "average spread" that is reflective for your market.
Slippage
(This is only the simplest form of slippage, there are can be more) Imagine you are trying to buy 20,000 OST right now. As you can see (in the pic) the best seller is only offering to sell 9,566 OST. So after you buy all of those you still need more than 10,000 which you can buy from the new best seller at
0.004369etc. etc. In the end you'll buy from 7 different sellers at different prices. Your "average buy price" is not0.004368but higher. Slippage is also something present in all markets, but in the case of that bitmex swap it's not unusual to see over a $1 million dollars in the the highest buy and lowest sell price. See bottom.Same as the spread, Gekko does not have this data for any point in time since Binance does not provide it (they only provide it in realtime). So you need to this research again if you want highly accurate results.
*Sample orderbook from bitmex USD/BTC swap:
Size is in dollars meaning you can sell $1.5 million dollars worth of bitcoin for the best price. While you can "only" buy $270,000 dollars without having to buy at a worse price. So as you can see how different these numbers are depends on: