Hey there. I am building a script that takes the main chart symbol and adds it to a user defined symbol in a sub chart. It takes the main symbol divided by SPY as an example and charts a line chart. Here is the issue: I cannot insert a study onto the user defined chart. If I insert a symbol (not as main chart) and use the same symbols to create a user defined symbol I am able to insert a study.
Example - main chart symbol = EA, user defined symbol would then be EA / SPY. If I insert the symbol manually I can place Bollinger Bands on the sub-chart "EA / SPY". If I do the same thing using an EFS script, I don't have the option to insert a study over the series. I've tried two versions of code to create the user defined symbol - with the same results. I get the desired line chart, but cannot place a study on it.
Any suggestions?
EFS attempt # 1:
function preMain(){
setStudyTitle("i3 Exchange Comparison");
setCursorLabelName("Exchange");
setPriceStudy(false);
setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF),0);
setDefaultBarThickness(3,0);
}
var vSymbol;
var SourceSymbol;
var CompareSymbol;
function main(Sym){
var SourceSymbol = getSymbol();
var CompareSymbol = "SPY";
var vSym = (SourceSymbol + " / " + CompareSymbol);
var Sym = vSym;
var vSymbol = getValue("Close", 0, -1, Sym);
debugClear
debugPrintln("DepthSymbol: " + SourceSymbol);
debugPrintln("Base Comparison to: " + CompareSymbol);
return vSymbol;
}
Attempt # 2:
**************************************
function preMain(){
setStudyTitle("i3 Exchange Comparison");
setCursorLabelName("Exchange");
//setPriceStudy(false);
setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF),0);
setDefaultBarThickness(3,0);
}
var vSymbol;
var SourceSymbol;
var CompareSymbol;
var vSym;
function main() {
var SourceSymbol = getSymbol();
var CompareSymbol = "SPY";
var vSym = (SourceSymbol + " / " + CompareSymbol);
var vSymbol = close(sym(vSym));
return new Array( getSeries(vSymbol));
}
Example - main chart symbol = EA, user defined symbol would then be EA / SPY. If I insert the symbol manually I can place Bollinger Bands on the sub-chart "EA / SPY". If I do the same thing using an EFS script, I don't have the option to insert a study over the series. I've tried two versions of code to create the user defined symbol - with the same results. I get the desired line chart, but cannot place a study on it.
Any suggestions?
EFS attempt # 1:
function preMain(){
setStudyTitle("i3 Exchange Comparison");
setCursorLabelName("Exchange");
setPriceStudy(false);
setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF),0);
setDefaultBarThickness(3,0);
}
var vSymbol;
var SourceSymbol;
var CompareSymbol;
function main(Sym){
var SourceSymbol = getSymbol();
var CompareSymbol = "SPY";
var vSym = (SourceSymbol + " / " + CompareSymbol);
var Sym = vSym;
var vSymbol = getValue("Close", 0, -1, Sym);
debugClear
debugPrintln("DepthSymbol: " + SourceSymbol);
debugPrintln("Base Comparison to: " + CompareSymbol);
return vSymbol;
}
Attempt # 2:
**************************************
function preMain(){
setStudyTitle("i3 Exchange Comparison");
setCursorLabelName("Exchange");
//setPriceStudy(false);
setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF),0);
setDefaultBarThickness(3,0);
}
var vSymbol;
var SourceSymbol;
var CompareSymbol;
var vSym;
function main() {
var SourceSymbol = getSymbol();
var CompareSymbol = "SPY";
var vSym = (SourceSymbol + " / " + CompareSymbol);
var vSymbol = close(sym(vSym));
return new Array( getSeries(vSymbol));
}
Comment