Error

 Previous Topic Next Topic
 stinkray #1 Posted : Thursday, August 4, 2016 6:53:24 AM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 9/4/2012(UTC)Posts: 12Thanks: 4 times If(C>Mov(C,200,S),BarsSince(Cross(C,Mov(C,200,S))),0) The above formula counts the number of  periods  since closing price crosses above 200 SMA. How should I change the formula to show the number of periods since closing price crosses below 200 SMA.   Appreciate help. Thanks
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 mstt #2 Posted : Thursday, August 4, 2016 9:00:04 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 7/25/2005(UTC)Posts: 1,042Was thanked: 57 time(s) in 54 post(s) Hi stinkray The changes you need are quite simple - change the "Greater Than" symbol, >, to a "Less Than" symbol, <, and then reverse the two parameters inside the Cross() function. Here's the formula. If(C
 stinkray #3 Posted : Thursday, August 4, 2016 5:08:31 PM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 9/4/2012(UTC)Posts: 12Thanks: 4 times Hi Roy Thank you very much for your help. Stinkray
 stinkray #4 Posted : Friday, August 5, 2016 2:47:53 PM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 9/4/2012(UTC)Posts: 12Thanks: 4 times Hi Roy If(C
 mstt #5 Posted : Friday, August 5, 2016 9:34:07 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 7/25/2005(UTC)Posts: 1,042Was thanked: 57 time(s) in 54 post(s) Hi stinkray I don't see what the problem is. Can you shed a little more light on the situation? Roy
 stinkray #6 Posted : Saturday, August 6, 2016 5:13:48 PM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 9/4/2012(UTC)Posts: 12Thanks: 4 times Hi Roy No problem to If(C
 mstt #7 Posted : Sunday, August 7, 2016 12:20:24 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 7/25/2005(UTC)Posts: 1,042Was thanked: 57 time(s) in 54 post(s) Hi Stinkray Adding 1 at either end of the BarsSince() function works for all except the first Cross() event and the first valid bar. Hope this helps. This not perfect but check it out. If(C>Mov(C,200,S),1+BarsSince(Cross(C,Mov(C,200,S))),0); If(C
 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.