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

[amibroker] Applystop question



PureBytes Links

Trading Reference Links

In continuing to read and learn from back posts to this group, I've 
reached "Fred's Watered Down Semi-Interesting System got 
Interesting", Herman ran Fred's system (and Herman's modification) 
with and without stops applied (4 runs in total):

http://groups.yahoo.com/group/amibroker/message/34463?threaded=1

I can reproduce the two runs without stops, but fail miserably to 
equal the returns when I attempt the backtests with stops. Here is 
the code for Herman's modification, with stops:

SetTradeDelays(0,0,0,0); 
BuyPrice= Close; 
SellPrice = Close; 
CoverPrice = Close; 
ShortPrice = Close; 
 
Length     =   3;//Optimize("RSILen",  0,  2,   6,  1);  
LELevelOBS =  30;//Optimize("OBSLE",   0,  0,  50,  1);  
LELevelMom =  67;//Optimize("MomLE",   0,  0, 100,  1);  
LXLevelOBS =  91;//Optimize("OBSLX",   0, 50, 100,  1);  
LXLevelMom =  12;//Optimize("MomLX",   0,  0, 100,  1);  
SELevelOBS =  84;//Optimize("OBSSE",   0, 50, 100,  1);  
SELevelMom =  24;//Optimize("MomSE",   0,  0, 100,  1);  
SXLevelOBS =   5;//Optimize("OBSSX",   0,  0,  50,  1);  
SXLevelMom =  65;//Optimize("MomSX",   0,  0, 100,  1);  
Price   = Foreign("!NDX","C");  
RSIx    = RSIa(Price, Length);  
RSIxHHV = HHV(RSIx, Length);  
RSIxLLV = LLV(RSIx, Length);  
StoRSIx = 100 * Sum((RSIx - RSIxLLV), Length) / Sum((RSIxHHV - 
RSIxLLV), Length);  
Buy1   = Cross(LELevelOBS, StoRSIx) OR Cross(StoRSIx, LELevelMom);  
Short1 = Cross(StoRSIx, SELevelOBS) OR Cross(SELevelMom, StoRSIx);   
Sell  = (Cross(StoRSIx, LXLevelOBS) OR Cross(LXLevelMom, StoRSIx)) OR 
Short1; 
Short=Sell; 
Cover = (Cross(SXLevelOBS, StoRSIx) OR Cross(StoRSIx, SXLevelMom)) OR 
Buy1; 
Buy = Cover; 
E = Equity(1); 
Plot(E,"BasicEquity",1,1); 
 
LPos = Ref(Flip(Buy,Sell),-1); 
SPos = Ref(Flip(Short,Cover),-1); 
LPT    = 7; //Optimize("LProfitTarget",8,0,10,.1); 
SPT    = 2.4; //Optimize("SProfitTarget",9,0,10,.1); 
PT = IIf(LPos,LPT,IIf(SPos,SPT,0)); 
ApplyStop(1,1,PT,1); 
E=Equity(1); 
Plot(E,"StopEquity",4,1);


Can anyone suggest some setting which I may have wrong? Do 
the 'Stops' settings remain diabled?

Thanks,

Steve



------------------------ Yahoo! Groups Sponsor ---------------------~-->
FREE Cell Phones with up to $400 Cash Back!
http://us.click.yahoo.com/_bBUKB/vYxFAA/i5gGAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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