Wrong representation in the 5 minute chart
Forums › ProRealTime English forum › ProBuilder support › Wrong representation in the 5 minute chart
- This topic has 10 replies, 2 voices, and was last updated 5 years ago by Razz.
-
-
08/08/2019 at 8:58 AM #104382
Good day
Can someone please help me, I have created this indicator which draws various Open and Close courses in the chart. Unfortunately, it does not work today with the closing price of the previous week on 5 minutes basis at 15 minutes, everything is displayed correctly. But I need the indicator in the 5 and 10 minute chart windows.
Many thanks in advance
1234567891011121314151617181920212223242526272829303132333435defparam drawonlastbaronly=trueIF TIME>= 008000 AND TIME<= 220000 THENif opentime=080000 or (opentime[1] < 080000 and opentime > 080000) thenmyopen0800=openendifif opentime=090000 or (opentime[1] < 090000 and opentime > 090000) thenmyopen0900=openendifif time >174000 and time <=174500 thenmyclose1745=closeendifif time >215000 and time <=220000 thenmyclose2200=closeendifendif// Close 2200 Vorwocheif DayofWeek=5 thenif time>090000 and time <=220000 thenmyclose2200Week=closeendifendifdrawtext(” open0800″,barindex,myopen0800,Dialog,Standard,12)coloured(100,149,237)drawtext(” open 0900″,barindex,myopen0900,Dialog,Standard,12)coloured(100,149,237)drawtext(” close 1745″,barindex,myclose1745,Dialog,Standard,12)coloured(24,116,205)drawtext(” close 2200″,barindex,myclose2200,Dialog,Standard,12)coloured(24,116,205)drawtext(” close Week 2200″,barindex,myclose2200Week-3,Dialog,Standard,12)coloured(24,116,205)return myopen0800 as “open0800″,myopen0900 as”open0900″,myclose1745 as”close1745”,myclose2200 as “close2200″,myclose2200Week as”close Vorwoche 2200”08/08/2019 at 9:06 AM #104387For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text from the code part. I tidied it up for you.
Thank you!
08/08/2019 at 9:09 AM #10438808/08/2019 at 9:26 AM #104391At lines 12 and 16, only a 5-minute (or lower) TF can be used!
08/08/2019 at 9:51 AM #10439408/08/2019 at 10:45 AM #104400This is the code I tested, it looks good on 1-minute, 5-minute and 15-minute TF’s, while it reports 0 at 1745 on a 10-minute TF:
12345678910111213141516171819202122232425262728293031323334defparam drawonlastbaronly=trueIF TIME>= 008000 AND TIME<= 220000 THENif opentime=080000 or (opentime[1] < 080000 and opentime > 080000) thenmyopen0800=openendifif opentime=090000 or (opentime[1] < 090000 and opentime > 090000) thenmyopen0900=openendifif time >174000 and time <=174500 thenmyclose1745=closeendifif time >215000 and time <=220000 thenmyclose2200=closeendifendif// Close 2200 Vorwocheif DayofWeek=5 thenif time>090000 and time <=220000 thenmyclose2200Week=closeendifendifdrawtext(" open0800",barindex,myopen0800,Dialog,Standard,12)coloured(100,149,237)drawtext(" open 0900",barindex,myopen0900,Dialog,Standard,12)coloured(100,149,237)drawtext(" close 1745",barindex,myclose1745,Dialog,Standard,12)coloured(24,116,205)drawtext(" close 2200",barindex,myclose2200,Dialog,Standard,12)coloured(24,116,205)drawtext(" close Week 2200",barindex,myclose2200Week-3,Dialog,Standard,12)coloured(24,116,205)return myopen0800 as "open0800",myopen0900 as"open0900",myclose1745 as"close1745",myclose2200 as "close2200",myclose2200Week as"close Vorwoche 2200"08/08/2019 at 10:47 AM #104402I think you are displaying too little units, try increasing them, a week is made of many 5-minute bars!
08/08/2019 at 11:02 AM #104405Strange with me he only looks good on 15 minutes TF at the other, the closing price 22:00 last week is set to 0. The indicator ran with me until Tuesday on 1-5 minutes well. Have no explanation for why it is displayed correctly and not with me?
08/08/2019 at 11:12 AM #10440708/08/2019 at 12:06 PM #104409It looks good, of course the offset (-3) is a greater distance on a 1 -minute chart rather than on a 15-minute chart.
Instead of a fixed value you could use a percentage of ATR to make it variable.
08/08/2019 at 1:27 PM #104415The offset -3 was only used because Monday would otherwise be written on the previous day and last week’s close because the value is the same. Thanks for your help ! My initial problem was solved by increasing the units, now use 2500 units in the 5 minute chart and zoom into the chart with the magnifying glass function.
Have a nice day.
Peter -
AuthorPosts
Find exclusive trading pro-tools on