Hi All,
I have this simple function which is used to create a Series object:
Now it is possible that the return value may be zero (same Open and Close). If I pass a Series generated through an 'efsInternal' call to a Moving Average function (doesn't seem to matter which one: sma, ema, wma), the returned series object sometimes is null.
However if I make a small change to my function by adding the following line at the end, the issue is fixed - as far as nullity goes.
However by doing this I'm tampering with the data. In this case a Zero value is not the same as null.
Has anyone ever come across a similar problem? Does anyone know a solution?
Thanks
G.
I have this simple function which is used to create a Series object:
PHP Code:
function getOpenCloseRangeValue(objOpenSeries, objCloseSeries){
var nRangeValue = null;
if(objOpenSeries != null && objCloseSeries != null){
var nOpen = objOpenSeries.getValue(0);
var nClose = objCloseSeries.getValue(0);
if(nOpen != null && nClose != null)
nRangeValue = Math.abs(nClose - nOpen);
}
return nRangeValue;
}
However if I make a small change to my function by adding the following line at the end, the issue is fixed - as far as nullity goes.
PHP Code:
if(nRangeValue == 0) nRangeValue = null;
Has anyone ever come across a similar problem? Does anyone know a solution?
Thanks
G.
Comment