Registered User Joined: 1/26/2005 Posts: 6 
	 | 
	
		I've tried to write and Indicator, which I can't get to work: 
 
'#Period=userinput.Integer=14 
Static X as Single 
Static Y as SIngle 
Dim Y1 as Single 
Dim Yad As Single 
Static Z as Single 
Static Z1 as Single 
If CurrentIndex>Period Then 
X=(Price.High+Price.Low+Price.Close)/3 
Y=X-X.AVG(period) 
Y1=System.Math.Abs(Y) 
Yad=Y1.Avg(period) 
End If 
If Yad>0 Then 
Z=Y/Yad 
Z1=(Z/3)*200 
Else 
Plot=Z1 
End If 
 
Error 
"AVG" is not a member of Single. 
I would appreciate your help correcting this code to run as a realcode indicator.
	 |