Hi,
I have a fairly simple EMA study that seems to be producing values correctly for all but the final bar (see attachment).
Above preMain:
var PMP = new MAStudy(vPMP_Sample, 0, "HL/2", MAStudy.SIMPLE);
var FastEMA_of_PMP = new MAStudy(vFastXAP_Sample, 0, PMP, MAStudy.MA, MAStudy.EXPONENTIAL);
Main:
var vFastXAP_Current = FastEMA_of_PMP.getValue(MAStudy.MA, 0);
var vFastXAP_Previous = FastEMA_of_PMP.getValue(MAStudy.MA, vFastXAP_LookBack);
if (vFastXAP_Current > (vFastXAP_Previous+vRangeDiff)) {
setBarFgColor(Color.green,0);
}
I have tried setComputeOnClose(true) or (false), it makes no difference.
Can anyone help, please?
I have a fairly simple EMA study that seems to be producing values correctly for all but the final bar (see attachment).
Above preMain:
var PMP = new MAStudy(vPMP_Sample, 0, "HL/2", MAStudy.SIMPLE);
var FastEMA_of_PMP = new MAStudy(vFastXAP_Sample, 0, PMP, MAStudy.MA, MAStudy.EXPONENTIAL);
Main:
var vFastXAP_Current = FastEMA_of_PMP.getValue(MAStudy.MA, 0);
var vFastXAP_Previous = FastEMA_of_PMP.getValue(MAStudy.MA, vFastXAP_LookBack);
if (vFastXAP_Current > (vFastXAP_Previous+vRangeDiff)) {
setBarFgColor(Color.green,0);
}
I have tried setComputeOnClose(true) or (false), it makes no difference.
Can anyone help, please?
Comment