askmike / gekko

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

Backtest: 0 trades but Simulated Profit lower than Market profit #883

Closed rasmuswinchester closed 7 years ago

rasmuswinchester commented 7 years ago

Hi,

While playing around with the backtesting, I encoutered the following:

Did a backtrade, which resulted in 0 trades made. However, the simulated profit was 37.09981% while the market ended at 40.04805%.

Is this possible? Does Gekko assume there are fixed costs for the trading platform?

Thanks in advance.

trade strat backtest resukt

askmike commented 7 years ago

The paper trader has a simulated balance: if your simulated balance has at least some currency the total worth will be less than the market (buy and hold profit). Example

If you are trading USD/BTC and the price for 1 BTC is 1000 at the beginning and 2000 at the end:

Under simulationBalance you configured the paper trader to have 1 BTC and 100 USD. So value at the beginning is: 1000 + 100 = 1100 USD, and the value at the end is (assuming no trades) 2000 + 100 = 2100 USD. So even though the market went up 100% your balance did not since you had some USD.