I have a working indicator that produces stochastic momentum. I am trying to add an EMA(3, vSMI) of the SMI, however the results are not correct. The results range around 300, when the SMI ranges between -50 and +50. Below is a copy of the code I am using. I have also attached the .efs.
Any thoughts are greatly appreciated!
Regards,
zMendel
PHP Code:
function main() {
var vSMqN = efsInternal("myCalcN");
var vEMAsN = ema(25, vSMqN);
var vEMArN = ema(1, vEMAsN);
var vSMqD = efsInternal("myCalcD");
var vEMAsD = ema(25, vSMqD);
var vEMArD = (ema(1, vEMAsD) * .5);
var vSMI = ((vEMArN/vEMArD)*100);
var vSMIs = ema(3, vSMI);
if (
vSMI > 50
) onAction1()
else if (
vSMI < -50
) onAction2();
return new Array(
vSMI,
vSMIs
);
Regards,
zMendel
Comment