Duxx![]() Elite ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 881 Joined: 2/18/2009 ![]() | Hi Im trying to set up a system and an indicator. I want To capture a lower low from prior bar I have the following: L[1] < L[2] and L > L[1] Then, I want to fire a long if the Close is above the high of the lowest low captured above as follows: C > H[1] But the issue is that life is not perfect and the current bar close may not be higher than the high of the lowest low, so I have the following: # Param "NBars",5,1,10 Dim xCount, yCount, zCount As Single if L[1] < L[2] and L > L[1] then xCount = 1 'records the fact that the conditons above have been met end if if xCount = 1 and C > O and C > H[1] then 'sets next test condition yCount = 1 'records the conditions here met else yCount = 0 end if if xCount = 1 then zCount = zCount[1] + 1 'causes a count up of the number of bars passed since the first condition was met 'else If xCount = 0 then 'zCount = 0 end if if yCount = 1 then signal = longsignal End if If zCount = NBars or yCount = 1 then xCount = 0 yCount = 0 zCount = 0 end if But the above does not work precisely as described and Im not sure how to apply the same process for a short (which is the inverse) Any ideas are welcome Thanks [Edited by Duxx on 8/25/2010 10:41 PM] |