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

Notification

Icon
Error

Options
Go to last post Go to first unread
henry1224  
#1 Posted : Friday, April 8, 2005 1:12:37 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Plot this indicator in it's own window, change the style to histogram r1:=If(Ref(C,-1)<O,Max(O-Ref(C,-1),H-L),H-L); r2:=If(Ref(C,-1)>O,Max(Ref(C,-1)-O,H-L),H-L); bull:=If(C=O, If(H-C=C-L, If(Ref(C,-1)>O, Max(H-O,C-L), r1), If(H-C>C-L, If(Ref(C,-1)<O, Max(H-Ref(C,-1),C-L), H-O), r1)), If(C<O, If(Ref(C,-1)<O, Max(H-Ref(C,-1),C-L), Max(H-O,C-L)), r1)); bear:=If(C=O, If(H-C=C-L, If(Ref(C,-1)<O, Max(O-L,H-C), r2), If(H-C>C-L, r2, If(Ref(C,-1)>O, Max(Ref(C,-1)-L,H-C), O-L))), If(C<O, r2, If(Ref(C,-1)>O, Max(Ref(C,-1)-L,H-C), Max(O-L,H-C)))); Mov(bull-bear,30,S)
Jose  
#2 Posted : Friday, April 8, 2005 2:11:22 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Same indicator with slightly simplified code & user input: [code:1:49dc8b260a] pds:=Input("Smoothing periods",1,260,30); r1:=Max(O-Ref(C,-1),H-L); r2:=Max(Ref(C,-1)-O,H-L); bull:= If(C=O, If(H-C=C-L,If(Ref(C,-1)>O,Max(H-O,C-L),r1), If(H-C>C-L, If(Ref(C,-1)<O,Max(H-Ref(C,-1),C-L),H-O),r1)), If(C<O,If(Ref(C,-1)<O,Max(H-Ref(C,-1),C-L), Max(H-O,C-L)),r1)); bear:= If(C=O, If(H-C=C-L,If(Ref(C,-1)<O,Max(O-L,H-C),r2), If(H-C>C-L,r2, If(Ref(C,-1)>O,Max(Ref(C,-1)-L,H-C),O-L))), If(C<O,r2, If(Ref(C,-1)>O,Max(Ref(C,-1)-L,H-C), Max(O-L,H-C)))); HenryOsc:=Mov(bull-bear,pds,S); HenryAvg:=Cum(HenryOsc)/Cum(IsDefined(HenryOsc)); HenryAvg;HenryOsc [/code:1:49dc8b260a] jose '-) http://www.metastocktools.com
Users browsing this topic
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.