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

Notification

Icon
Error

Options
Go to last post Go to first unread
jassieotal  
#1 Posted : Tuesday, September 13, 2016 3:39:00 AM(UTC)
jassieotal

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 9/11/2016(UTC)
Posts: 4

Thanks: 2 times

I am new here and learning to code. Can someone help in creating an exploration where the CLOSE crossed the LAST PEAK inside the Bollinger Bands? Also current CLOSE needs to be above the center of the Bollinger Band.  I am trying as below..

pbrs :=PeakBars(1,CLOSE,3);

 

CLOSE>Mov(CLOSE, 20,S)
AND
Cross(CLOSE,Peak(1,CLOSE,3))
AND
REF(CLOSE,-pbrs) < Ref(BBandTop(C, 20, S, 2),-pbrs)

Thanks

MS Support  
#2 Posted : Wednesday, September 14, 2016 5:42:13 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Hi, You might want to try using LastValue to work around the use of constants issue, i.e. pbrs:=LastValue(PeakBars(1,CLOSE,3)); CLOSE>Mov(CLOSE, 20,S) AND Cross(CLOSE,Peak(1,CLOSE,3)) AND Ref(CLOSE,-pbrs) < Ref(BBandTop(C,20,S,2),-pbrs) There can be limitations with this, including the fact that the chart must be refreshed for the indicator to update (limiting its usefulness with realtime data, although that may be less an issue since you want to use it as an exploration). Some indicators can use the PREV function (+PREV-PREV) to work around some of these limitations, but you might want to experiment with the modified formula above to see if it works for you.
thanks 1 user thanked MS Support for this useful post.
jassieotal on 9/15/2016(UTC)
jassieotal  
#3 Posted : Thursday, September 15, 2016 2:26:35 AM(UTC)
jassieotal

Rank: Newbie

Groups: Registered Users, Subscribers
Joined: 9/11/2016(UTC)
Posts: 4

Thanks: 2 times

Awesome! Thanks for helping out.

It WORKS!

 

Users browsing this topic
Guest (Hidden)
Similar Topics
Metastock Exploration - Engulfing Pattern (Formula Assistance)
by jassieotal 11/13/2016 5:03:39 AM(UTC)
Metastock Exploration Code (Formula Assistance)
by gorachand 10/31/2013 7:24:43 AM(UTC)
Double Bottom Metastock Exploration Formula (Formula Assistance)
by gorachand 2/19/2012 10:05:45 AM(UTC)
Faster Metastock Explorations needed (Product Wish List)
by cpgrant 12/18/2005 8:52:21 PM(UTC)
metastock exploration weekend [RESOLVED] (Formula Assistance)
by saham 10/20/2005 10:20:58 PM(UTC)
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.