Hi
when i start esignal this efs does not take effect, nothing happens when i reload it, but if i remove it from a chart and then re-add it it works -
what do i need to do to make it active when i open esignal?
function preMain() {
setPriceStudy(true);
setStudyTitle("Color Bars");
var fp1 = new FunctionParameter("nFLen", FunctionParameter.NUMBER);
fp1.setName("FastEMA length");
fp1.setDefault(20);
var fp2 = new FunctionParameter("nSLen", FunctionParameter.NUMBER);
fp2.setName("SlowEMA length");
fp2.setDefault(200);
}
function main(nFLen, nSLen) {
var xStudyFast = ema(nFLen, ohlc4());
var xStudySlow = ema(nSLen, ohlc4());
//Long
if (close(0) > xStudyFast && xStudyFast < xStudySlow) {
setPriceBarColor(Color.RGB(163,192,0));
}
if (close(0) > xStudySlow && xStudyFast < xStudySlow) {
setPriceBarColor(Color.RGB(0,192,0));
}
if (close(0) > xStudyFast && xStudyFast > xStudySlow) {
setPriceBarColor(Color.RGB(0,128,0));
}
//Short
if (close(0) < xStudyFast && xStudyFast > xStudySlow) {
setPriceBarColor(Color.RGB(255,160,255));
}
if (close(0) < xStudySlow && xStudyFast > xStudySlow) {
setPriceBarColor(Color.RGB(255,87,192));
}
if (close(0) < xStudyFast && xStudyFast < xStudySlow) {
setPriceBarColor(Color.red);
}
return;
when i start esignal this efs does not take effect, nothing happens when i reload it, but if i remove it from a chart and then re-add it it works -
what do i need to do to make it active when i open esignal?
function preMain() {
setPriceStudy(true);
setStudyTitle("Color Bars");
var fp1 = new FunctionParameter("nFLen", FunctionParameter.NUMBER);
fp1.setName("FastEMA length");
fp1.setDefault(20);
var fp2 = new FunctionParameter("nSLen", FunctionParameter.NUMBER);
fp2.setName("SlowEMA length");
fp2.setDefault(200);
}
function main(nFLen, nSLen) {
var xStudyFast = ema(nFLen, ohlc4());
var xStudySlow = ema(nSLen, ohlc4());
//Long
if (close(0) > xStudyFast && xStudyFast < xStudySlow) {
setPriceBarColor(Color.RGB(163,192,0));
}
if (close(0) > xStudySlow && xStudyFast < xStudySlow) {
setPriceBarColor(Color.RGB(0,192,0));
}
if (close(0) > xStudyFast && xStudyFast > xStudySlow) {
setPriceBarColor(Color.RGB(0,128,0));
}
//Short
if (close(0) < xStudyFast && xStudyFast > xStudySlow) {
setPriceBarColor(Color.RGB(255,160,255));
}
if (close(0) < xStudySlow && xStudyFast > xStudySlow) {
setPriceBarColor(Color.RGB(255,87,192));
}
if (close(0) < xStudyFast && xStudyFast < xStudySlow) {
setPriceBarColor(Color.red);
}
return;
Comment