LR Channel
Forums › ProRealTime forum Italiano › Supporto ProBuilder › LR Channel
- This topic has 3 replies, 2 voices, and was last updated 4 years ago by Nicolas.
-
-
09/18/2019 at 5:22 PM #10789212345678910111213141516171819202122232425262728293031323334//Parameters :// Len = 100// percent = 0.002once 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=undefinedupperchan=undefinedlowerchan=undefinedelsej=j+1reg=a*j+bupperchan = reg + reg*percentlowerchan = reg - reg*percentendifRETURN reg as "channel center", upperchan as "upper channel", lowerchan as "lower channel"
Buongiorno Nicolas,
sto testando il codice del Regression Channel su un time frame daily ed ho notato che impostando un periodo maggiore di 136 (Len = 137 per esempio) il canale non viene più disegnato sul grafico del prezzo.
Secondo te dov’è l’errore? è possibile corregere questa disfunzionalità ?
Grazie mille.
09/19/2019 at 7:44 AM #107913Non dovresti usare quel vecchio codice che usa il futuro del prezzo usando il DPO. C'è un indicatore recente che traccia il canale di regressione lineare nella libreria: Canale di regressione lineare di deviazione standard ed errore standard che è accurato e simile al 100% allo strumento della piattaforma.
09/22/2019 at 9:59 AM #108139Ok grazie Nicolas.
Il codice Canale di regressione lineare di deviazione standard ed errore standard disegna sul grafico il canale, è possibile creare un codice screener per trovare i breakout del limite superio e/o inferiore del canale ?
09/23/2019 at 10:20 AM #108216Perché no, ma non hai bisogno di questo indicatore per quello. Utilizzare una curva di regressione lineare con deviazione in STD o STE e individuare il breakout:
12345678910111213141516lookback=200NbDeviation=1ChannelType=1lr=linearregression[lookback](close)//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendifbreakout = close crosses over lr+dat or close crosses under lr-datscreener[breakout] -
AuthorPosts
Find exclusive trading pro-tools on