|
Programmierung MQL4 Hier gehts rund ums Programmieren in MQL4. |
|
Themen-Optionen | Thema durchsuchen | Ansicht |
|
|||
BreakEven
Hallo zusammen,
ich habe da folgenden Code, den ich nutze: Code:
double BreakEvenKurs() { double AktuelleOpenLotsBETotal = 0; double AktuelleEinstiegeBETotal = 0; double aktuellerBE = 0; for(int Zaehler = 0; Zaehler <= OrdersTotal()-1; Zaehler++) { bool Orderwahl = OrderSelect(Zaehler, SELECT_BY_POS); if(Orderwahl == true && OrderSymbol() == Symbol()) { if(OrderType() == OP_BUY) { AktuelleOpenLotsBETotal = AktuelleOpenLotsBETotal + OrderLots(); AktuelleEinstiegeBETotal = AktuelleEinstiegeBETotal + (OrderOpenPrice()*OrderLots()); } else if(OrderType() == OP_SELL) { AktuelleOpenLotsBETotal = AktuelleOpenLotsBETotal + OrderLots(); AktuelleEinstiegeBETotal = AktuelleEinstiegeBETotal + (OrderOpenPrice()*OrderLots()); } } } if(AktuelleOpenLotsBETotal != 0) aktuellerBE = AktuelleEinstiegeBETotal / AktuelleOpenLotsBETotal; return(aktuellerBE); } Ja...und da steh ich jetzt etwas auf dem Schlauch. Denn einfach irgendwo die OrderCommission() und OrderSwap() dazurechnen bringt ja nichts, da kommen wilde Ergebnisse bei rum, was ja auch logisch ist. Vielleicht weis hier jemand eine (einfache) Lösung. |
Lesezeichen |
Stichworte |
breakeven, gebühren, kommission, mql4, programmierung, programmierung metatrader, programmierung mql4, swap |
|
|