Hi Dev-Traders,
Can anyone please create a Multi-TF ribbon of this Ehler's Trend ?
All i know is that one can use "inhourly" / "indaily" /
in15mins" etc to code. But how to do it !!??
Please find the code below.. will be grateful if any expert can modify the code to show several ribbons of different timeframes..
thanks!
SetBarsRequired(200, 0);
// Ehlers ITrend
// from Ehlers, John F. Cybernetic Analysis for Stocks and Futures. Wiley. 2004.
// Chapter 3, p. 21. Code on p. 24.
function ITrend(array, alpha)
{
// initialize early array values and declare as array
it = array;
//it = (array[2] - 2*array[1] + array[0])/4; This initialization takes a longtime to converge.
for(i = 2; i < BarCount; i++)
{
it = (alpha - alpha*alpha/4)*array +
.5*alpha*alpha*array[i-1] -
(alpha - .75*alpha*alpha)*array[i-2] +
2*(1 - alpha)*it[i-1] -
(1 - alpha)*(1 - alpha)*it[i-2];
}
return it;
}
function ITrendTrigger(array)
{
trigger = 2*array - Ref(array, -2);
return trigger;
}
Med = (H+L)/2;
// Instantaneous Trend
Plot(Med, "", colorBlack, styleNoDraw);
trend = ITrend(Med, .07);
Plot(trend, "ITrend", colorRed, styleThick);
Plot(ITrendTrigger(trend), "", colorTurquoise, styleThick);
Can anyone please create a Multi-TF ribbon of this Ehler's Trend ?
All i know is that one can use "inhourly" / "indaily" /
in15mins" etc to code. But how to do it !!??
Please find the code below.. will be grateful if any expert can modify the code to show several ribbons of different timeframes..
thanks!
SetBarsRequired(200, 0);
// Ehlers ITrend
// from Ehlers, John F. Cybernetic Analysis for Stocks and Futures. Wiley. 2004.
// Chapter 3, p. 21. Code on p. 24.
function ITrend(array, alpha)
{
// initialize early array values and declare as array
it = array;
//it = (array[2] - 2*array[1] + array[0])/4; This initialization takes a longtime to converge.
for(i = 2; i < BarCount; i++)
{
it = (alpha - alpha*alpha/4)*array +
.5*alpha*alpha*array[i-1] -
(alpha - .75*alpha*alpha)*array[i-2] +
2*(1 - alpha)*it[i-1] -
(1 - alpha)*(1 - alpha)*it[i-2];
}
return it;
}
function ITrendTrigger(array)
{
trigger = 2*array - Ref(array, -2);
return trigger;
}
Med = (H+L)/2;
// Instantaneous Trend
Plot(Med, "", colorBlack, styleNoDraw);
trend = ITrend(Med, .07);
Plot(trend, "ITrend", colorRed, styleThick);
Plot(ITrendTrigger(trend), "", colorTurquoise, styleThick);