gekkowarez / gekkoga

Genetic Algorithm for solving optimization of trading strategies using Gekko
313 stars 104 forks source link

Score as mainObjective #51

Open 123qweas opened 6 years ago

123qweas commented 6 years ago

When I try to run the GA with Score as mainObjective I get a wierd output:

No previous run data, starting from scratch! Starting GA with epoch populations of 10, running 5 units at a time!

--------------------------------------------------------------

Epoch number: 1 Time it took (seconds): 19.318 Max score: 1 Max profit: 183.8186868776 EUR Max sharpe: 38.20463404372513 Max profit position: 1 Max parameters: { SMA_long: 1090, BULL_RSI: 5, BEAR_RSI: 24, SMA_short: 40, candleSize: 27, historySize: 1440, BULL_RSI_low: 55, BEAR_RSI_low: 21, BULL_RSI_high: 85, BEAR_RSI_high: 47 } Other metrics: { balance: 283.8186868776, profit: 183.8186868776, sharpe: 38.20463404372513, market: 191.22174455692692, relativeProfit: 183.8186868776, yearlyProfit: 309.40244473350873, relativeYearlyProfit: 309.40244473350873, startPrice: 0.28844, endPrice: 0.84, trades: 140 }

--------------------------------------------------------------

Global Maximums: Score: 1 Profit: 183.8186868776 EUR Sharpe: 38.20463404372513 parameters: { SMA_long: 1090, BULL_RSI: 5, BEAR_RSI: 24, SMA_short: 40, candleSize: 27, historySize: 1440, BULL_RSI_low: 55, BEAR_RSI_low: 21, BULL_RSI_high: 85, BEAR_RSI_high: 47 } Global maximum so far: { balance: 283.8186868776, profit: 183.8186868776, sharpe: 38.20463404372513, market: 191.22174455692692, relativeProfit: 183.8186868776, yearlyProfit: 309.40244473350873, relativeYearlyProfit: 309.40244473350873, startPrice: 0.28844, endPrice: 0.84, trades: 140 }

--------------------------------------------------------------

Epoch number: 2 Time it took (seconds): 25.181 Max score: 1 Max profit: 188.75188774256122 EUR Max sharpe: 41.33514192426096 Max profit position: 2 Max parameters: { SMA_long: 480, BULL_RSI: 5, BEAR_RSI: 11, SMA_short: 150, candleSize: 15, historySize: 1440, BULL_RSI_low: 51, BEAR_RSI_low: 17, BULL_RSI_high: 89, BEAR_RSI_high: 43 } Other metrics: { balance: 288.7518877425612, profit: 188.75188774256122, sharpe: 41.33514192426096, market: 208.05020108168077, relativeProfit: 188.75188774256122, yearlyProfit: 317.72733031425787, relativeYearlyProfit: 317.72733031425787, startPrice: 0.28844, endPrice: 0.88854, trades: 219 }


So as max score, I get always a 1. Profit or sharpe aren't improving ether. It's just a coincidence that the profit from epoch 2 is higher than epoch 1.

Am I doing something wrong?

123qweas commented 6 years ago

Is there maybe a way to just use sharpe as mainObjective?

123qweas commented 6 years ago

I'm using v0.6.3 but I also tried it with v0.5.14 and had the same problem.