Seasonality curve not working
Forums › ProRealTime English forum › ProBuilder support › Seasonality curve not working
- This topic has 7 replies, 3 voices, and was last updated 3 years ago by snucke.
-
-
06/28/2021 at 6:50 PM #172677
The seasonality curve built by Vonasi is not working anymore https://www.prorealcode.com/prorealtime-indicators/seasonality-curve/
on some instruments it only plots one or two months and on most of them notihing..
it worked fine a couple of months ago and all of a sudden it stoped working.
my only guess is that a command or something used in the code has changed from prorealtime in a update?
is anyone able to spot the error?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108//Seasonality Curve//By Vonasi//Date: 20200326defparam drawonlastbaronly = true//StartDate = 19950101 //Set to zero to analyse all of history//EndDate = 20200101 //Set to zero to analyse all of history//HighAndLow = 1 //switch on and off drawing of high and low points//Percentage = 1 //switch on or off calcualtion based on percentage of priceif enddate <= 0 or enddate < startdate thenenddate = 99999999endifif barindex > 0 and opendate >= startdate and opendate <= enddate thenif percentage thendiff = (((close - close[1])/close[1])*100)elsediff = close - close[1]endifmydate = date - (floor(date/10000)*10000)$total[mydate] = $total[mydate] + diffendifif islastbarupdate thenif barindex > 365 thenmymonth = 100myday = 1thisdate = mymonth + mydaylastsegment = 0drawtext("Jan",barindex - 365,0,SansSerif,Bold,12)coloured(0,0,255)a = 365for b = 1 to 365mybar = barindex - aif isset($total[thisdate]) thendrawsegment(mybar,lastsegment,mybar+1,lastsegment + $total[thisdate])lastsegment = lastsegment + $total[thisdate]a = a - 1endifif myday = 31 thenmymonth = mymonth + 100myday = 0if mymonth = 200 thendrawtext("Feb",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 300 thendrawtext("Mar",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 400 thendrawtext("Apr",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 500 thendrawtext("May",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 600 thendrawtext("Jun",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 700 thendrawtext("Jul",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 800 thendrawtext("Aug",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 900 thendrawtext("Sep",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 1000 thendrawtext("Oct",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 1100 thendrawtext("Nov",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifif mymonth = 1200 thendrawtext("Dec",mybar,lastsegment - $total[thisdate],SansSerif,Bold,12)coloured(0,0,255)endifendifmyday = myday + 1thisdate = mymonth + mydaymymax = max(lastsegment,mymax)once mymin = lastsegmentonce mymax = lastsegmentmymin = min(lastsegment,mymin)if mymax = lastsegment thenmaxval = lastsegmentmaxbar = mybarendifif mymin = lastsegment thenminval = lastsegmentminbar = mybarendifnextif HighAndLow thendrawpoint(maxbar+1,maxval,3)coloured(128,0,0)drawpoint(minbar+1,minval,3)coloured(0,128,0)endifendifendifreturn mymax coloured(0,0,0,0), mymin coloured(0,0,0,0)08/13/2021 at 11:02 AM #175229robertogozzi or Nicolas have any idea how to solve this?
since Vonasi did not have the time to take a look at this maybe you guys have an idea? 🙂
08/14/2021 at 10:19 AM #175298I added the indicator to my chart and it actually works differently and does not plot data for NOV and DEC.
It’s more difficult for me to modify an exixting code, so I will try to make a new one as soon as I have some time.08/14/2021 at 1:26 PM #17533208/14/2021 at 1:48 PM #175337To prevent undefined values messing up calculations, you can replace line 25:
1$total[mydate] = $total[mydate] + diffwith:
12345if mydate>LastSet($total) then$total[mydate] = diffelse$total[mydate] = $total[mydate] + diffendif08/15/2021 at 2:53 PM #17539008/15/2021 at 3:08 PM #175392Hi, ok, it did when I tried it, so I guess there’s more there’s another problem too not always appearing. Could you please give the details of the case still not working for you (asset, timeframe daily? dates used, values for each of the 4 settings, screen capture) so that we try to replicate the same case and find the next issue from there? Thanks
08/16/2021 at 8:52 PM #175493 -
AuthorPosts
Find exclusive trading pro-tools on