Rank: Advanced Member
Groups: Registered, Registered Users Joined: 3/19/2005(UTC) Posts: 2,995
Was thanked: 14 time(s) in 10 post(s)
|
Hey Roy-
Try something like this. It will need tweaking, I'm sure, but it may be a starting point.
[code:1:13effd0cca]
{ g4_Stochastic Crossover v1.0 }
{ user inputs }
i1:=Input("%K Time Periods",1,20,10);
i2:=Input("%K Slow Periods",1,20,3);
i3:=Input("%D Time Periods",1,20,3);
i4:=Input("Plot: [1]Oscillator, [2]Signals",1,2,1);
{ calculations }
K:=(Sum(C-LLV(L,i1),i2))/(Sum(HHV(H,i1)-LLV(L,i1),i2))*100;
D:=Mov(K,i3,S);
{ signals }
buy:=If(Cross(D,K) AND D<20,1,0);
sell:=If(Cross(D,K) AND D>80,-1,0);
{ plot }
If(i4=1,K,buy);
If(i4=1,D,sell);
If(i4=1,20,0);
If(i4=1,80,0);[/code:1:13effd0cca]
Explorer
[code:1:13effd0cca]Column A [Signal]
K:=(Sum(C-LLV(L,10),3))/(Sum(HHV(H,10)-LLV(L,10),3))*100;
D:=Mov(K,3,S);
If(Cross(D,K) AND D<20,1,
If(Cross(D,K) AND D>80,-1,0))
Filter
ColA<>0
[/code:1:13effd0cca]
|