Hallo,
Ich bin neu in EA Programmieren und Lese hier alles was ich finde. Eins versteh ich nicht was das Void immer zusagen hat?.
Ich wollte den Breakeven bei mir einsetzen aber irgendwie funktioniert es nicht !
Vieleicht könnte ein Profi mal drüber schauen.
HTML-Code:
extern double UpdateToBE = 10 ;
bool LongTrade,ShortTrade;
//Globale Variablen
string Signal;
datetime PeriodenStartzeit;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
void UpdateBE()
{
//---Überprüfen der Starzeit
PeriodenStartzeit = Time[0];
//---Breakeven Starten
///-----+++ Break Even setzen
{
if(UpdateToBE <= 0)
return;
for(int i = OrdersTotal()-1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderType() == OP_BUY && OrderOpenPrice() > OrderStopLoss() && Bid - OrderOpenPrice() >= UpdateToBE * Point)
{
OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0);
}
if(OrderType() == OP_SELL && OrderOpenPrice() < OrderStopLoss() && OrderOpenPrice() - Ask >= UpdateToBE * Point)
{
OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0);
}
}
}
}
return;
}