[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Amibroker Crashes When Optimizing



PureBytes Links

Trading Reference Links

Does anyone know why this would cause Amibroker to crash when trying
to optimize it? 

Tks


//X = Param("Lookback Length", 126, 2, 252, 2);
X = Optimize("Lookback Length", 126, 2, 252, 2);

DBA = Foreign("DBA", "C");
DBE = Foreign("DBE", "C");
DBP = Foreign("DBP", "C");
DBV = Foreign("DBV", "C");
EEM = Foreign("EEM", "C");
IYR = Foreign("IYR", "C");
SPY = Foreign("SPY", "C");
TLT = Foreign("TLT", "C");

//AGG1 = IIf(AGG/Ref(AGG,-X) > 1, 1, 0);
DBA1 = IIf(DBA/Ref(DBA,-X) > 1, 1, 0);
DBE1 = IIf(DBE/Ref(DBE,-X) > 1, 1, 0);
DBP1 = IIf(DBP/Ref(DBP,-X) > 1, 1, 0);
DBV1 = IIf(DBV/Ref(DBV,-X) > 1, 1, 0);
EEM1 = IIf(EEM/Ref(EEM,-X) > 1, 1, 0);
IYR1 = IIf(IYR/Ref(IYR,-X) > 1, 1, 0);
SPY1 = IIf(SPY/Ref(SPY,-X) > 1, 1, 0);
TLT1 = IIf(TLT/Ref(TLT,-X) > 1, 1, 0);

Total = DBA1 + DBE1 + DBP1 + DBV1 + EEM1 + IYR1 + SPY1 + TLT1;

A = C/Ref(C,-X);
Cond1 = IIf(A > 1, 1, -1);
B = A*Cond1;
SetBacktestMode( backtestRotational ); 

//WRH = Param("Worst Rank Held", 1, 1, 10, 1); 
SetOption("WorstRankHeld", LastValue(Total));

//HMB = Param("Hold Min Bars", 5, 1, 21, 1);
//SetOption("HoldMinBars", HMB);  

//PosSize = Param("Position Size", 1, 1, 25, 1 );
SetOption("MaxOpenPositions", LastValue(Total) ); 
PositionSize = -100/LastValue(Total);
 

//Buy = A > 0 AND Cond1 == 1;
//Sell = A < 0 AND Cond1 != 1;

PositionScore = B;

Filter =  1;
AddTextColumn(FullName(), "ETF Name");
AddColumn(A, "Return", 1.5 ); 
AddColumn(B, "Adjusted Return", 1.5 ); 
AddColumn(Total,"Total", 1);
//AddColumn(AGG1,"AGG", 1);
AddColumn(DBA1,"DBA", 1);
AddColumn(DBE1,"DBE", 1);
AddColumn(DBP1,"DBP", 1);
AddColumn(DBV1,"DBV", 1);
AddColumn(EEM1,"EEM", 1);
AddColumn(IYR1,"IYR", 1);
AddColumn(SPY1,"SPY", 1);
AddColumn(TLT1,"TLT", 1);
Plot(Ref(C,-X), "Close", colorYellow, styleLine);


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

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/