Alert setting is not possible in Standard Deviation Channel
Forums › ProRealTime English forum › ProBuilder support › Alert setting is not possible in Standard Deviation Channel
- This topic has 22 replies, 2 voices, and was last updated 5 years ago by Partha Banerjee.
Tagged: channel, linear regression
-
-
07/15/2019 at 1:48 PM #102614
Hello Nicholas,
This is brilliant. Many thanks. One last request Nicholas please, can you please let me know how to start the upper and lower line from 50 bars before dynamically instead of anchoring it to a fixed date and time. It needs a little change to your code to make the start point dynamic please.
Many thanks, Nicholas.
Regards,07/15/2019 at 2:45 PM #102619how to start the upper and lower line from 50 bars before dynamically instead of anchoring it to a fixed date and time
That’s what the initial indicators was doing, so I don’t understand your question?
07/16/2019 at 5:06 AM #102634Sorry Nicholas, for the confusion, if any.
If you remember, we can not set the ALERT on the initial indicator as depicted below.
This is why, the request is how to set an ALERT in the initial indicator or the anchored one if it’s starting point is 50 bar behind dynamically.
Anyone will suffice the request please.
Regards,
PRC_Std and Ste LinRegChannel | indicator123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354//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.62lookback= chnlper //channel period = 50ChannelType = sdsr //1= Standard Deviation ; 2= Standard ErroNbDeviation = devmul //Deviation multiplier = 1colorRed = 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/16/2019 at 8:06 AM #102640Here is the version of the channel with dynamic lookback and with returned values for the upper and lower lines to create signals:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657//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// --- settingslookback= 200 //channel periodChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multipliercolorRed = 255colorGreen = 255colorBlue = 0// --- 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) / ndrawsegment(barindex[lookback],a+b*lookback,barindex,a+b*0) coloured(colorRed,colorGreen,colorBlue)//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = 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)startbar=barindex[lookback]endbar=barindexcoeff = ((a+b)-(a+b*lookback))/(max(1,endbar-startbar))return ((a+b*lookback)+dat)+(barindex-startbar)*coeff coloured(100,100,100,0) as "upper line",((a+b*lookback)-dat)+(barindex-startbar)*coeff coloured(100,100,100,0) as "lower line"07/18/2019 at 1:16 AM #102795You are a GENIUS, my dear Nicholas.
Thanks a trillion for your kind, fast and reliable response.
Really appreciate your effort.
Best regards,
07/31/2019 at 1:03 PM #103874Hello Nicholas,
It seems the standard error channel is not working properly in Bitcoin’s monthly chart as shown in the enclosed chart.
Appreciate if it can be fixed.
Regards,
07/31/2019 at 4:36 PM #10389908/01/2019 at 4:26 AM #103918You are correct Nicolas.
Many thanks.
-
AuthorPosts
Find exclusive trading pro-tools on