Vertical Line in every 10days!
Forums › ProRealTime English forum › ProBuilder support › Vertical Line in every 10days!
- This topic has 9 replies, 3 voices, and was last updated 5 years ago by Vonasi.
-
-
12/16/2019 at 11:38 PM #115016
Hi All.
I have managed to code a vertical line to be appear in every 5days.. but is there a way to make this appear in every 10 days. also on the code the 10 DAYS text to be on top or the bottom of the chart. any help would be much appreciated!
Thank you in advance
Vertical line to be appear in every 10 days123456789//DayOfWeek = 1 //0=NO DayOfWeek 1=YES DayOfWeekif DayOfWeek = 1 thenif Time = 010000 thenatr=averagetruerange[14]drawtext("10DAYS",barindex+9,low-atr)coloured(112,169,161)DRAWVLINE(barindex)coloured(112,169,161)endifendifreturn12/16/2019 at 11:48 PM #115017Not tested:
123456789101112if DayOfWeek = 1 and Time = 010000 thenif not flag thenatr=averagetruerange[14]drawtext("10DAYS",barindex+9,low-atr)coloured(112,169,161)DRAWVLINE(barindex)coloured(112,169,161)flag = 1elseflag = 0endifendifreturn1 user thanked author for this post.
12/16/2019 at 11:52 PM #115018As for top and bottom of chart there is no defined top or bottom of chart as you cannot know what the maximum and minimum displayed price is to use in an indicator. It would be a nice addition to PRT to be able to retrieve a value for this as you zoom in and out but at the moment it is not possible.
1 user thanked author for this post.
12/18/2019 at 10:10 AM #115138Thanks very much @vonasi it works fine! 🙂
i have tried to add a boolean so i can make it appear when ever i want.. but it doesn’t seems be working, what am i doing wrong?adding boolean?12345678910111213//DayOfWeek = 1 //0=NO DayOfWeek 1=YES DayOfWeekif DayOfWeek = 1 and Time = 010000 thenif not flag thenatr=averagetruerange[14]drawtext("10DAYS",barindex+9,low-atr)coloured(112,169,161)DRAWVLINE(barindex)coloured(112,169,161)flag = 1elseflag = 0endifendifreturn12/18/2019 at 11:55 AM #115153It seems to be working fine. I tested it on DAX 4h.
12/18/2019 at 1:36 PM #115163Your Boolean is a PRT code word and returns the day of week. When you say IF DAYOFWEEK = 1 then it is checking to see that it is a Monday.
You could try this with an ONOFF boolean (not tested):
12345678910111213141516//OnOff = 1 //0 = Display Off 1 = Display OnIf OnOff thenif DayOfWeek = 1 and Time = 010000 thenif not flag thenatr=averagetruerange[14]drawtext("10DAYS",barindex+9,low-atr)coloured(112,169,161)DRAWVLINE(barindex)coloured(112,169,161)flag = 1elseflag = 0endifendifendifreturn1 user thanked author for this post.
12/18/2019 at 2:07 PM #115171Sorry, I misunderstood your question.
12/19/2019 at 2:53 PM #115250Thank you @Vonasi and @robertogozzi
Just noticed its has changed and it calculates from 9th DEC Monday instead of calculating 16th DEC monday??12/19/2019 at 3:05 PM #115253why is this not calculationg from 16th monday.. to 10day period?
12/19/2019 at 5:09 PM #115259The indicator will start at the left of your chart and look for the first Monday and draw a line there. If time has passed by and your chart only shows 100k bars then the first Monday on the left of the chart will have changed and the line will be drawn on a different set of Mondays to that that it was previously drawn on. This is always going to be an issue when using weird time frames such as 10 days.
A long time ago we were all discussing a strategy based on 26 seconds and everyone was not surprisingly getting different results depending upon which second they started the strategy on!
-
AuthorPosts
Find exclusive trading pro-tools on