Posted By: trenki2
adviseLong Bug - 01/27/17 13:20
The following script can reproduce a potential bug. The script downloads asset history from Yahoo for the symbol "FRE.DE" and then tries to trade it.
The adviseLong functionality then tries to generate a function name with a . in it and therefore the script can not run in test mode.
The adviseLong functionality then tries to generate a function name with a . in it and therefore the script can not run in test mode.
Code:
// Gives a compiler error when trying to run the script after training // The problem seems to be the . in the asset name downloaded from Yahoo. // Zorro tries to generate a C function with a . in it. // The asset name "FRE.DE" is a valid Yahoo finance asset name. // https://finance.yahoo.com/quote/FRE.DE?p=FRE.DE // Warning 034: No asset data for FRE.DE // Rules: Test7 2000..2016 (5 cores) // Train FRE.DE_L -Mar 2010- 53.0% // Rules stored in Test7_1.c // Run Test7.. // Walk-Forward Test: Test7 FRE.DE 2000..2016 // Error in 'line 3: // syntax error // < int FRE.DE_L(float* sig) > // Read Test7_1.c int run() { set(RULES | TESTNOW); BarPeriod = 1440; StartDate = 2000; TradesPerBar = 2; Hedge = 5; NumWFOCycles = 5; NumCores = -1; assetHistory("FRE.DE", FROM_YAHOO); while (asset(loop("FRE.DE"))) { vars price = series(priceClose()); var rsi2 = RSI(price, 2); var ma = SMA(price, 50); var ratio = price[0] / ma; LifeTime = 1; if (adviseLong(PERCEPTRON, 0, rsi2, ratio) > 55) enterLong(); } }