Gab0 / japonicus

Genetic Algorithm for Gekko Trading Bot.
MIT License
283 stars 103 forks source link

Some questions about "interface" #118

Closed xFFFFF closed 6 years ago

xFFFFF commented 6 years ago

I have a few doubts about the messages japonicus prints. I do not know if I understand them correctly.

EXAMPLE RESULTS

Remember to check MAX and MIN values for each parameter.
    results may improve with extended ranges.
    ======  EPOCH 105/500  ======
Locale1
first unevaluated: 0
0 individues removed due to equality
-
[0]
EPOCH 105   &0
Maximum profit 158.145  Average profit 158.145  
Minimum profit 158.145  Profit variation 0.000  
Population size 728 Max population size 800 
Avg trade number 0  Avg sharpe ratio 0.215  

Elder dies 34

Locale2
first unevaluated: 0
0 individues removed due to equality
-
[0]
EPOCH 105   &0
Maximum profit 13.544   Average profit 13.544   
Minimum profit 13.544   Profit variation 0  
Population size 687 Max population size 800 
Avg trade number 0  Avg sharpe ratio -0.307 

Elder dies 25

Epoch runs in 2.53 seconds;

Selecting 1+0 individues, random test;
0 selected;
1 selected;
Testing monthly profit 6.966     nbTrades: 2.0
Testing monthly profit 33.329    nbTrades: 3.0
Testing monthly profit 1.644     nbTrades: 1.0
Testing monthly profit -1.278    nbTrades: 1.0
Testing monthly profit 30.123    nbTrades: 3.0
Testing monthly profit -0.990    nbTrades: 0.0
Testing monthly profit 9.515     nbTrades: 13.0
Testing monthly profit -5.569    nbTrades: 1.0
Testing monthly profit -3.082    nbTrades: 18.0
Testing monthly profit 73.379    nbTrades: 16.0
Testing monthly profit -0.144    nbTrades: 1.0
Testing monthly profit -6.058    nbTrades: 1.0
Annual profit 137.835%
Testing Strategy of Locale1 @ EPOCH 106:

Following strategy is viable.
{'daterange': {'from': 1510388700, 'to': 1523141280}, 'specifications': {'exchange': 'binance', 'currency': 'BNB', 'asset': 'BCC'}}
{'from': '2017-11-11 08:25:00', 'to': '2018-04-07 22:48:00'}

([((2488.1655833473997, 0.13552131446708254), 237.0)], 284.7041485309601)
Relative profit on evaluation dataset: 2488.166 
~~~~~~~~~~~~~~~~~~
 137.835 final profit ~~~~
 -- Settings for Gekko config.js -- 
{
  "SMA_long": 363.0,
  "SMA_short": 76.25,
  "decay": 4.569999999999999,
  "learning_rate": 1.848,
  "min_predictions": 8.72,
  "momentum": 2.072,
  "price_buffer_len": 124.8,
  "threshold_buy_bear": 2.84,
  "threshold_buy_bull": 1.52,
  "threshold_sell_bear": -1.113,
  "threshold_sell_bull": -1.02
}
 -- Settings for Gekko --ui webpage -- 
SMA_long = 363.0
SMA_short = 76.25
decay = 4.569999999999999
learning_rate = 1.848
min_predictions = 8.72
momentum = 2.072
price_buffer_len = 124.8
threshold_buy_bear = 2.84
threshold_buy_bull = 1.52
threshold_sell_bear = -1.113
threshold_sell_bull = -1.02

Remember to check MAX and MIN values for each parameter.
    results may improve with extended ranges.
Selecting 1+0 individues, random test;
0 selected;
1 selected;
Testing monthly profit 6.493     nbTrades: 16.0
Testing monthly profit 7.455     nbTrades: 30.0
Testing monthly profit -0.548    nbTrades: 8.0
Testing monthly profit 14.605    nbTrades: 23.0
Testing monthly profit 35.140    nbTrades: 9.0
Testing monthly profit 2.365     nbTrades: 10.0
Testing monthly profit 5.495     nbTrades: 56.0
Testing monthly profit 0.558     nbTrades: 6.0
Testing monthly profit 9.332     nbTrades: 80.0
Testing monthly profit 33.878    nbTrades: 74.0
Testing monthly profit 9.131     nbTrades: 25.0
Testing monthly profit -0.154    nbTrades: 10.0
Annual profit 123.750%
Testing Strategy of Locale2 @ EPOCH 106:

No 1

([((2488.1655833473997, 0.13552131446708254), 237.0)], 284.7041485309601)
Relative profit on evaluation dataset: 2488.166

relative profit its sum of profit of locales from current epoch? what mean first form above lines?

No 2 336.780 final profit ~~~~ - its profit of best locale? montly, yearly?

No 3

{
  "SMA_long": 363.0,
  "SMA_short": 76.25,
  "decay": 4.569999999999999,
  "learning_rate": 1.848,
  "min_predictions": 8.72,
  "momentum": 2.072,
  "price_buffer_len": 124.8,
  "threshold_buy_bear": 2.84,
  "threshold_buy_bull": 1.52,
  "threshold_sell_bear": -1.113,
  "threshold_sell_bull": -1.02
}

Above is best settings from last epoch?

No 4

Maximum profit 158.145  Average profit 158.145  
Minimum profit 158.145  Profit variation 0.000

Above profit is per month?

No 5

Testing monthly profit 6.966     nbTrades: 2.0
Testing monthly profit 33.329    nbTrades: 3.0
Testing monthly profit 1.644     nbTrades: 1.0
Testing monthly profit -1.278    nbTrades: 1.0
Testing monthly profit 30.123    nbTrades: 3.0
Testing monthly profit -0.990    nbTrades: 0.0
Testing monthly profit 9.515     nbTrades: 13.0
Testing monthly profit -5.569    nbTrades: 1.0
Testing monthly profit -3.082    nbTrades: 18.0
Testing monthly profit 73.379    nbTrades: 16.0
Testing monthly profit -0.144    nbTrades: 1.0
Testing monthly profit -6.058    nbTrades: 1.0

above is random locales? or best locales?

And at end: Where can I find the best settings? I need to search the entire log of japonicus and find the settings with the highest value of the final profit?

Gab0 commented 6 years ago

haa true Story, we got some strange stuff going on the interface, I'm working to get things clearer.

No 1 in the order they appear: relativeProfit, sharpe ratio, number of trades, then total number of trades for all strats. This line was for debug purpose. It think it's gone on current version.

No 2 its the profit of one individue of current locale (each locale is evaluated, some individues are chosen from it: some randomly, some by score) after all "Testing monthly profit" runs. Right below this is the settings for the corresponding individue, shown at your No 3. The entire "Testing monthly profit" sector is an additional evaluation process detached from the epochs. It does not affect evolution, just selects and shows current best individues.

No 4 average profit per epoch (wich runs a piece of the dataset of deltaDays length)

No 5 each line is a random piece of the dataset of deltaDays length. All these 'monthly profits' are from one individual from one locale.

END - Each run of monthly profits is made from random dataset sectors, so its not an absolute measure of fitness. The run on full evaluation dataset (just after monthly profits) is more trustable, as its always ran on the same dateranges. Japonicus tries to account for overfitting in determined datasets, so the best profit is the last best profit shown (not always the case). The time of the best settings is usually around EPOCH 300, point which varies with different settings. But remember that there is no best settings for given strat, it depends on the dataset & timeframe inside it. If you are doing benchmarking of strategies or something, plz consider the last 'best profit' from japonicus...

cheers!

xFFFFF commented 6 years ago

Thanks. Now is clear. Japonicus is strange but finding best parameters in shorter period than other similar tools.