For example, I use the following code (which I've found in Project Management) to display a horizontal price line which updates on each tick:
Code: Select all
vars: intrabarpersist need_delete_this_bar(false);
if lastbaronchart then begin
value10 = TL_New(date, time-2400, close, date, time, close);
Value1 = TL_SetColor (value10, white);
value1 = TL_SetExtRight (value10, true);
value1 = TL_SetExtLeft (value10, false);
value1 = TL_setsize (value10, 1);
value1 = TL_Setstyle (value10, 2);
need_delete_this_bar = not need_delete_this_bar and value10 > 0 AND value10 <> value10;
value11 = tl_getfirst(1);
if tl_getnext(value11, 1) > 0 and need_delete_this_bar then value1 = TL_Delete(value11);
if barstatus = 2 then need_delete_this_bar = false;
The price line can be manually locked via context menu, but as soon as the price is updated (and the price line moves), the line is unlocked again.
When the chart is grabbed in order to drag it along the time axis, it easily happens that you accidently grab the price line and move it.
So is there a reserved word in EL to lock drawings, or to be more precise, to prevent manually dragging them?