Closed jbax closed 4 years ago
Done:
Binance.Simulator simulator = Binance.simulator();
Simulation simulation = simulator.configure().simulation();
simulation.emulateSlippage();
Or roll your own:
simulation.orderFillEmulator(new OrderFillEmulator() {
@Override
public void fillOrder(DefaultOrder order, Candle candle) {
// have fun
}
});
If using a configuration file, add property:
simulation.order.fill=slippage
Accepted values are: immediateFill
, priceMatch
and slippage
. Or the class name of your custom OrderFillEmulator
implementation. (case insensitive)
Right now any buy/sell on a simulation simply considers the closing price of the candle. It's not realistic enough and each order should be "filled" based on the candlesticks that come up AFTER the order is placed. That should use volume, high/low and close prices of every tick until the order fills or expires).