This channel is made of initial code by HK-LISSE to draw a linear regression. Coded by request, this modification is an attempt to draw the correct channel made with an upper and a lower lines deviated from the center by price percentage.
This code maybe of interest for anyone to make screeners and automated strategies around it, because there are no possibilities actually to call the values of the platform embedded same indicator.
Beware that the channel is moving at candle close and informations of the N+0 past channel would have not be the same in the past at N+10 periods for example.
// Len = 100
// percent = 0.002
if de48=de48 and de48=de48 and de48<>de48 then
if flag=1 and flag=0 then
if flag=0 then
upperchan = reg + reg*percent
lowerchan = reg - reg*percent
RETURN reg as "channel center", upperchan as "upper channel", lowerchan as "lower channel"
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :