Hi-
I have no experience writing efs scripts so
I'm trying to alter an existing one to do what I want but I cannot get it to work. I trade the es and I want to draw 2 horizontal lines, one to plot +1.25 points above current bar low and one to plot -.25 points below current bar low. With the ability to update as the bar is forming in real time.
If it can be done without a full horizontal bar and instead short bars (attached image) that extend to the right off current bar with price, that would work even better. The attached link shows what I'm trying to accomplish.
Thanks so much for any help.
function preMain() {
setPriceStudy(true);
setStudyTitle("Lines");
setCursorLabelName("Line1",0);
setCursorLabelName("Line1",1);
var fp3 = new FunctionParameter("Lower1", FunctionParameter.NUMBER);
fp3.setLowerLimit(0);
fp3.setDefault(0.25);
var fp4 = new FunctionParameter("Upper2", FunctionParameter.NUMBER);
fp4.setLowerLimit(0);
fp4.setDefault(1.25);
}
function main(Lower1,Lower2) {
clearLineTool(LineTool.HORZ);
var L1 = low()-Lower1;
var L2 = low()+Lower2;
addLineTool(LineTool.HORZ, L1, 1, Color.red, "Lo1");
addLineTool(LineTool.HORZ, L2, 1, Color.red, "Up2");
return new Array (formatPriceNumber(L1),formatPriceNumber(L2):
}
I have no experience writing efs scripts so
I'm trying to alter an existing one to do what I want but I cannot get it to work. I trade the es and I want to draw 2 horizontal lines, one to plot +1.25 points above current bar low and one to plot -.25 points below current bar low. With the ability to update as the bar is forming in real time.
If it can be done without a full horizontal bar and instead short bars (attached image) that extend to the right off current bar with price, that would work even better. The attached link shows what I'm trying to accomplish.
Thanks so much for any help.
function preMain() {
setPriceStudy(true);
setStudyTitle("Lines");
setCursorLabelName("Line1",0);
setCursorLabelName("Line1",1);
var fp3 = new FunctionParameter("Lower1", FunctionParameter.NUMBER);
fp3.setLowerLimit(0);
fp3.setDefault(0.25);
var fp4 = new FunctionParameter("Upper2", FunctionParameter.NUMBER);
fp4.setLowerLimit(0);
fp4.setDefault(1.25);
}
function main(Lower1,Lower2) {
clearLineTool(LineTool.HORZ);
var L1 = low()-Lower1;
var L2 = low()+Lower2;
addLineTool(LineTool.HORZ, L1, 1, Color.red, "Lo1");
addLineTool(LineTool.HORZ, L2, 1, Color.red, "Up2");
return new Array (formatPriceNumber(L1),formatPriceNumber(L2):
}
Comment