Lowest low in 'x' previous bars
Forums › ProRealTime English forum › ProOrder support › Lowest low in 'x' previous bars
- This topic has 8 replies, 4 voices, and was last updated 7 years ago by
Nobody.
-
-
12/23/2017 at 9:24 AM #56412
I am struggling with the correct syntax to represent close higher than lowest low in ‘x ‘ previous bars . Can anyone help me with what i assume to be an easy code to get right ? I have tried for hours to get this and fail at every turn , very frustrating . I have acheived it writing it this way but id like to do this using a single variable so i can optomise easily
1bullish = (Close > Low[1]) OR (Close > Low[2]) OR (Close > Low[3]) OR (Close > Low[4])112/23/2017 at 9:34 AM #5641312/23/2017 at 11:11 AM #5641612/23/2017 at 11:17 AM #5641712/23/2017 at 12:17 PM #56420Try:
1close > lowest[4](low)Thanks that seems to be the answer but im finding PRT very very buggy . I wrote both your code and mine as indicator and PRT displays different ouputs some of the time , Very frustrating .
12/23/2017 at 12:40 PM #56422Correct me if i am wrong but should not
123456Increase = (Close > Low[1]) OR (Close > Low[2]) OR (Close > Low[3]) OR (Close > Low[4])Count = 0WHILE Increase[Count] DOCount = Count + 1WENDRETURN CountReturn same result as
1234567Increase = close > lowest[4](low)Count = 0WHILE Increase[Count] DOCount = Count + 1WENDRETURN CountYet they are nothing like the same , Frustrated as ..
12/23/2017 at 12:48 PM #56423the second indicator count only drops of to zero when the close is at low of current bar not when close is below the lowest low of previous 4 bars , What am i missing here ??? Going crazy here
For some reason the first indicator code listed above compares the close to the previous 4 bars ( which is what i require) whereas the second indicator compares to the previous 3 bars PLUS the Current bar , so its no wonder the count only drops to zero when the close is equal to the low of the bar . HOW do i make the second indicator compare the current bar to the previous 4 and not include current bar ? none of this makes sense
12/23/2017 at 12:53 PM #56424lowest[4](low) would take the lowest of current candle and previous 3 candles, if what you want is lowest low of previous 4 candles not including current one, as per your first post bullish = (Close > Low[1]) OR (Close > Low[2]) OR (Close > Low[3]) OR (Close > Low[4]), then the faster equivalent way to code this is by taking previous candle’s lowest of 4:
1bullish = close>lowest[4](low)[1]2 users thanked author for this post.
12/23/2017 at 1:05 PM #56426lowest[4](low) would take the lowest of current candle and previous 3 candles, if what you want is lowest low of previous 4 candles not including current one, as per your first post bullish = (Close > Low[1]) OR (Close > Low[2]) OR (Close > Low[3]) OR (Close > Low[4]), then the faster equivalent way to code this is by taking previous candle’s lowest of 4:
1bullish = close>lowest[4](low)[1]Thank you very much i was starting to lose my mind . Seriously i spent half a day trying to sort this out myself
-
AuthorPosts
Find exclusive trading pro-tools on