barssince
Posted: Sat Sep 13, 2014 8:21 am
Chris,
first let me say that the new upgrades to edgerater are fantastic!
I am trying to make a scan that returns stocks that:
price has been above the EMA17 for 20 days
price has been above the EMA50 for 10 days
price has been above the EMA200 for 90 days
price is within 10% of the 52 wk high
This is what I have so far:
Sig1:= if(C<EMA(C,17),1,0);
count1:=BARSSINCE(Sig1)-1;
Sig2:= if(C<EMA(C,50),1,0);
count2:=BARSSINCE(Sig2)-1;
Sig3:= if(C<EMA(C,200),1,0);
count3:= BARSSINCE(Sig2)-1;
hv:=(HHV(C, 200)== C);
flg1:count1>=20;
flg2:=count2>=10;
flg3:=count3>=90;
flg4:=C>hv-(hv*.1);
event:=flg1 & flg2 & flg3 & flg4;
I don“t understand the barssince command. Unless I put -1 the function always returns a value of 1. It seems that Sig1 is true as long as 20 bars ago the price was above EMA17 and the current bars is too.
The 52wk high never seems to fire true.
- John
first let me say that the new upgrades to edgerater are fantastic!
I am trying to make a scan that returns stocks that:
price has been above the EMA17 for 20 days
price has been above the EMA50 for 10 days
price has been above the EMA200 for 90 days
price is within 10% of the 52 wk high
This is what I have so far:
Sig1:= if(C<EMA(C,17),1,0);
count1:=BARSSINCE(Sig1)-1;
Sig2:= if(C<EMA(C,50),1,0);
count2:=BARSSINCE(Sig2)-1;
Sig3:= if(C<EMA(C,200),1,0);
count3:= BARSSINCE(Sig2)-1;
hv:=(HHV(C, 200)== C);
flg1:count1>=20;
flg2:=count2>=10;
flg3:=count3>=90;
flg4:=C>hv-(hv*.1);
event:=flg1 & flg2 & flg3 & flg4;
I don“t understand the barssince command. Unless I put -1 the function always returns a value of 1. It seems that Sig1 is true as long as 20 bars ago the price was above EMA17 and the current bars is too.
The 52wk high never seems to fire true.
- John