askmike / gekko

A bitcoin trading bot written in node - https://gekko.wizb.it/
MIT License
10.08k stars 3.93k forks source link

[backtesting] Discrepancy between candle price and sell price #2858

Closed olivierpascal closed 5 years ago

olivierpascal commented 5 years ago

Not sure if this is actually a bug. Why is there a significant difference between the candle close price and the actual selling price?

I'm submitting a ... [X] bug report [ ] question about the decisions made in the repository

Action taken (what you did)

console.log('this.candle =', this.candle);
this.advice('short');

Expected result (what you hoped would happen)

this.candle = {
  ...
  close: X,
  ...
}
(INFO): Paper trader simulated a SELL   X EUR <= 0.00000000 XBT

Actual result (unexpected outcome)

this.candle = { start: moment("2019-09-03T20:00:00.000"),
  open: 9763.4,
  high: 9788.9,
  low: 9414.2,
  close: 9690.8,
  vwp: 9690.935751484609,
  volume: 1435.886685319999,
  trades: 8177 }
(INFO): Paper trader simulated a SELL   9031.26660078 EUR <= 0.00000000 XBT