Code Amibroker Indicators

Laguerre PPO Oscillator for Amibroker

                               

Laguerre PPO Oscillator is just the translated Tradingview Pinescript indicator from theLark’s Laguerre PPO. We very well know that Lauggerre RSI is from the John Ehlers library and Price Percentage Oscillator (PPO) is a classical momentum oscillator. So Laguerre PPO is nothing but a fusion between Laugerre RSI and PPO Oscillator.

// Coded by Rajandran R
// Date : 17th Jan 2016
// Reference Url : https://www.tradingview.com/script/uKEixWLn-TheLark-Laguerre-PPO/
_SECTION_BEGIN(“PPO Lagurre”);
ishort = Param(“Short”,0.4, 0.1,1,0.1);

ilong = Param(“Long”,0.8, 0.1,1,0.1);
emalen = Param(“Length of EMA”,20,2,30,1);
function lag(gamma,price) {
L0[0] = 0;
L1[0] = 0;
L2[0] = 0;
L3[0] = 0;
f[0] = 0;

for(i=1;i<=BarCount-1;i++)
{

L0[i] = (1-gamma)*price[i]+gamma*L0[i-1];

L1[i] = -gamma*L0[i]+L0[i-1]+gamma*L1[i-1];

L2[i] = -gamma*L1[i]+L1[i-1]+gamma*L2[i-1];

L3[i] = -gamma*L2[i]+L2[i-1]+gamma*L3[i-1];

f[i] = (L0[i]+2*L1[i]+ 2*L2[i] + L3[i])/6;

}
return f;
}
hl2 = (H+L)/2;
lmas = lag(ishort, hl2);
lmal = lag(ilong,hl2);
ppo = ((lmas – lmal)/lmal)*100;
emasig = EMA(ppo,emalen);
Plot(ppo, “PPO”, colorGreen);
Plot(emasig, “Signal”, colorRed);
Plot(ppo-emasig, “Hist”,colorBlue,styleHistogram | styleThick);
_SECTION_END();