I think i dont see the little Problem in the code. COmpile error is 'PositionClose' - undeclared identifier10925
U understand that a function won't work if it's not part of the API or if it hasn't been defined?
that would make more sense
// Prüfen, ob es Zeit ist, den Trade zu schließenif (!tradeOpened && currentHour == CloseHour && currentMinute == CloseMinute)
{
// Alle offenen Positionen durchlaufenfor (int i = PositionsTotal() - 1; i >= 0; i--)
{
if (PositionSelect(_Symbol))
{
if (PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)
{
tradeOpened = true;
Print("Buy-Trade geschlossen.");
}
}
else
{
Print("Keine offene Buy-Position für das Symbol gefunden.");
}
}
}
if(PositionsTotal()== 0) tradeOpened = false;
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I think i dont see the little Problem in the code. COmpile error is 'PositionClose' - undeclared identifier 109 25
U understand that a function won't work if it's not part of the API or if it hasn't been defined?
that would make more sense