I am interested in any information that will enable me to write code using the EFS object / class models as well as built-in objects and classes.
Thanks
Thanks
function mytrendfunction() {
var MTF = new Array();
var MTFObj = new Object;
MTFObj.Trend = 0;
MTFObj.TrndBar = -99999;
MTFObj.TrndStatus = "";
MTF.push(MTFObj);
// creates an array populated with ONE OBJECT.
if (close(-1) > close(-5)) {
MTF[0].Trend = 1;
MTF[0].TrndBar = -1;
MTF[0].TrndStatus = "Bullish Trend";
}
if (close(-1) < close(-5)) {
MTF[0].Trend = 1;
MTF[0].TrndBar = -1;
MTF[0].TrndStatus = "Bearish Trend";
}
return MTF;
// This returns the entire array including the single object.
}
// in your regular code, you would access the returned values like this.
var vMTF = mytrendfunction();
if (vMTF[0].Trend > 0) { // Bullish Trend
}
if (vMTF[0].Trend < 0) { // Bearish Trend
}
Comment