There are some bugs in this code - not sure where
I used to following code to create the first efsExternal which could be used in the second efs
function preMain(){
setPriceStudy(false);
setStudyTitle("Fast EMA20-EMA5");
setCursorLabelName("EMA");
var fp1 = new FunctionParameter("Series", FunctionParameter);
fp1.setName("EMA1 - EMA2");
fp1.setLowerLimit(1);
fp1.setUpperLimit(200);
fp1.setDefault(20);
}
var myAvg = null;
function main(Series){//add the parameter to the main definition
if(myAvg==null) myAvg = (ema (20) -ema (5));//replace the value with the parameter variable
return myAvg.getValue(0);
}
/////////////////////////////////////////////////////////////////////////
The following is the code that I used to call on the efsExternal
setCursorLabelName("Fast TA");
var fp1 = new FunctionParameter("Length", FunctionParameter);
fp1.setName("Length of %R");
fp1.setLowerLimit(1);
fp1.setUpperLimit(200);
fp1.setDefault(20);
}
var myAvg = null;
var ext = null
function main(Length){//add the parameter to the main definition
ext=efsExternal ("Step1Ext.efs")
if(myAvg==null) myAvg = percentR((Length),ext);//replace the value with the parameter variable
return myAvg.getValue(0);
}
I used to following code to create the first efsExternal which could be used in the second efs
function preMain(){
setPriceStudy(false);
setStudyTitle("Fast EMA20-EMA5");
setCursorLabelName("EMA");
var fp1 = new FunctionParameter("Series", FunctionParameter);
fp1.setName("EMA1 - EMA2");
fp1.setLowerLimit(1);
fp1.setUpperLimit(200);
fp1.setDefault(20);
}
var myAvg = null;
function main(Series){//add the parameter to the main definition
if(myAvg==null) myAvg = (ema (20) -ema (5));//replace the value with the parameter variable
return myAvg.getValue(0);
}
/////////////////////////////////////////////////////////////////////////
The following is the code that I used to call on the efsExternal
setCursorLabelName("Fast TA");
var fp1 = new FunctionParameter("Length", FunctionParameter);
fp1.setName("Length of %R");
fp1.setLowerLimit(1);
fp1.setUpperLimit(200);
fp1.setDefault(20);
}
var myAvg = null;
var ext = null
function main(Length){//add the parameter to the main definition
ext=efsExternal ("Step1Ext.efs")
if(myAvg==null) myAvg = percentR((Length),ext);//replace the value with the parameter variable
return myAvg.getValue(0);
}
Comment