Recurring Vertical Lines – datetolastbarindex
Forums › ProRealTime English forum › ProBuilder support › Recurring Vertical Lines – datetolastbarindex
- This topic has 23 replies, 2 voices, and was last updated 1 month ago by
inverse.
-
-
So all was going swimmingly until an outage yesterday (ASX Cash timeframe) with PRT and since then we’re now capped to something close to ~30k bars in 1sec int Australia Cash 200., could be lingering outage issues, housekeeping. The DAX30(now 40) however seems worse for wear. Was a rock before then.
It looks to only be affecting 1sec ints. and duplicating another chart from another period, say 5min, will recreate the charts correctly when 1sec is selected however shortly afterwards it redraws to ~30k bars – this is with or w/o the indicator applied.
There you go:
1234defparam drawonlastbaronly = truedrawvline(datetobarindex(20220606110000))Coloured (105,105,105)style(dottedline,1)drawtext("My Text",datetobarindex(20220606110000),high)Coloured (105,105,105)return1 user thanked author for this post.
Hey Rob ….
I must be going sideways on this one, this is what I had below but it was spitting the dummy.
I’ll look closer and see what the go is.
drawtext(“SGX”,datetobarindex(20220606110000))Coloured (105,105,105)style(dottedline,1)
Many thanks for the speedy reply … 🙂
edit: lol, dotted line ref. ….. one of those days. Thanks for setting me straight.
Hi Team,
I’ve put together something with Rob’s help over the journey that’ll plot open times and label them. Many thanks for this.
Been great for the past few weeks till the other day where it started to flag an error, complaining about date format.
I shrunk the days to 1 and it’s still having a problem.
Very much a newb here with this and thanks for your patience with me.
Rgds,
INV
Lines and MTimes123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166defparam drawonlastbaronly=truedefparam calculateonlastbars=100////////Label offsets////voffset=10+closevoffset1=20+closevoffset2=40+close////////Time1 = 070000Time2 = 095000Time3 = 100000Time4 = 110000Time5 = 113000Time6 = 150000Time7 = 160000//////Label Time////////////Time8 = 070000Time9 = 093000Time10 = 101500Time11 = 101500Time12 = 111500Time13 = 115000Time14 = 152000Time15 = 162000Time16 = 162000Time17 = 162500////NumberOfDays = 1Time1 = max(0,min(235959,Time1))Time2 = max(0,min(235959,Time2))Time3 = max(0,min(235959,Time3))Time4 = max(0,min(235959,Time4))Time5 = max(0,min(235959,Time5))Time6 = max(0,min(235959,Time6))Time7 = max(0,min(235959,Time7))//Time9 = max(0,min(235959,Time9))Time10 = max(0,min(235959,Time10))Time11 = max(0,min(235959,Time11))Time12 = max(0,min(235959,Time12))Time13 = max(0,min(235959,Time13))Time14 = max(0,min(235959,Time14))Time15 = max(0,min(235959,Time15))Time16 = max(0,min(235959,Time16))Time17 = max(0,min(235959,Time17))//NumberOfDays = max(0,min(999,NumberOfDays))MyDD = DayMyMM = MonthMyYY = Year//DayCount = NumberOfDaysWhile DayCount > 0 DO//// make sure it’s the same number of digits for days < 10If MyDD < 10 ThenMyDate = (MyYY * 10000) + (MyMM * 1000) + MyDDElseMyDate = (MyYY * 10000) + (MyMM * 100) + MyDDEndif// last step, add hoursa = (MyDate * 1000000) + Time1b = (MyDate * 1000000) + Time2c = (MyDate * 1000000) + Time3d = (MyDate * 1000000) + Time4e = (MyDate * 1000000) + Time5f = (MyDate * 1000000) + Time6g = (MyDate * 1000000) + Time7//// plot the lines//drawvline(datetobarindex(a))Coloured (105,105,105)style(dottedline,1)drawvline(datetobarindex(b))Coloured (105,105,105)style(dottedline,1)drawvline(datetobarindex(c))Coloured (105,105,105)style(dottedline,1)drawvline(datetobarindex(d))Coloured (105,105,105)style(dottedline,1)drawvline(datetobarindex(e))Coloured (105,105,105)style(dottedline,1)drawvline(datetobarindex(f))Coloured (105,105,105)style(dottedline,1)drawvline(datetobarindex(g))Coloured (105,105,105)style(dottedline,1)//////// draw the lables in - removed//////x = (MyDate * 1000000) + Time9//i = (MyDate * 1000000) + Time10//j = (MyDate * 1000000) + Time11//k = (MyDate * 1000000) + Time12//l = (MyDate * 1000000) + Time13//m = (MyDate * 1000000) + Time14//n = (MyDate * 1000000) + Time15//o = (MyDate * 1000000) + Time16//p = (MyDate * 1000000) + Time17////////drawtext("SPI",datetobarindex(x),voffset1,SansSerif,standard,14)Coloured (000,100,000)//drawtext("TSE",datetobarindex(i),voffset,SansSerif,standard,14)Coloured (000,100,000)//drawtext("ASX",datetobarindex(j),voffset1,SansSerif,standard,14)Coloured (000,100,000)//drawtext("SGX",datetobarindex(k),voffset,SansSerif,standard,14)Coloured (000,100,000)//drawtext("SSE",datetobarindex(l),voffset,SansSerif,standard,14)Coloured (000,100,000)//drawtext("SSE",datetobarindex(m),voffset,SansSerif,standard,14)Coloured (000,100,000)//drawtext("FDAX",datetobarindex(n),voffset,SansSerif,standard,14)Coloured (000,100,000)//drawtext("FTEU",datetobarindex(o),voffset1,SansSerif,standard,14)Coloured (000,100,000)//drawtext("ASXCL",datetobarindex(p),voffset2,SansSerif,standard,14)Coloured (000,100,000)//////// get ready to build tomorrow’s date, if needed//// compute tomorrow’s date (could be a new month, even a new year)//// 1. compute the last day of the monthLastDay = 31// 2. it’s max 30 on a few monthsIf MyMM = 4 or MyMM = 6 or MyMM = 9 or MyMM = 11 ThenLastDay = 30Endif// 3. it’s max 28 days in February, 29 on a leap yearIf MyMM = 2 ThenLastDay = 28If Year MOD 4 = 0 ThenIf Year MOD 100 = 0 ThenIf Year MOD 400 = 0 ThenLastDay = 29EndifElseLastDay = 29EndifEndifEndif//MyDD = MyDD + 1// 4. if it’s greater than LastDay it’s the next monthIf MyDD > LastDay ThenMyDD = 1MyMM = MyMM + 1// 5. if it’s greater than 12 it’s a new yearIf MyMM > 12 ThenMyMM = MyMM - 12MyYY = MyYY + 1EndifEndif//DayCount = DayCount - 1 //one day has been plottedWendRETURNResolved maybe.12345678910111213141516171819//now working// make sure it’s the same number of digits for days < 10 (as per Robs layout)If MyDD < 0 ThenMyDate = (MyYY * 10000) + (MyMM * 1000) + MyDDElseMyDate = (MyYY * 10000) + (MyMM * 100) + MyDDEndifvs//non-working but was// make sure it’s the same number of digits for days < 10If MyDD < 10 ThenMyDate = (MyYY * 10000) + (MyMM * 1000) + MyDDElseMyDate = (MyYY * 10000) + (MyMM * 100) + MyDDEndifNot sure what happened here tbh, will have a closer look but this is usually set and forget.
Even backups confirm it was <10, so,
<10
went
<0
for a fix?
Really confused atmo .. lol
Will see how the day rolls up.
-
AuthorPosts
Find exclusive trading pro-tools on