nick-dolan / gekko-batcher

Batch backtest tool for Gekko.
MIT License
36 stars 15 forks source link

bruteforce memory error #8

Closed jasonkimMGB closed 5 years ago

jasonkimMGB commented 5 years ago

execute 'node bruteforce' and exeucte javascript memory error FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

run 'npm install -g increase-memory-limit' and execute 'node --max_old_space_size=60000 bruteforce'

and still error FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory 1: <--- Last few GCs --->

[10373:0x37350c0] 260033 ms: Scavenge 22917.5 (23406.3) -> 22914.4 (23406.3) MB, 59.7 / 0.0 ms allocation failure [10373:0x37350c0] 260114 ms: Scavenge 22923.6 (23406.3) -> 22920.5 (23406.3) MB, 58.2 / 0.0 ms allocation failure [10373:0x37350c0] 260198 ms: Scavenge 22929.8 (23406.3) -> 22926.7 (23406.3) MB, 60.3 / 0.0 ms allocation failure [10373:0x37350c0] 260282 ms: Scavenge 22935.9 (23406.3) -> 22932.8 (23406.3) MB, 60.8 / 0.0 ms allocation failure

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x3939cd8a58b9 1: push(this=0x23b63ee0e7d1 <JSArray[112813858]>) 2: generateValueCombinations(aka generateValueCombinations) [/opt/gekko-batcher/node_modules/combos/lib/utils.js:41] [bytecode=0xe3e0d9b19e9 offset=191](this=0x3e608f5822d1 ,_ref=0x23b63ee0e811 <JSArray[8]>) 3: generateValueCombinations(aka generateValueCombinations) [/opt/gekko-batcher/node_modules/combos/lib/utils.js:35] ...

node::Abort() [node] 2: 0x8ccf9c [node] 3: v8::Utils::ReportOOMFailure(char const, bool) [node] 4: v8::internal::V8::FatalProcessOutOfMemory(char const, bool) [node] 5: v8::internal::Heap::AllocateRawFixedArray(int, v8::internal::PretenureFlag) [node] 6: v8::internal::Heap::AllocateFixedArrayWithFiller(int, v8::internal::PretenureFlag, v8::internal::Object*) [node] 7: v8::internal::Factory::NewUninitializedFixedArray(int) [node] 8: 0xd81a1f [node] 9: 0xd95b55 [node]

==config.js== const config = {};

config.gekkoPath = '/usr/src/app/';

config.apiUrl = "http://localhost:3001";

config.parallelQueries = 10;

config.candleSizes = [10,30,60,90,120,180];

config.historySizes = [5,10,15,20,50,100,150];

config.tradingPairs = [ ["binance", "usdt", "btc"], ["binance", "usdt", "eth"], ["poloniex", "usdt", "xrp"]

];

config.daterange = { from: '2018-06-01T00:00:00Z', to: '2019-01-15T23:59:59Z' };

config.paperTrader = { simulationBalance: { currency: 50, asset: 0 }, feeMaker: 0.25, feeTaker: 0.25, feeUsing: 'maker', slippage: 0.05, }

config.configPriorityLocations = ['batcher', 'gekko', 'gekko-toml'];

config.methods = ['MK_RSI_BULL_BEAR'];

config.method = 'MK_RSI_BULL_BEAR';

config.shuffle = true;

config.ranges = { SMA_long : '200:50:800', SMA_short : '20:10:50', BULL_RSI : 10, BULL_FAST_RSI : 15, BULL_SLOW_RSI : 14, BULL_RSI_HIGH : '80:1:90, BULL_RSI_LOW : '55:1:65', BEAR_RSI : 15, BEAR_FAST_RSI : 5, BEAR_SLOW_RSI : 14, BEAR_RSI_HIGH : '45:1:55', BEAR_RSI_LOW : '15:1:25' };

config.MK_RSI_BULL_BEAR = { SMA_long : 350, SMA_short : 20, BULL_RSI : 10, BULL_FAST_RSI : 5, BULL_SLOW_RSI : 14, BULL_RSI_HIGH : 70, BULL_RSI_LOW : 50, BEAR_RSI : 15, BEAR_FAST_RSI : 3, BEAR_SLOW_RSI : 10, BEAR_RSI_HIGH : 45, BEAR_RSI_LOW : 15 };

module.exports = config;

SMA_long : 200,
SMA_short : 20,
BULL_RSI : 10,
BULL_FAST_RSI : 5,
BULL_SLOW_RSI : 14,
BULL_RSI_HIGH : 70,
BULL_RSI_LOW : 50,
BEAR_RSI : 15,
BEAR_FAST_RSI : 3,
BEAR_SLOW_RSI : 10,
BEAR_RSI_HIGH : 45,
BEAR_RSI_LOW : 15

SMA Trends

MK 200 worked better - all other changes were worse

SMA_long = 1000

SMA_long = 350 SMA_short = 20

BULL

BULL_RSI = 10 BULL_FAST_RSI = 5 BULL_SLOW_RSI = 14 BULL_RSI_HIGH=85 BULL_RSI_LOW=60

BEAR

BEAR_RSI = 15 BEAR_FAST_RSI = 5 BEAR_SLOW_RSI = 14 BEAR_RSI_HIGH=50 BEAR_RSI_LOW=20

BULL/BEAR is defined by the longer SMA trends

if SHORT over LONG = BULL

if SHORT under LONG = BEAR

any suggesstions?

jasonkimMGB commented 5 years ago

shorten case and sun success