Unsupported Filling mode and Ordersend 4756 Error - page 2

 
Alexander Manfred Fleck #:

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

    // Prüfen, ob es Zeit ist, den Trade zu schließen
    if (!tradeOpened && currentHour == CloseHour && currentMinute == CloseMinute)
    {
        // Alle offenen Positionen durchlaufen
        for (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;