Hi,
i draw a vertical line with hand and want to get the barindex in afl.
I can do it with a free drawed line, but not with a vertical line.
sample:
Study is "SU":
StartBarX = LastValue( ValueWhen( ExRem( SU, 0 ), BarIndex() ) );
That works with a free drawed line, with SU as ID. How can I do that with a vertical line?

@htrader I asked exactly the same question over 3 years ago on the Yahoo Group and got this reply from @aron - thanks for that I remember this as if it was yesterday as I was a newcomer then

Study() function will not return any values in case of a vertical line, therefore the study line goes undetected.

Plot( C , "", colorDefault );
st = Study( "ST", GetChartID());
Title = "Values: ";
for( i = 0; i < BarCount; i++ )
{
value = st[i] ;
if ( value )
Title += "\n" + value;
}

Summing up - I'm afraid, you can't use vertical Study() the way you want. Here is this thread: Link

Yes, I know that. That's why I have shown you the above (@aron 's ) example.

By the way, if you draw a trendline holding X key pressed, you will get perfect vertical line. Similarily when you draw a trendline with Y key pressed, you will get perfect horizontal line (which can be shorter than when using Horizontal line Tool).

Added X/Y constaints for drawing tools. When you hold down "Y" key, start and end Y co-ordinates are set to equal value (with trend line it gives horizontal line ). When you hold down "X" key you get perfectly vertical line (X start/end set to equal value)