Remove inside bars from calculations
Forums › ProRealTime English forum › ProBuilder support › Remove inside bars from calculations
- This topic has 5 replies, 2 voices, and was last updated 3 years ago by
blackwing.
-
-
12/01/2022 at 4:03 PM #205130
Hi,
Is there a way to remove all the inside bars, so that the code ignores them in its calculations? So for example I am looking for a directional bar down (Low> Low[1]) , (High < High[1]) ,relative to the previous bar that is not an inside bar.
I would still like to display all the bars as normal on the chart.
Many thanks in advance.
12/01/2022 at 4:25 PM #20513112/01/2022 at 5:14 PM #205133Is this what you mean?
1234567891011InsideBAR = 0IF (high <= high[1]) AND (low >= low[1]) THENInsideBAR = 1ENDIFSignal = 0IF Not InsideBAR THENIF (low < low[1]) AND (high < high[1]) THENSignal = 1ENDIFENDIFRETURN Signal AS "My Pattern"1 user thanked author for this post.
12/02/2022 at 2:56 PM #205184Not quite. Unless I have misunderstood how to use your code.
I am working on an indicator that requires inside bars (or multiple inside bars) to be ignored completely. The problem comes when a bar down comes after an inside bar but itself is an inside bar to a previous larger bar.
I am looking to find a low bar relative to the previous bar that is not an inside bar. I thought if I removed all inside bars from the calculations then the (Low<Low[1]) and (High< High[1]) would work correctly based on the remaining bars.
Pic attached
12/04/2022 at 11:29 AM #205233This modified version tracks an InsideBAR until any of its limits are broken, thus preventing signals from being returned:
12345678910111213141516171819202122ONCE InsideBAR = 0ONCE InsideHH = 0ONCE InsideLL = 0IF InsideBAR THENIF (high > InsideHH) OR (low < InsideLL) THENInsideBAR = 0InsideHH = 0InsideLL = 0ENDIFENDIFIF ((high <= high[1]) AND (low >= low[1])) AND Not InsideBAR THENInsideBAR = 1InsideHH = high[1]InsideLL = low[1]ENDIFSignal = 0IF Not InsideBAR THENIF (low < low[1]) AND (high < high[1]) THENSignal = 1ENDIFENDIFRETURN Signal AS "My Pattern"1 user thanked author for this post.
12/05/2022 at 7:45 PM #205295 -
AuthorPosts
Find exclusive trading pro-tools on