Error

 Previous Topic Next Topic
 ketal #1 Posted : Thursday, July 17, 2014 11:26:49 PM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 3/7/2014(UTC)Posts: 17Thanks: 6 times Hi,Request to please help with the code for the following condition:-I want to highlight the bar whose range (high to low) has engulfed either the close OR the open of next 4 bars. Kindly help with the code. Regards,K
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 MS Support #2 Posted : Friday, July 18, 2014 1:36:49 PM(UTC) Rank: Advanced MemberGroups: Moderators, Registered, Registered Users, SubscribersJoined: 10/8/2010(UTC)Posts: 1,953Thanks: 91 timesWas thanked: 155 time(s) in 150 post(s) ketal wrote:Hi,Request to please help with the code for the following condition:-I want to highlight the bar whose range (high to low) has engulfed either the close OR the open of next 4 bars. Kindly help with the code. Regards,KThere's probably simpler ways to write this but you could try:X:=Ref(H,-4);Y:=Ref(L,-4);Z:=((C < X AND C > Y) OR (O < X AND O > Y)) AND ((Ref(C,-1) < X AND Ref(C,-1) > Y) OR (Ref(O,-1) < X AND Ref(O,-1) > Y)) AND ((Ref(C,-2) < X AND Ref(C,-2) > Y) OR (Ref(O,-2) < X AND Ref(O,-2) > Y)) AND ((Ref(C,-3) < X AND Ref(C,-3) > Y) OR (Ref(O,-3) < X AND Ref(O,-3) > Y));Ref(Z,4)
 ketal #3 Posted : Saturday, July 19, 2014 2:11:56 AM(UTC) Rank: MemberGroups: Registered, Registered Users, Unverified UsersJoined: 3/7/2014(UTC)Posts: 17Thanks: 6 times MS Support wrote:ketal wrote:Hi,Request to please help with the code for the following condition:-I want to highlight the bar whose range (high to low) has engulfed either the close OR the open of next 4 bars. Kindly help with the code. Regards,KThere's probably simpler ways to write this but you could try:X:=Ref(H,-4);Y:=Ref(L,-4);Z:=((C < X AND C > Y) OR (O < X AND O > Y)) AND ((Ref(C,-1) < X AND Ref(C,-1) > Y) OR (Ref(O,-1) < X AND Ref(O,-1) > Y)) AND ((Ref(C,-2) < X AND Ref(C,-2) > Y) OR (Ref(O,-2) < X AND Ref(O,-2) > Y)) AND ((Ref(C,-3) < X AND Ref(C,-3) > Y) OR (Ref(O,-3) < X AND Ref(O,-3) > Y));Ref(Z,4)Hi,Thanks, it worked well.Regards,K
 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.