gekkowarez / gekkoga

Genetic Algorithm for solving optimization of trading strategies using Gekko
309 stars 106 forks source link

Calculation error of yearlyProfit #44

Open xerviami opened 6 years ago

xerviami commented 6 years ago

Hi,

It seems that gekkoga computes the yearlyProfit value with this formula: yearlyProfit=profit * year_duration / backtest_duration

This formula is not correct. I think the correct one is: yearlyProfit (in %)=(end_balance/start_balance) ^(year_duration / backtest_duration) -1 Duration can be in days, hours or minutes, as you prefer.

Xavier

stereohelix commented 6 years ago

Hi Xavier,

This calculation happens in gekko performance analyzer, before gekkoga gets a hold of it.

Many gekko users prefer a linear extrapolation. I suppose it could do both. I've been working on the performance analyzer and will try running this past people on gekko.

James