In a 70T interval chart I want to check a condition in a 400T interval chart and return a flag of "long" or "short" using efsExternal.
I read Alex's various threads on efsInternal and efsExternal, including the 01-09-2006 thread to Z11, and I obviously still don't get it.
Also, do I need to pass the symbol also (in this case AB H6) or will the external efs default to the symbol being used in my main efs?
Thanks in advance.
// my external efs
var vTrend = "flat";
function preMain() {
setColorPriceBars(true);
setPriceStudy(true);
setStudyTitle("VerifyTrend");
var vFast1 = new FunctionParameter("vFast1", FunctionParameter.NUMBER);
vFast1.setLowerLimit(1.00);
vFast1.setDefault(5.00);
var vFast2 = new FunctionParameter("vFast2", FunctionParameter.NUMBER);
vFast2.setLowerLimit(1.00);
vFast2.setDefault(10.00);
} // end preMain
function main(vFast1, vFast2) {
var vMA1e = new MAStudy(vFast1, 0, "Close", MAStudy.EXPONENTIAL);
var vMA1s = new MAStudy(vFast2, 0, "Close", MAStudy.SIMPLE);
if ( vMA1e.getValue(MAStudy.MA) < vMA1s.getValue(MAStudy.MA) ) { // short condition
setPriceBarColor( Color.red);
vTrend = "short";
}
else {
setPriceBarColor( Color.lime);
vTrend = "long";
}
return (vTrend);
} // end Main
*********
// In my main efs I am calling the external efs as follows:
vTrend = efsExternal("VerifyTrend.efs",5,10,inv("400T") );
drawText(vTrend,BelowBar4);
When I print it I get an "(object Series)" error.
I read Alex's various threads on efsInternal and efsExternal, including the 01-09-2006 thread to Z11, and I obviously still don't get it.
Also, do I need to pass the symbol also (in this case AB H6) or will the external efs default to the symbol being used in my main efs?
Thanks in advance.
// my external efs
var vTrend = "flat";
function preMain() {
setColorPriceBars(true);
setPriceStudy(true);
setStudyTitle("VerifyTrend");
var vFast1 = new FunctionParameter("vFast1", FunctionParameter.NUMBER);
vFast1.setLowerLimit(1.00);
vFast1.setDefault(5.00);
var vFast2 = new FunctionParameter("vFast2", FunctionParameter.NUMBER);
vFast2.setLowerLimit(1.00);
vFast2.setDefault(10.00);
} // end preMain
function main(vFast1, vFast2) {
var vMA1e = new MAStudy(vFast1, 0, "Close", MAStudy.EXPONENTIAL);
var vMA1s = new MAStudy(vFast2, 0, "Close", MAStudy.SIMPLE);
if ( vMA1e.getValue(MAStudy.MA) < vMA1s.getValue(MAStudy.MA) ) { // short condition
setPriceBarColor( Color.red);
vTrend = "short";
}
else {
setPriceBarColor( Color.lime);
vTrend = "long";
}
return (vTrend);
} // end Main
*********
// In my main efs I am calling the external efs as follows:
vTrend = efsExternal("VerifyTrend.efs",5,10,inv("400T") );
drawText(vTrend,BelowBar4);
When I print it I get an "(object Series)" error.
Comment