How can I create variable that will change according to the symbol ?
for example i want that when i am looking on Caterpillar (symbol CAT) the variable pr will be 7
and when i look on Ford (symbol F) the variable pr will be 3.
thanks in advance for the help
************************/
function preMain() {
setPriceStudy(true);
setStudyTitle("test");
setCursorLabelName("EnvUpr", 0);
setCursorLabelName("EnvBas", 1);
setCursorLabelName("EnvLwr", 2);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.blue, 2);
setPlotType(PLOTTYPE_LINE,0);
setPlotType(PLOTTYPE_LINE,1);
setPlotType(PLOTTYPE_LINE,2);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
setDefaultBarThickness(1,2);
}
function main() {
if (((sym("f") , pr = 3) || sym("cat"), pr = 7));
return new Array (upperEnv(20,0,pr),middleEnv(20,0,10),lowerEnv(20, 0,10));
}
for example i want that when i am looking on Caterpillar (symbol CAT) the variable pr will be 7
and when i look on Ford (symbol F) the variable pr will be 3.
thanks in advance for the help
************************/
function preMain() {
setPriceStudy(true);
setStudyTitle("test");
setCursorLabelName("EnvUpr", 0);
setCursorLabelName("EnvBas", 1);
setCursorLabelName("EnvLwr", 2);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.blue, 2);
setPlotType(PLOTTYPE_LINE,0);
setPlotType(PLOTTYPE_LINE,1);
setPlotType(PLOTTYPE_LINE,2);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
setDefaultBarThickness(1,2);
}
function main() {
if (((sym("f") , pr = 3) || sym("cat"), pr = 7));
return new Array (upperEnv(20,0,pr),middleEnv(20,0,10),lowerEnv(20, 0,10));
}
Comment