Liquidity_Predator/Visualize/Line/M_SetLine.mqh

17 lines
No EOL
433 B
MQL5

void M_SetLine(string LineName, int LineNumber, double price, color Clr)
{
string FullLineName = LineName + IntegerToString(LineNumber);
// check if object exists, otherwise create a new one
if(ObjectFind(0, FullLineName) < 0)
{
M_CreateLine(FullLineName, Clr, price);
}
else
{
// Move endpoint to actual time
ObjectMove(0, FullLineName, 1, TimeCurrent(), price);
}
}