Liquidity_Predator/Visualize/Boxes/M_ExtendBox.mqh

25 lines
663 B
MQL5
Raw Permalink Normal View History

2026-02-12 17:09:03 +01:00
bool M_ExtendBox(string BoxName, int BoxNumber)
{
string FullBoxName = BoxName + IntegerToString(BoxNumber);
ResetLastError();
2026-02-12 17:44:40 +01:00
if(ObjectFind(0, FullBoxName) < 0)
2026-02-12 17:44:40 +01:00
{
M_LogError("Object not found: " + FullBoxName);
return false;
}
else
{
double price = ObjectGetDouble(0, FullBoxName, OBJPROP_PRICE, 1);
datetime barTime = iTime(_Symbol, PERIOD_CURRENT, 0);
ObjectMove(0, FullBoxName, 1, barTime, price);
if(GetLastError() != 0)
{
M_LogError("An error occured when extending box " + FullBoxName + ", Error: " + IntegerToString(GetLastError()));
}
2026-02-12 17:44:40 +01:00
}
2026-02-12 17:09:03 +01:00
return true;
}