logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
royttm  
#1 Posted : Tuesday, March 28, 2006 4:36:56 AM(UTC)
royttm

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 3/27/2006(UTC)
Posts: 41
Location: Singapore

Nice Day to All, I'm not familiar with formula writing for Explorer. What I need is in deriving a formula for [color=blue:95b6dc52d7]Stochastic 10, 3[/color] with 1) %D JUST cross over %K below the 20% level for bullish reversal; and 2) %D JUST cross over %K above 80% level for bearish reversal. Appreciate if anyone can help or refer me to any posting in the past? Thank You.
StorkBite  
#2 Posted : Tuesday, March 28, 2006 11:17:19 AM(UTC)
StorkBite

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]
royttm  
#3 Posted : Tuesday, March 28, 2006 3:09:35 PM(UTC)
royttm

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 3/27/2006(UTC)
Posts: 41
Location: Singapore

Hi q stockman, That was fast and thank you very much for the formula. I apply the code using the lower block for the explorer and ....well, it works marvelously. Out of curiosity, what's the code in the first block for? Thank you once again and hope you have a great day ahead.
StorkBite  
#4 Posted : Tuesday, March 28, 2006 4:12:13 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Glad it worked for you. The first code is for use as an indicator to plot the signals directly on your chart. Cya of the forum, G
royttm  
#5 Posted : Wednesday, March 29, 2006 3:03:43 AM(UTC)
royttm

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 3/27/2006(UTC)
Posts: 41
Location: Singapore

Thanks.
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.