I've been digging around the forums with some searches but this is about as close as I can get to what I'm thiking about. It's almost what I want, but with 1 caveat.
I would like to be able to draw a vertical line on the chart at a specified time, before that time is reached. As an example, a big fat red line at 2:15, since I never can tell what is going to happen when a Fed announcement is made.
This efs is simple and perfect for drawing vertical lines in the past, can I "anchor" a vertical line in the future ? ( and yes I know it can be done manually, I am using this as just an example for another purpose )
Best Regards,
Glenn
function preMain() {
setPriceStudy(true);
setStudyTitle("Time Bars");
}
function main() {
if ( hour(0) == 10 && minute(0) == 0 )
drawLineRelative(0, high(0)+1000, 0, 0, PS_DASHDOT, 1, Color.blue, "line"+getCurrentBarCount());
if ( hour(0) == 12 && minute(0) == 0 )
drawLineRelative(0, high(0)+1000, 0, 0, PS_DASHDOT, 1, Color.blue, "line"+getCurrentBarCount());
if ( hour(0) == 14 && minute(0) == 0 )
drawLineRelative(0, high(0)+1000, 0, 0, PS_DASHDOT, 1, Color.blue, "line"+getCurrentBarCount());
return null;
}
I would like to be able to draw a vertical line on the chart at a specified time, before that time is reached. As an example, a big fat red line at 2:15, since I never can tell what is going to happen when a Fed announcement is made.
This efs is simple and perfect for drawing vertical lines in the past, can I "anchor" a vertical line in the future ? ( and yes I know it can be done manually, I am using this as just an example for another purpose )
Best Regards,
Glenn
function preMain() {
setPriceStudy(true);
setStudyTitle("Time Bars");
}
function main() {
if ( hour(0) == 10 && minute(0) == 0 )
drawLineRelative(0, high(0)+1000, 0, 0, PS_DASHDOT, 1, Color.blue, "line"+getCurrentBarCount());
if ( hour(0) == 12 && minute(0) == 0 )
drawLineRelative(0, high(0)+1000, 0, 0, PS_DASHDOT, 1, Color.blue, "line"+getCurrentBarCount());
if ( hour(0) == 14 && minute(0) == 0 )
drawLineRelative(0, high(0)+1000, 0, 0, PS_DASHDOT, 1, Color.blue, "line"+getCurrentBarCount());
return null;
}
Comment