I have the following EFS that draws an orange line at the mid-point of every candle on the price chart. I want the value of the midpoint also reported back to the cursor window, so it shows when I put the mouse over the bar (hence the last line is "return (MidPoint)". However, when I do this to get the MidPoint reported back into the Cursor Window, the EFS also draws a blue line connecting the midpoints of each candle. How do I get the EFS to NOT draw that blue connecting line, while still getting my orange MidPoint lines on the chart AND getting the MidPoint value reported back into the cursor window?
=====================================
var MidPoint = 0;
function preMain() {
setComputeOnClose(true);
setPriceStudy(true);
setStudyTitle("MidPoint");
setCursorLabelName("MidPoint");
}
//=========================================
function main () {
MidPoint = 0.5*(high() + low()); // Average of High and Low
drawLineRelative(7, MidPoint, 0, MidPoint, PS_SOLID, 1, Color.RGB(255,155,0), "MPB"+getCurrentBarCount());
return (MidPoint);
}
=====================================
var MidPoint = 0;
function preMain() {
setComputeOnClose(true);
setPriceStudy(true);
setStudyTitle("MidPoint");
setCursorLabelName("MidPoint");
}
//=========================================
function main () {
MidPoint = 0.5*(high() + low()); // Average of High and Low
drawLineRelative(7, MidPoint, 0, MidPoint, PS_SOLID, 1, Color.RGB(255,155,0), "MPB"+getCurrentBarCount());
return (MidPoint);
}
Comment