Support

Equilla Formula Language

ToolGetFirst

Returns the identifier of the first tool created by the script.

Remarks

If the function succeeded, the identifier of the first tool is returned, -2 otherwise.

Examples

Draw a channel between the highest high and lowest low
Input: Period(10, 1); Variables: price, id; If IsLastBar Then Begin While (ToolGetFirst() <;>; -2) ToolDelete(ToolGetFirst()); price = Highest(High, Period); DrawTrendline(Datetime[Period - 1], price, datetime, price, StyleSolid, 1, ColorBlue, ToolExtendRight + ToolDrawInBackground); price = Lowest(Low, Period); DrawTrendline(Datetime[Period - 1], price, datetime, price, StyleSolid, 1, ColorBlue, ToolExtendRight + ToolDrawInBackground); If BarStatus = BarStatusClosingTick Then Begin id = ToolGetFirst(); While (id <;>; -2) Begin ToolSetColor(id, ColorBlack); id = ToolGetNext(id); End; End; End;