hi im trying to get the moving average value in excel with this efs for a symbol ((ES U2)-($SPX)) that i am charting in esginal and am having problems getting it to work. this works for any normal symbol like say AAPL but not for ((ES M2)-($SPX))
var ddeSMA10 = null;
var vMA = new MAStudy(10, 0, "Close", MAStudy.SIMPLE);
function preMain() {
setPriceStudy(true);
setStudyTitle("DDE SMA10");
setShowCursorLabel(false);
}
function main() {
if (ddeSMA10 == null) {
var sName = "SMA10" + getSymbol() + getInterval();
sName = sName.replace("$", ""); // remove $ from string
sName = sName.replace("#", ""); // remove # from string
sName = sName.replace("-", "");
sName = sName.replace("(", "");
sName = sName.replace(")", "");
sName = sName.replace(" ", "_") // replace space with underscore
debugPrintln("DDE Link for Excel =eSignal|EFS!"+sName);
ddeSMA10 = new DDEOutput(sName);
}
var vSMA10 = vMA.getValue(MAStudy.MA);
if (vSMA10 == null) return;
ddeSMA10.set(vSMA10);
return vSMA10;
}
var ddeSMA10 = null;
var vMA = new MAStudy(10, 0, "Close", MAStudy.SIMPLE);
function preMain() {
setPriceStudy(true);
setStudyTitle("DDE SMA10");
setShowCursorLabel(false);
}
function main() {
if (ddeSMA10 == null) {
var sName = "SMA10" + getSymbol() + getInterval();
sName = sName.replace("$", ""); // remove $ from string
sName = sName.replace("#", ""); // remove # from string
sName = sName.replace("-", "");
sName = sName.replace("(", "");
sName = sName.replace(")", "");
sName = sName.replace(" ", "_") // replace space with underscore
debugPrintln("DDE Link for Excel =eSignal|EFS!"+sName);
ddeSMA10 = new DDEOutput(sName);
}
var vSMA10 = vMA.getValue(MAStudy.MA);
if (vSMA10 == null) return;
ddeSMA10.set(vSMA10);
return vSMA10;
}
Comment