"Style" is not working in Standard deviation Channel
Forums › ProRealTime English forum › ProBuilder support › "Style" is not working in Standard deviation Channel
- This topic has 7 replies, 4 voices, and was last updated 5 years ago by Partha Banerjee.
-
-
07/07/2019 at 4:09 AM #102066
Hello Nicholas,
When I am using style(line,5) in your below written code it is providing error. Appreciate if you please tell me how to incorporate style(line,5) in the following code:123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354//PRC_Std and Ste LinRegChannel | indicator//Standard Deviation and Standard Error//Linear Regression Channel//12.03.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledgedefparam drawonlastbaronly=truedefparam calculateonlastbars=1000// --- settings// chnlper = 200, sdsr = 1, devmul = 1.62, c1 = 153, c2 = 51, c3 =0lookback= chnlper //channel periodChannelType = sdsr //1= Standard Deviation ; 2= Standard ErroNbDeviation = devmul //Deviation multipliercolorRed = C1colorGreen = C2colorBlue = C3// --- end of settingssumx = 0sumy = 0sumxy = 0sumx2 = 0for cmpt = lookback downto 0 dotmpx = cmpttmpy = close[cmpt]sumy = sumy+tmpysumx = sumx+tmpxsumx2 = sumx2 + (tmpx*tmpx)sumxy = sumxy + (tmpy*tmpx)nextn = lookback+1if (sumx2 = sumx * sumx) then // protection to avoid infinite valuesb = sumxy - sumx * sumyelseb = (n * sumxy - sumx * sumy) / (n * sumx2 - sumx * sumx)endifa = (sumy - b * sumx) / n//drawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsif ChannelType = 2 thendat = ste[lookback]*NbDeviationendifdrawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)return07/07/2019 at 6:11 AM #102069read here https://www.prorealcode.com/documentation/drawsegment/
it is not possible to use the style function with drawsegment
07/07/2019 at 6:57 AM #102070>> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
Only lines plotted with RETURNed data can be customized with STYLE or with the indicator’s properties.07/07/2019 at 11:36 AM #102073Thank you, however how to increase the width of the channel?
07/07/2019 at 11:48 AM #102081You can increase a or b, or both, with a multiplier, such as 1.1 to increase 10%, or 1.01 to increase 1%.
07/07/2019 at 1:18 PM #102088You’d better use a multiplier with DAT, just after line 50, before it’s used.
07/08/2019 at 8:06 AM #10211607/08/2019 at 9:37 AM #102130Thank you for the responses.
I am using a crude way to get the same effect, i.e. instead of one call to the indicator, I am using 5 times (as shown below). This is increasing the thickness. But anyway, will wait for the updated release. -
AuthorPosts
Find exclusive trading pro-tools on