Hi.
I've got a formula that works fine that will plot a horizontal ray starting from the low of the selected bar. I would like to alter the formula so that instead of plotting the low, if I point at the high of a bar I want to lock the line to that high and if I point to the low I want the line to lock to the low. The formula is quite long but I think that the part that I need to alter is the part that I have pasted below. Can someone please tell me how to plot the nearest high or low of the bar depending on which part of the bar I point at?
Thanks
y = GetCursorXPosition(0);
LineLevel = Low; //IIf(y - SelectedValue(High) < y - SelectedValue(Low),SelectedValue(High),SelectedValue(Low));
function SupResLineLong_func(x1)
{
SRLineArray = Null;
SRLinestop = 0;
SRLinestop = LineLevel[x1];
SRLineArray[x1] = SRLinestop;
for( i = x1 + 1; i < BarCount; i++ )
{
if( SRLinestop > 0 )
{
SRLineArray [ i ] = SRLinestop;
}
}
return SRLineArray;
}