Gab0 / japonicus

Genetic Algorithm for Gekko Trading Bot.
MIT License
285 stars 102 forks source link

running strategy with japonicus #169

Open sahilnanda1995 opened 6 years ago

sahilnanda1995 commented 6 years ago

Hi I'm trying to run a strategy with japonicus but its not evaluating anything.

this is the output i get:

Failure to find strategy parameter rules for testStratJap at ./strategy_parameters
Trying to locate gekko parameters at /root/Dev/gekko/config/strategies/testStratJap.toml
Evaluation dataset not found.
japonicus-run -g --strat testStratJap
Evolving testStratJap strategy;

evaluated parameters ranges:
MACD_short                    (7.0, 13.0)

MACD_long                     (18.2, 33.8)

MACD_signal                   (6.3, 11.7)

DEMA_long                     (28.0, 52.0)

evolution candlestick dataset 2015-08-24 12:58:00 to 2018-09-23 05:58:00
BTC/USD @bitfinex

evolution candlestick dataset 2015-08-24 12:58:00 to 2018-09-23 05:58:00
BTC/USD @bitfinex

    ====== EPOCH 0/3000 ======
Locale1
first unevaluated: 50
0 individues removed due to equality
[50]
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 30.64, 'MACD_long': 22.88, 'MACD_short': 7.42, 'MACD_signal': 9.161999999999999}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 42.16, 'MACD_long': 20.852, 'MACD_short': 8.08, 'MACD_signal': 7.002}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 43.12, 'MACD_long': 21.476, 'MACD_short': 12.52, 'MACD_signal': 7.704}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 39.28, 'MACD_long': 22.256, 'MACD_short': 7.48, 'MACD_signal': 10.026}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 46.480000000000004, 'MACD_long': 32.239999999999995, 'MACD_short': 12.1, 'MACD_signal': 11.052}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 41.2, 'MACD_long': 26.936, 'MACD_short': 10.24, 'MACD_signal': 6.354}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 31.36, 'MACD_long': 24.752, 'MACD_short': 10.120000000000001, 'MACD_signal': 8.946}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
{'watch': {'exchange': 'bitfinex', 'currency': 'USD', 'asset': 'BTC'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'testStratJap', 'candleSize': 10, 'historySize': 10}, 'testStratJap': {'DEMA_long': 37.84, 'MACD_long': 18.823999999999998, 'MACD_short': 10.48, 'MACD_signal': 8.405999999999999}, 'backtest': {'daterange': {'from': '2017-10-13 14:29:25', 'to': '2018-01-11 14:29:25'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': True, 'trades': True}, 'backtestResultExporter': {'enabled': True, 'writeToDisk': False, 'data': {'stratUpdates': False, 'roundtrips': True, 'stratCandles': False, 'stratCandleProps': ['open'], 'trades': False}}}
'bool' object is not subscriptable
Error: config failure
Expecting value: line 1 column 1 (char 0)
http://localhost:3000/api/backtest
Gab0 commented 6 years ago

Hey, which gekko version are you on? Also, what gekko outputs in this run? cheers

sahilnanda1995 commented 6 years ago

hello, i changed my this part of the code in the strategy

strat.init = function() {
  // your code!
  this.addTulipIndicator('mymacd', 'macd',{
    optInFastPeriod: 10,
    optInSlowPeriod: 26,
    optInSignalPeriod: 9
  });
  this.addTulipIndicator('dema60', 'dema',{
    optInTimePeriod:40
  });
}

to this for Japonicus

strat.init = function() {
  // your code!
  this.addTulipIndicator('mymacd', 'macd',{
  optInFastPeriod: this.settings.MACD_short,
  optInSlowPeriod: this.settings.MACD_long,
  optInSignalPeriod: this.settings.MACD_signal
  });
  this.addTulipIndicator('dema40', 'dema',{
   optInTimePeriod: this.settings.DEMA_long
  });
}

Gekko version: Gekko v0.6.7 And output for Gekko

## Sell false ##
02-08-2018 12:00
open:7562.42 | close:7524.79
boughtAt: 0
################################################
15-08-2018 00:00
bought: 6289.99
open:6188.08 | close:6289.99
dema60: 6081.018837151685
mac, macS, adx: -83.83198586269282, -98.47843676135564, 20.053649698457384
2018-11-30 19:26:33 (INFO): 2018-08-15 09:30:00: Paper trader simulated a BUY   0.00000000 USDT => 1.01587442 BTC
## Sell ############**************************
15-08-2018 20:00
open:6363.16 | close:6267.16
2018-11-30 19:26:33 (INFO): 2018-08-16 05:30:00: Paper trader simulated a SELL  6357.09755875 USDT <= 0.00000000 BTC
################################################
16-08-2018 00:00
bought: 6270.5
open:6265.27 | close:6270.5
dema60: 6146.5928427595945
mac, macS, adx: -2.612528325654239, -33.65743204088393, 17.762557147640322
2018-11-30 19:26:33 (INFO): 2018-08-16 09:30:00: Paper trader simulated a BUY   0.00000000 USDT => 1.01228959 BTC
## Sell ############**************************
16-08-2018 20:00
open:6408.59 | close:6311.75
2018-11-30 19:26:33 (INFO): 2018-08-17 05:30:00: Paper trader simulated a SELL  6379.73484145 USDT <= 0.00000000 BTC
################################################
11-09-2018 00:00
bought: 6355
open:6311.99 | close:6355
dema60: 6267.661788421486
mac, macS, adx: -88.1944508617471, -123.61364613778203, 42.53225895022953
2018-11-30 19:26:35 (INFO): 2018-09-11 09:30:00: Paper trader simulated a BUY   0.00000000 USDT => 1.00238634 BTC
## Sell ############**************************
11-09-2018 12:00
open:6280.77 | close:6250.63
2018-11-30 19:26:36 (INFO): 2018-09-11 21:30:00: Paper trader simulated a SELL  6256.14780920 USDT <= 0.00000000 BTC
################################################
11-09-2018 20:00
bought: 6294.91
open:6269.23 | close:6294.91
dema60: 6227.66164691801
mac, macS, adx: -72.59545167007946, -92.92010080828928, 38.58737174643401
2018-11-30 19:26:36 (INFO): 2018-09-12 05:30:00: Paper trader simulated a BUY   0.00000000 USDT => 0.99235153 BTC
## Sell ############**************************
17-09-2018 12:00
open:6473.05 | close:6265.06
2018-11-30 19:26:36 (INFO): 2018-09-17 21:30:00: Paper trader simulated a SELL  6207.81616372 USDT <= 0.00000000 BTC
################################################
19-09-2018 20:00
bought: 6391.89
open:6412.14 | close:6391.89
dema60: 6336.240139939912
mac, macS, adx: -20.394228548606407, -34.109970720445915, 25.119590475840894
2018-11-30 19:26:36 (INFO): 2018-09-20 05:30:00: Paper trader simulated a BUY   0.00000000 USDT => 0.96974516 BTC
## Sell ############**************************
24-09-2018 08:00
open:6677.9 | close:6576.98
2018-11-30 19:26:37 (INFO): 2018-09-24 17:30:00: Paper trader simulated a SELL  6368.42753063 USDT <= 0.00000000 BTC
################################################
04-10-2018 04:00
bought: 6574.45
open:6598.5 | close:6574.45
dema60: 6553.877621397338
mac, macS, adx: -15.754232640128976, -21.95244862222291, 21.673387978659722
2018-11-30 19:26:38 (INFO): 2018-10-04 13:30:00: Paper trader simulated a BUY   0.00000000 USDT => 0.96721016 BTC
## Sell ############**************************
11-10-2018 00:00
open:6630.21 | close:6340.52
2018-11-30 19:26:39 (INFO): 2018-10-11 09:30:00: Paper trader simulated a SELL  6123.41644063 USDT <= 0.00000000 BTC
################################################
14-10-2018 04:00
bought: 6379.95
open:6363.24 | close:6379.95
dema60: 6335.819330037147
mac, macS, adx: -45.51539697361113, -67.40125954302589, 40.2707674831627
2018-11-30 19:26:39 (INFO): 2018-10-14 13:30:00: Paper trader simulated a BUY   0.00000000 USDT => 0.95835097 BTC
## Sell ############**************************
15-10-2018 16:00
open:6906.03 | close:6741
2018-11-30 19:26:39 (INFO): 2018-10-16 01:30:00: Paper trader simulated a SELL  6450.55352293 USDT <= 0.00000000 BTC
################################################
31-10-2018 20:00
bought: 6371.93
open:6371.37 | close:6371.93
dema60: 6360.108389448508
mac, macS, adx: -40.22467306411909, -50.163815836084936, 37.37504355076937
2018-11-30 19:26:41 (INFO): 2018-11-01 05:30:00: Paper trader simulated a BUY   0.00000000 USDT => 1.01082053 BTC
2018-11-30 19:26:41 (INFO): 
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) REPORT:
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) entry date (UTC)    exit date (UTC)     exposed duration    P&L     profit
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) 2018-08-15 04:00    2018-08-16 00:00    20 hours            -32.74  -0.51
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) 2018-08-16 04:00    2018-08-17 00:00    20 hours            32.17   0.51
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) 2018-09-11 04:00    2018-09-11 16:00    12 hours            -114.02 -1.79
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) 2018-09-12 00:00    2018-09-17 16:00    6 days              -38.95  -0.62
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) 2018-09-20 00:00    2018-09-24 12:00    5 days              169.92  2.74
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) 2018-10-04 08:00    2018-10-11 04:00    7 days              -235.46 -3.70
2018-11-30 19:26:41 (INFO): (ROUNDTRIP) 2018-10-14 08:00    2018-10-15 20:00    2 days              336.32  5.50
2018-11-30 19:26:41 (INFO): 
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) start time:          2018-08-01 00:00:00
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) end time:            2018-11-01 00:00:00
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) timespan:            3 months
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) exposure:            0.2246376811594203
2018-11-30 19:26:41 (INFO): 
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) start price:             7730.41 USDT
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) end price:           6371.93 USDT
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) Market:              -17.57319469%
2018-11-30 19:26:41 (INFO): 
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) amount of trades:        15
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) original balance:        7830.41000000 USDT
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) current balance:         6440.87765972 USDT
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) profit:              -1389.53234028 USDT (-17.74533313%)
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) simulated yearly profit:     -5516.481149931073 USDT (-70.4494547530854%)
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) sharpe ratio:            -25.068977896473857
2018-11-30 19:26:41 (INFO): (PROFIT REPORT) expected downside:       -2.950051242960719