PureBytes Links
Trading Reference Links
|
I have been trying to use "Bars Since" In an exploration that
calculates the number of bars since the price has crossed above or
below the indicator(s), When I run the exploration the "buysignal"
and "sellsignal" columns are empty. I have tried a number of ways
with no success. Am I missing something or is there a better way
to
do this? Any help will be appreciated. I have provided the code
below.
function PRSI(price,eper,wper)
{
Value = EMA( RSI( wper ), eper );
AUC = Wilders( Max( price - Ref( price, -1 ), 0 ), wper );
ADC = Wilders( Max( Ref( price, -1 ) - price, 0 ), wper );
x = ( wper - 1 )*( ADC * Value/(100-Value)-AUC);
PRSIP = IIf( x >= 0, price + x, price + x*(100-Value)/Value );
return PRSIP;
}
CLG=PRSI(C,100,150);
Plot(PCLG,"",colorBrightGreen,styleThick);
PCS2=PRSI(C,3,3);
psp=Param("psp",5,2,500,1);
PST=(t3(PCS2,psp,1.0));
Plot(pst,"",colorBlue,styleThick);
PCLR=PRSI(C,100,30);
psr=Param("psr",10,2,500,1);
PSRL=(t3(PCLR,psr,0.94));
Plot(psrl,"",colorRed,styleThick);
PCS=PRSI(C,43,50);
PCSW=(pcs+pcs2)/2;
psw=Param("psw",7,2,500,1);
PSWL=(t3(pcsw,psw,0.94));
Plot(pswl,"",colorWhite,styleThick);
LR1=LinearReg(C,23);
Plot(Lr1,"",colorYellow,styleThick+styleNoLabel);
PCLR1=PRSI(C,200,230);
psr1=Param("psr1",7,2,500,1);
PSRL1=(t3(PCLR1,psr1,0.94));
Plot(psrl1,"",colorBlack,styleThick);
bls=BarsSince(Cross(psrl1, H ));
bgs=BarsSince( pslr1 > H );
bus=BarsSince( pst > H );
res=BarsSince( psr1 > H );
whs=BarsSince( pswl > H );
yes=BarsSince( Lr1 > H );
Sellsig=(bls+bgs+bus+res+whs+yes);
blb=BarsSince( psrl1 < H );
bgb=BarsSince( pclg < H );
bub=BarsSince( pst < H );
reb=BarsSince( psr1 < H );
whb=BarsSince( pswl < H );
yeb=BarsSince( Lr1 < H );
Buysig=(blb+bgb+bub+reb+whb+yeb);
Filter=1;
Sell=(Sellsig<30);
PlotShapes(shapeDownArrow*Sell,colorRed);
GraphXSpace=5;
AddColumn(Buysig,"BuySignal");
AddColumn(Sellsig,"SellSignal");
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
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|