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

loops



PureBytes Links

Trading Reference Links


Hi all here,s a explorer afl I have been playing 
 with it only works out the % successful on the cross 8 21 ma so far 

 
Q. can I make AB loop through the other maor do I 
need to write each piece over with the new ma ?
 
I think the anwers is no but thought I would 
check
 
by the way I haven't check it for accuracyyet 
:))
 
 
 
Thanks David
 
ps as alway if you can show me an easier /better 
way to achieve the results yell out :)))
 
 
 
 
/*  multi ma cross By David 
Holzgrefe23.05.2001 */
 
ma1=cross(ema(close,8),ema(close,21));  // ma 
crossma2=cross(ema(close,8),ema(close,30));  // ma 
crossma3=cross(ema(close,8),ema(close,45));  // ma cross
 
barssince(ma1==1);  // Calculatesthe number 
of bars truebarssince(ma2==1);barssince(ma3==1);
 
bull=ref((close>open),3);  // bullish days 
since cross 
 
xn=open;xb=(bull==1 and ma1==1);  // cross 
bullishxd=(bull==0 and ma1==1);  //cross bearish
 
total = 
cum(ma1);bull=cum(xb);bear=cum(xd);successbull = bull/total*100 
;successbear =bear/total*100 ;
 
filter=barssince(ma1==1); // needed for explorer 
?
 
numcolumns=5;
 
column0=cum(ma1);column0name="times 
8/21";column0format=1.0;
 
column1=cum(ma2);column1name="times 
8/30";column1format=1.0;
 
column2=cum(ma3);column2name="times 
8/45";column2format=1.0;
 
column4=successbear;column4name=" % 
bearish";column4format=1.0;
 
column3=successbull ;column3name=" % 
bullish";column3format=1.0;