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

[amibroker] Trend Qualifiers applied on Steve Karnish StochRSI systerm



PureBytes Links

Trading Reference Links




The Steve Karnish StochRSI system [#1] is a fast [average 
2trades/month] o/b-o/s detector.Its QQQ exposure is 97% and may be reduced 
with the help of trend qualifiers.Buy/Short signals will be accepted if they 
meet some trend criteria, else they will be rejected at all. We may take 
this decision by examining the very day when Buy/Short signal occurs [#2] or the 
Buy/Short expectation, as defined by TomDeMark Sequential method [#3, #4] or , 
finally, after the TD sequential Buy/Short signal [#5, #6]The results, the 
accepted/rejected signals and the TD sequential overlay on the basic system are 
in the att. gifHere we have the analytic AFL codes.
// #1. Steve Karnish StoRSI 
[simple]StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100;Buy=Cross(17,StochRsi);Sell=Cross(StochRsi,83);Short=Cross(StochRsi,83);Cover=Cross(17,StochRsi);
 
// #2. Steve Karnish StoRSI [MA(C,21)]/*The Buy signal is 
accepted if the 21-bar MA is ascending the same day.The Short signal is 
accepted if the 21-bar MA is descending the same 
day*/StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100;Buy=Cross(17,StochRsi) 
AND Ref(MA(C,21),-1) < 
MA(C,21);;Sell=Cross(StochRsi,83);Short=Cross(StochRsi,83) AND 
Ref(MA(C,21),-1) > MA(C,21);Cover=Cross(17,StochRsi);
 
// #3. TD1/*The Buy signal is accepted when it falls into 
the Buy expectation area, defined by TD sequential 
method*/bull=0;bear=0;for(x=3;x<25;x++){  
b2=Sum(C<Ref(C,-3),x)==x;bull=bull+b2;}for(x=3;x<25;x++){  
S2=Sum(C>Ref(C,-3),x)==x;bear=bear+s2;}Bcond=Ref(bull,-1)!=0;Scond=Ref(bear,-1)!=0;StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100; 
x=17;Buy=Cross(x,stochRsi) AND 
Bcond;y=83;Sell=Cross(stochRsi,y); Short=Cross(stochRsi,y);// AND 
Scond;Cover=Cross(x,stochRsi) ; 
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
 
// #4. TD2/*The Buy/Short signals are accepted when they 
fall into the Buy expectation/Short expectation area, defined by TD sequential 
method*/bull=0;bear=0;for(x=3;x<25;x++){  
b2=Sum(C<Ref(C,-3),x)==x;bull=bull+b2;}for(x=3;x<25;x++){  
S2=Sum(C>Ref(C,-3),x)==x;bear=bear+s2;}Bcond=Ref(bull,-1)!=0;Scond=Ref(bear,-1)!=0;StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100; 
x=17;Buy=Cross(x,stochRsi) AND 
Bcond;y=83;Sell=Cross(stochRsi,y); Short=Cross(stochRsi,y) AND 
Scond;Cover=Cross(x,stochRsi) ; 
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
 
// #5. TD3/*The Buy signal is accepted if it comes a0 bars 
after the TD sequential Buy 
area*/bull=0;bear=0;for(x=3;x<25;x++){  
b2=Sum(C<Ref(C,-3),x)==x;bull=bull+b2;}for(x=3;x<25;x++){  
S2=Sum(C>Ref(C,-3),x)==x;bear=bear+s2;}Bcond=Ref(bull,-1)!=0;Scond=Ref(bear,-1)!=0;StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100; 
x=17;a0=Optimize("a0",9,1,20,1);b0=Optimize("b0",15,1,20,1);Buy=Cross(x,stochRsi) 
AND BarsSince(Bcond)<a0;y=83;Sell=Cross(stochRsi,y); 
Short=Cross(stochRsi,y);// AND 
BarsSince(Scond)<b0;Cover=Cross(x,stochRsi) ; 
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
 
// #6. TD4/*Buy/Short signals are accepted if they come 
a0/b0 bars after the TD sequential Buy/Short 
area*/bull=0;bear=0;for(x=3;x<25;x++){  
b2=Sum(C<Ref(C,-3),x)==x;bull=bull+b2;}for(x=3;x<25;x++){  
S2=Sum(C>Ref(C,-3),x)==x;bear=bear+s2;}Bcond=Ref(bull,-1)!=0;Scond=Ref(bear,-1)!=0;StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100; 
x=17;a0=Optimize("a0",9,1,20,1);b0=Optimize("b0",15,1,20,1);Buy=Cross(x,stochRsi) 
AND BarsSince(Bcond)<a0;y=83;Sell=Cross(stochRsi,y); 
Short=Cross(stochRsi,y) AND 
BarsSince(Scond)<b0;Cover=Cross(x,stochRsi) ; 
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
 
The systems were applied on QQQ, from Jan2000 till Sept2003 
with the following settings:Buy/Sell/Short/Cover at OpenDelay 
+1Commission 0.01$/tradeAll Stops disabled.
 
For the Indicator builder window the code was
 
<FONT 
size=2>Title=Name()+",";bull=0;bear=0;for(x=3;x<25;x++){  
b2=Sum(C<Ref(C,-3),x)==x;bull=bull+b2;Buy=b2==0 AND 
Ref(b2,-1);PlotShapes((shapeHollowCircle)*b2,colorBrightGreen);PlotShapes(shapeUpArrow*Buy,colorBrightGreen);Title=Title+WriteIf(b2,"b["+WriteVal(x,1.0)+"]","");}for(x=3;x<25;x++){  
S2=Sum(C>Ref(C,-3),x)==x;bear=bear+s2;Sell=s2==0 AND 
Ref(s2,-1);PlotShapes((shapeHollowCircle+shapePositionAbove)*s2,colorRed);PlotShapes(shapeDownArrow*Sell,colorRed);Title=Title+WriteIf(s2,"s["+WriteVal(x,1.0)+"]","");}Plot(C,"C",1,64);StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100; 
Plot(stochRsi,"",colorPink,styleDots+styleLeftAxisScale);Plot(17,"",colorPink,styleDots+styleLeftAxisScale);Plot(83,"",colorPink,styleDots+styleLeftAxisScale);GraphXSpace=3;
 
Dimitris Tsokakis






Yahoo! Groups Sponsor












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 the Yahoo! Terms of Service.



Attachment:
1exp.gif

Attachment: Description: "Description: GIF image"