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
-
-
06/26/2019 at 11:42 AM #101433
Hello Nicolas, as you know PRT does not allow alert setting on standard error and standard deviation channels for which one solution could have been using your manual LR channels, however the actual PRT standard error and standard deviation channels do not match with your LR Channel. Do you have a code for these 2 dynamic channels starting from a fixed candle/ bar which will exactly match with standard PRT standard error and standard deviation channels please so that I can set the alert?
I have attached the images for your reference and your PRT code below please.
Many thanks.
LR Channel12345678910111213141516171819202122232425262728293031323334353637//Parameters :// Len = 127// percent = 0.0016//once j=0de48=DPO[Len*2](close)if de48=de48[1] and de48[1]=de48[2] and de48[2]<>de48[3] thenflag=1endifn=(Len*2)-4p=(n/2)-1d100=DPO[n](close)moy100=close-d100co=(moy100-moy100[1]+(close[p])/n)*nif flag=1 and flag[1]=0 thentest=linearregression[Len](co)test1=linearregressionslope[Len](co)a=test1b=test-test1*Lenendifif flag=0 thenreg=a*j+bupperchan = reg + reg*percentlowerchan = reg - reg*percent//reg=undefined//upperchan=undefined//lowerchan=undefinedelsej=j+1reg=a*j+bupperchan = reg + reg*percentlowerchan = reg - reg*percentendifRETURN reg as "channel center", upperchan as "upper channel", lowerchan as "lower channel"06/26/2019 at 1:38 PM #101449This code is not mine. I suggest you use this one instead: Standard Deviation & Standard Error Linear Regression Channel
I know that it moves with each new candle as it is based on period. We could change the code to start from a precise time/date in the past if this is what you want, just tell me.
Alert cannot be programmed, still, so you’ll have to use the alert tool from the platform, in any case.
06/27/2019 at 4:05 AM #101493Hello Nicholas,
You are really a good man, always ready to help others. Thank you so much for your fast and reliable response.
Thank you for the code, however it is not same as the standard ones available in PRT is/are not matching with that of your as captured in the image.I have use, Standard error channel with Nb standard error as 1.62 (green dotted line) but when I set Deviation multiplier as 1.62 in your channel, it is not matching (image 1).
However, when I set Deviation multiplier as 0.46 in your channel, it is matching (image 2). But when the bars are moving your channel is getting shifted from the standard one as it is not staying anchored to the starting bar, as shown in image 3.
Also needs to anchor your channel to the starting point so that the number of bars need not be changed every 1 minute bar.
Appreciate your help please.
Many thanks.06/27/2019 at 9:13 AM #101510I don’t know which version of the channel indicator you are using, but the one I provided the link above is perfectly matching the one from the platform (attached picture).
If you confirm you can use this one, I can change the calculation to make it anchor on specific date and time. Thanks.
06/27/2019 at 2:01 PM #101536Many thanks Nicholas. I understand your point. Using your link I have downloaded the indicator whose code is as below. For the PRT Chart version I am using the one which is coming with IG Markets’ broker platform. The version is v10.3 – 1.8.0_45 as captured in the image. However, all good. Please anchor the channels to it fixed starting point. Many thanks for the code in advance.
06/28/2019 at 8:17 AM #101581I released a new version of the channel with anchored date and time in the library, download it from there: Anchored Standard Deviation & Standard Error Linear Regression Channel
You’ll have to define in the settings the precise date and time of candlestick of where to start the calculation of the channel.
06/28/2019 at 10:32 AM #101596Hello Nicholas, This is great. Many thanks for the same, however the very basic purpose of creating an ALERT on the channels is still not working. I have created the ALERT as shown in the enclosed, but system is not sensing the ALERT and hence not triggering. Appreciate your support please. Also the new anchored channels could not be truncated so that a new channel could be started. It should have an end date and time to terminate the old channel. Regards,
07/02/2019 at 1:32 PM #101810Hello Nicholas,
Any idea on how to make the ALERT work on the channels please?
Regards,07/08/2019 at 9:56 AM #102141Hello Nicholas,
Can I conclude that it is not possible?
Regards,
07/08/2019 at 10:18 AM #102143Sorry but I don’t actively monitor each topic I answered to.
That’s indeed not possible to set alert on objects (I used objects to plot the channel). In this case we have to calculate each point of the segments and return them in the indicator, that way you should be able to set alert on them (when price crosses the segments).
I didn’t realize you wanted to have an end date for the channel too. I will look into that.
07/08/2019 at 10:52 AM #102149This version has EndDate and EndTime and you should be able to set alerts on price crossing one of the returned values of the indicator, first one is the upper line, second one the lower line.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273//PRC_StdSte LinRegChannAnchored | indicator//Standard Deviation and Standard Error with date&time anchor//moded version with end date and time and channels values returned//to set alerts with the alert tool//Linear Regression Channel//28.06.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledgedefparam drawonlastbaronly=truedefparam calculateonlastbars=1000// --- settingsAnchorDate = 20190624 //Date anchor YYYYMMDD formatAnchorTime = 100000 //Time anchor HHMMSS formatEndDate = 20190705 //Date anchor YYYYMMDD formatEndTime = 080000 //Time anchor HHMMSS formatChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multipliercolorRed = 255colorGreen = 255colorBlue = 0// --- end of settingsif date=anchordate and time=anchortime thenstartbar=barindexendifif date=enddate and time=endtime thenendbar=barindexendiflookback = max(1,endbar-startbar)if lookback>0 and date>=AnchorDate thensumx = 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) / ndrawline(startbar,a+b*lookback,endbar,a+b*0) coloured(colorRed,colorGreen,colorBlue)//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendifdrawline(startbar,(a+b*lookback)+dat,endbar,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)drawline(startbar,(a+b*lookback)-dat,endbar,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)coeff = ((a+b)-(a+b*lookback))/(max(1,endbar-startbar))endifreturn ((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/09/2019 at 5:10 AM #102233Hello Nicholas,
This is brilliant. Many thanks for the same. However the channel is extending to the left infinitely hence creating a confusion to its start date and time as enclosed. Can we truncate the channel from extending to its left please.
Regards,07/09/2019 at 7:43 AM #102242Not possible to extend it only on one side. You have the choice, between segments like it used to be or like this..
We could add a vertical line at the starting date, so you could visualize where it starts, or a text/symbol for instance..
07/10/2019 at 6:24 AM #102315Many thanks Nicolas.
07/10/2019 at 10:46 AM #102333Here is a new version with a vertical line at the first bar of the channel (it contains also a bug fix, so use this version now).
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374//PRC_StdSte LinRegChannAnchored | indicator//Standard Deviation and Standard Error with date&time anchor//moded version with end date and time and channels values returned//to set alerts with the alert tool//Linear Regression Channel//28.06.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledgedefparam drawonlastbaronly=falsedefparam calculateonlastbars=1000// --- settingsAnchorDate = 20190710 //Date anchor YYYYMMDD formatAnchorTime = 100000 //Time anchor HHMMSS formatEndDate = 20190710 //Date anchor YYYYMMDD formatEndTime = 103000 //Time anchor HHMMSS formatChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multipliercolorRed = 255colorGreen = 255colorBlue = 0// --- end of settingsif date=anchordate and time=anchortime thenstartbar=barindexendifif date=enddate and time=endtime thenendbar=barindexendiflookback = max(1,endbar-startbar)if lookback>0 and date>=AnchorDate and date<=enddate and time<=endtime thensumx = 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) / ndrawline(startbar,a+b*lookback,endbar,a+b*0) coloured(colorRed,colorGreen,colorBlue)//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendifdrawline(startbar,(a+b*lookback)+dat,endbar,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)drawline(startbar,(a+b*lookback)-dat,endbar,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)drawvline(startbar)coeff = ((a+b)-(a+b*lookback))/(max(1,endbar-startbar))endifreturn ((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" -
AuthorPosts
Find exclusive trading pro-tools on