Intraday NR 7
Forums › ProRealTime English forum › ProBuilder support › Intraday NR 7
- This topic has 8 replies, 5 voices, and was last updated 6 years ago by TB2.
Tagged: candlesticks pattern, NR7, pattern
-
-
09/28/2018 at 11:17 AM #81528
Not sure if I am posting the following question in the correct area, but here goes.
I have a simple Probuilder Indicator that highlights and paints NR7 bar(s) on Intraday time frames, i.e. 5 minute 10,30, etc. However, my problem comes that by default every opening bar will be NR7 and this causes the bar to print in the NR7 colour chosen say “Pink” but as the bar[0] completes and the range is not going to be a NR7 I am left with a two toned colour bar(s) say pink and green in the event of a higher close to the open . How can I force the indicator to only consider completed bars i.e ignore High – Low [0] bar.
See code below
12345678REM Narrow Range Bar Intraday Time Frame(x)NR =High-LowREM NR7NRB = LOWEST[7](NR)IF NRB=NR THENDRAWCANDLE(open, high, low, close) coloured (255,102,255)ENDIFRETURNAny help would be appreciated.
09/28/2018 at 12:51 PM #8153909/28/2018 at 1:56 PM #81545To refer to a closed bar, you should use offset of your variables:
12345678REM Narrow Range Bar Intraday Time Frame(x)NR =High-LowREM NR7NRB = LOWEST[7](NR)IF NRB[1]=NR[1] THENDRAWCANDLE(open, high, low, close) coloured (255,102,255)ENDIFRETURNNot tested, but it should only paint Closed bars that met the NR7 pattern.
09/28/2018 at 2:33 PM #81548Im not sure if i understand it right. But try this one. Im far away from good on this but maybe it wil fix yur problem? 🙂
12345678910REM Narrow Range Bar Intraday Time Frame(x)NR =High-LowREM NR7NRB = LOWEST[7](NR)For i= 8 downto 1 doIF NRB=NR THENDRAWCANDLE(open, high, low, close) coloured (255,102,255)ENDIFnextRETURN1 user thanked author for this post.
09/28/2018 at 3:03 PM #81550Good try @Lind3berg! But you forgot to refer to the right candlestick in your loop 🙂
12345678910REM Narrow Range Bar Intraday Time Frame(x)NR =High-LowREM NR7NRB = LOWEST[7](NR)For i= 8 downto 1 doIF NRB[i]=NR[i] THENDRAWCANDLE(open, high, low, close) coloured (255,102,255)ENDIFnextRETURNBut this code should also not work because DRAWCANDLE can’t plot candle in the past, you could have used an arrow for example:
12345678910REM Narrow Range Bar Intraday Time Frame(x)NR =High-LowREM NR7NRB = LOWEST[7](NR)For i= 8 downto 1 doIF NRB[i]=NR[i] THENDRAWARROW(barindex[i],low[i])coloured (255,102,255)ENDIFnextRETURNBTW, none of these codes posted here have been tested by me, so I don’t know if it fulfilled the initial query of the post ❓
09/28/2018 at 3:20 PM #8155109/28/2018 at 3:56 PM #81557This can do the trick, just paint the standard colours if not NR7:
1234567891011121314DEFPARAM CalculateOnLastBars = 500NR =High-LowREM NR7NRB = LOWEST[7](NR)IF NRB=NR THENDRAWCANDLE(open, high, low, close) coloured (255,102,255)ELSEif open > close thenDRAWCANDLE(open, high, low, close) coloured (0,0,255) //BLUEelseDRAWCANDLE(open, high, low, close) coloured (255,0,0) //REDendifENDIFRETURNMoreover, why do the math (NR=high-low) when you can let PRT do it with RANGE?
09/28/2018 at 4:00 PM #81558Sorry, just invert colours!
10/01/2018 at 9:45 PM #81704Thanks for your input Nicolas, unfortunately “IF NRB[1]=NR[1] THEN” seems to highlight both NR7 and non NR7 bars. I tried something similar by including NR =High[1]–Low[1] as a sort of look back once Bar [0] started to print before posting my question resulting in the same mixed result. However, using the “DrawArrowDown” command works without any issues. So for the moment I will keep with this option until I can try out robertogozzi suggestion.
Thanks again for reaching out.
Regards
TB2
-
AuthorPosts