Have to make two indicators name WRO  and WSO as below.
 Any improvements to the below formulas like removing the Prev functions etc.
 would be appreciated.
 

 

{WRO}
R1:=If(Ref(HIGH,-4)=HHV(HIGH,9),Ref(HIGH,-4),PREVIOUS); 
R2:=If(R1=Ref(R1,-1),PREVIOUS,Ref(R1,-1)); 
R3:=If(R1=Ref(R1,-1),PREVIOUS,Ref(R2,-1)); 
R4:=If(R1=Ref(R1,-1),PREVIOUS,Ref(R3,-1)); 
R5:=If(R1=Ref(R1,-1),PREVIOUS,Ref(R4,-1)); 
R6:=If(R1=Ref(R1,-1),PREVIOUS,Ref(R5,-1)); 
WRO:=100*(1-(Int(R1/CLOSE) + Int(R2/CLOSE) + 
Int(R3/CLOSE) + Int(R4/CLOSE) + 
Int(R5/CLOSE) + Int(R6/CLOSE))/6); 
WRO; 
{WSO} 
S1:=If(Ref(LOW,-4)=LLV(LOW,9),Ref(LOW,-4),PREVIOUS); 
S2:=If(S1=Ref(S1,-1),PREVIOUS,Ref(S1,-1)); 
S3:=If(S1=Ref(S1,-1),PREVIOUS,Ref(S2,-1)); 
S4:=If(S1=Ref(S1,-1),PREVIOUS,Ref(S3,-1)); 
S5:=If(S1=Ref(S1,-1),PREVIOUS,Ref(S4,-1)); 
S6:=If(S1=Ref(S1,-1),PREVIOUS,Ref(S5,-1)); 
WSO:=100*(1 - (Int(S1/CLOSE) + Int(S2/CLOSE) + 
Int(S3/CLOSE) + Int(S4/CLOSE) + 
Int(S5/CLOSE) + Int(S6/CLOSE))/6); 
WSO ;
 
Long Entry: 
Fml("WSO") >Mov(Fml("WSO"),4,S) OR Mov( Fml("C_WRO"),30,S)>95; 
Long Exit: 
No Exit formula. 
Breakeven stop: 
Floor level at 2% 
Trailing stop: 
Profit risk of 10 Percent, ignoring 10 periods 
Maximum loss stop: Maximum loss of 7%. 
 

 Mov(Fml("WRO"),4,E);Mov(Mov(Fml("WRO"),4,E),4,E);

 Mov(Fml("WSO"),30,E);Mov(Mov(Fml("WSO"),30,E),30,E);
 


 


Reply via email to