indicator variable no longer working in v11
Forums › ProRealTime English forum › ProBuilder support › indicator variable no longer working in v11
- This topic has 5 replies, 3 voices, and was last updated 3 years ago by emmkay.
-
-
02/22/2021 at 9:40 AM #162308
Hi, since moving to v11 from 10.3 one of the variables in an indicator i use no longer works. basically if the variable is true then it should only display the horizontal lines on bars for “today”.
i’m not very good with coding so hoping someone can help me out? – attached a picture of the variables.
1234567891011121314151617181920212223242526272829303132333435363738defparam drawonlastbaronly = trueMP = UNDEFINEDCBOL = UNDEFINEDCBOS = UNDEFINEDMR3 = UNDEFINEDMR2 = UNDEFINEDMR1 = UNDEFINEDMS1 = UNDEFINEDMS2 = UNDEFINEDMS3 = UNDEFINEDMMLO = UNDEFINEDMMHI = UNDEFINEDMGAP = UNDEFINEDMPDH = UNDEFINEDMPDL = UNDEFINEDSHOW = (TodayOnly and DATE[0] > Yesterday)IF SHOW or NOT TodayOnly THENMP = ( (MClose + MHi + MLo ) / 3)CBOL = MClose + ( ( (MHi - MLo) * 1.1) / 2)CBOS = MClose - ( ( (MHi - MLo ) * 1.1) / 2)MR3 = MHi + ( 2 * (MP - MLo) )MR2 = MP + (MHi - MLo)MR1 = (2 * MP) - MLoMS1 = (2 * MP) - MHiMS2 = MP - (MHi - MLo)MS3 = MLo - ( 2 * (MHi - MP) )MMLO = MLOMMHI = MHIMPDH = PDHMPDL = PDLMGAP = MCLOSEENDIFRETURN MP COLOURED(169,169,169) as "Pivot", CBOL COLOURED(30,144,255) as "CBOL", CBOS COLOURED(30,144,255) as "CBOS", MR3 COLOURED(218,165,32) as "R3", MR2 COLOURED(218,165,32) as "R2", MR1 COLOURED(218,165,32) as "R1", MS1 COLOURED(218,165,32) as "S1", MS2 COLOURED(218,165,32) as "S2", MS3 COLOURED(218,165,32) as "S3", MGAP COLOURED(0,0,0) as "Close", MMHi COLOURED (220,20,60) as "Hi", MMLo COLOURED (220,20,60) as "Lo", MPDH COLOURED (220,20,60)style(dottedline,2) as "2DHi", MPDL COLOURED (220,20,60)style(dottedline,2) as "2DLo"02/22/2021 at 9:48 AM #162315emmkay – Welcome to the forums but….. please follow the forum rules and do not double post. I have deleted your other similar question that you added to another old topic.
- Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
02/22/2021 at 11:23 AM #162329In PRT v11, yesterday is the date from the previous day, even in history, so your condition to show levels only on the current day is not longer working. In fact, there is no “easy” workaround or replacement for this change. A complete rewrite of the indicator is needed in this case.
02/23/2021 at 8:42 AM #16240202/23/2021 at 9:50 AM #162405Here is a modified code that plot segments for your pivot points only for the current day. I only recoded 2 segments for example, you’ll have to code the rest the same way as I did 😉
1234567891011121314151617181920212223242526272829303132defparam drawonlastbaronly = trueMclose=130Mhi=135Mlo=132.5PDH=138PDL=131if intradaybarindex=0 thenstart = barindexendifMP = ( (MClose + MHi + MLo ) / 3)CBOL = MClose + ( ( (MHi - MLo) * 1.1) / 2)CBOS = MClose - ( ( (MHi - MLo ) * 1.1) / 2)MR3 = MHi + ( 2 * (MP - MLo) )MR2 = MP + (MHi - MLo)MR1 = (2 * MP) - MLoMS1 = (2 * MP) - MHiMS2 = MP - (MHi - MLo)MS3 = MLo - ( 2 * (MHi - MP) )MMLO = MLOMMHI = MHIMPDH = PDHMPDL = PDLMGAP = MCLOSEdrawsegment(start,MP,barindex,MP) coloured(169,169,169)drawsegment(start,CBOL,barindex,CBOL) COLOURED(30,144,255)return//RETURN MP COLOURED(169,169,169) as "Pivot", CBOL COLOURED(30,144,255) as "CBOL", CBOS COLOURED(30,144,255) as "CBOS", MR3 COLOURED(218,165,32) as "R3", MR2 COLOURED(218,165,32) as "R2", MR1 COLOURED(218,165,32) as "R1", MS1 COLOURED(218,165,32) as "S1", MS2 COLOURED(218,165,32) as "S2", MS3 COLOURED(218,165,32) as "S3", MGAP COLOURED(0,0,0) as "Close", MMHi COLOURED (220,20,60) as "Hi", MMLo COLOURED (220,20,60) as "Lo", MPDH COLOURED (220,20,60)style(dottedline,2) as "2DHi", MPDL COLOURED (220,20,60)style(dottedline,2) as "2DLo"02/25/2021 at 10:10 AM #162596 -
AuthorPosts
Find exclusive trading pro-tools on