This EFS displays very weird - ideas ??
Not sure why this EFS is displaying so weird.
Not sure why this EFS is displaying so weird.
function calcMACD(Short,Long,Source){
return wma(Short,Source) - wma(Long,Source);
}
var xShortMA = null;
var xLongMA = null;
function calcMACD(Short,Long,Source){
if(xShortMA==null) xShortMA = wma(Short,Source);
if(xLongMA==null) xLongMA = wma(Long,Source);
var nShortMA = xShortMA.getValue(0);
var nLongMA = xLongMA.getValue(0);
if(nShortMA==null || nLongMA==null)
return;
return (nShortMA-nLongMA);
}
function calcSig(Short,Long,Smoothing,Source){
var MACD = efsInternal("calcMACD",Short,Long,Source);
var Sig = wma(Smoothing,MACD);
return new Array (MACD, Sig, (MACD-Sig));
}
var xMACD = null;
var xSig = null;
function calcSig(Short,Long,Smoothing,Source){
if(xMACD==null) xMACD = efsInternal("calcMACD",Short,Long,Source);
if(xSig==null) xSig = wma(Smoothing,xMACD);
var nMACD = xMACD.getValue(0);
var nSig = xSig.getValue(0);
if(nMACD==null || nSig==null)
return;
return new Array (nMACD, nSig, (nMACD-nSig));
}
var bInit = false
var myMACD = null;
function main(){
if(bInit==false){
//whatever code will be required for Symbol, Interval, etc as in your efs
myMACD = efsInternal("calcSig", Short,Long,Smoothing,Source);
bInit=true;
}
return new Array (getSeries(myMACD,0), getSeries(myMACD,1), getSeries(myMACD,2));
}
var bInit=false;
var temp = null;
var myMACD = null;
var mySig = null;
var myHist = null;
function main(){
if(bInit==false){
//whatever code will be required for Symbol, Interval, etc as in your efs
temp = efsInternal("calcSig", Short,Long,Smoothing,Source);
myMACD = getSeries(temp,0);
mySig = getSeries(temp,1);
myHist = getSeries(temp,2);
bInit=true;
}
return new Array (getSeries(myMACD), getSeries(mySig), getSeries(myHist));
}
Comment