Wie soll jemand eine Antwort geben, wenn so wenig Informationen vorliegen und kein Quellcode zur Analyse verfügbar ist? Wir können nur spekulieren!
Wenn es sich um ein Marktprodukt oder ein Produkt eines Drittanbieters handelt, sollten Sie dies mit dem Autor besprechen und nicht im Forum.
How do you expect anyone to provide an answer with so little information and no source code to analyse? All we can do is speculate!
If this is about a Market product or by a 3rd party, then you should discuss it with the author, and not the forum.
Das ist falsch. Wenn Sie auf MT5 den Strategietester mit der Modellierung „Jeder Tick basiert auf realen Ticks“ ausführen, werden die realen Geld- und Briefkurse und damit der reale Spread verwendet. Nur die anderen Modellierungsmethoden verwenden virtuelle oder synthetisierte Tick-Werte, die auf den M1-Balken basieren.
Außerdem hat der ursprüngliche Verfasser weder ausreichende Informationen noch Code zur Verfügung gestellt, damit wir eine angemessene Antwort analysieren und geben können.
That is incorrect. On MT5, if you run the Strategy Tester with the modelling "Every tick based on real ticks", it will use the real Bid and Ask prices, and therefore the real Spread. Only the other modelling methods uses virtual or synthesised tick values based on the M1 bars.
Also, the original poster, has not provided sufficient information nor even code for us to analyse and provided an adequate answer.
Das ist falsch. Wenn Sie auf MT5 den Strategietester mit der Modellierung „Jeder Tick basiert auf realen Ticks“ ausführen, werden die realen Geld- und Briefkurse und damit der reale Spread verwendet. Nur die anderen Modellierungsmethoden verwenden virtuelle oder synthetisierte Tick-Werte, die auf den M1-Balken basieren.
Außerdem hat der ursprüngliche Verfasser weder ausreichende Informationen noch Code zur Verfügung gestellt, damit wir eine angemessene Antwort analysieren und geben können.
That is incorrect. On MT5, if you run the Strategy Tester with the modelling "Every tick based on real ticks", it will use the real Bid and Ask prices, and therefore the real Spread. Only the other modelling methods uses virtual or synthesised tick values based on the M1 bars.
Also, the original poster, has not provided sufficient information nor even code for us to analyse and provided an adequate answer.
Das beginnt ja schon mit mit der Zeit der abgesetzten Order.
Falsch formatierter Beitrag vom Moderator bearbeitet. Fügen Sie entweder die Quelldatei bei oder verwenden Sie die Schaltfläche CODE (Alt-S), wenn Sie Code oder Protokollausgaben einfügen – https://www.mql5.com/de/articles/24#insert-code
//+------------------------------------------------------------------+ //| SpreadTrader.mq5 | //| Copyright 2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2025, MetaQuotes Ltd." #property link " https://www.mql5.com " #property version "1.00" #include <Trade\Trade.mqh> #include <Trade\SYmbolInfo.mqh> #include <Trade\PositionInfo.mqh> #include <Trade\OrderInfo.mqh> // Declaration variable for librari trade function. CTrade trade; CSymbolInfo m_symbol; CPositionInfo m_position; COrderInfo m_order; input double lotSize,MyProfit,EURlotSize; input int Slippage,X,Y; bool NoTrade; int MagNum=777777; input int TrailStopBuy=50; input int TrailStopSell=50; input int StartHourAM = 2; // HandelsbeginnAM (z. B. 9 Uhr) input int EndHourAM = 11; // HandelsendeAM (z. B. 12 Uhr) input int StartHourPM = 14; // HandelsbeginnPM (z. B. 13 Uhr) input int EndHourPM = 20; // HandelsendePM (z. B. 22 Uhr) input bool TradeMonday = true; input bool TradeTuesday= true; input bool TradeWednesday = true; input bool TradeThursday = true; input bool TradeFriday = true; input double StopLossSell;//SL SellStop input double StopLossBuy;//SL BuyStop //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- create timer EventSetTimer(60); if(!m_symbol.Name(_Symbol)) return INIT_FAILED; // Set Trade parameter trade.SetTypeFillingBySymbol(m_symbol.Name()); trade.SetExpertMagicNumber(MagNum); StartingStep(); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer EventKillTimer(); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { StartingStep(); Trail(); EraseOnePending(); CloseAllPositions(); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- } //+------------------------------------------------------------------+ //| Trade function | //+------------------------------------------------------------------+ void OnTrade() { //--- } //+------------------------------------------------------------------+ //| TradeTransaction function | //+------------------------------------------------------------------+ void OnTradeTransaction(const MqlTradeTransaction& trans, const MqlTradeRequest& request, const MqlTradeResult& result) { //--- } //+------------------------------------------------------------------+ //| BookEvent function | //+------------------------------------------------------------------+ void OnBookEvent(const string &symbol) { //--- } //+------------------------------------------------------------------+ // Function to check if there are open orders //bool CheckOpenOrders() // { // for(int i=0; i<OrdersTotal(); i++) // loop all Open Positions // if (OrderSelect(i)) { // // // if (Order(ORDER_MAGIC)==MagNum) // { // Print("Es ist eine P offen mit der MagNum:",MagNum); // return(true); // } // // // } // Print("Es gibt keine offene P mit der Magnum:",MagNum); // // return(false); // } // //+----------------------------------------------------------------+ //| Existiert eine Pending-Order //+----------------------------------------------------------------+ bool IsDuplicateBuyStopOrder() { int Orders = OrdersTotal(); string order_type; bool istda=false; for (int i = 0; i < Orders; i++) { order_type=EnumToString(ENUM_ORDER_TYPE(OrderGetInteger(ORDER_TYPE))); if (order_type=="ORDER_TYPE_BUY_STOP") { Print("Es existiert schon eine BuyStop-Order",i); istda= true; // Duplikat gefunden } else { Print("Es existiert keine BuyStop-Order"); // istda= false; // Keine Duplikate gefunden } } return istda; } //+------------------------------------------------------------------ //| Existiert eine Sell-Stop-Order //+------------------------------------------------------------------+ bool IsDuplicateSellStopOrder() { bool istda=false; int Orders = OrdersTotal(); string order_type; for (int i = 0; i < Orders; i++) { order_type=EnumToString(ENUM_ORDER_TYPE(OrderGetInteger(ORDER_TYPE))); if (order_type=="ORDER_TYPE_SELL_STOP") { Print("Es existiert schon eine SellStop-Order"); istda= true; // Duplikat gefunden break; } else { Print("Es existiert keine SellStop-Order"); } } return istda; } //+------------------------------------------------------------------+ //| Starting the EA | //+------------------------------------------------------------------+ void StartingStep() { double ask=SymbolInfoDouble("USDJPY-Z",SYMBOL_ASK); double bid=SymbolInfoDouble("USDJPY-Z",SYMBOL_BID); double spread=ask-bid; int spread_points=(int)MathRound(spread/SymbolInfoDouble("USDJPY-Z",SYMBOL_POINT)); //double vbid = MarketInfo("USDJPY-Z",MODE_BID); //double vask = MarketInfo("USDJPY-Z",MODE_ASK); //double vpoint = MarketInfo("USDJPY-Z",MODE_POINT); //int vdigits = (int)MarketInfo("USDJPY-Z",MODE_DIGITS); //int vspread = (int)MarketInfo("USDJPY-Z",MODE_SPREAD); int Orders=OrdersTotal(); if((Orders==0)&&TradeAllow()&&PositionsTotal()==0) { MqlTick tick[1]={}; trade.BuyStop(lotSize,(SymbolInfoDouble("USDJPY-Z", SYMBOL_ASK)+(Y*_Point)),"USDJPY-Z", NormalizeDouble(ask - StopLossBuy * _Point, _Digits), 0.0,0,0 ,"BuyStopEUR"); Print("Info Bid: ",bid," Info Ask: ",ask); trade.SellStop(lotSize,(SymbolInfoDouble("USDJPY-Z", SYMBOL_BID)-(X*_Point)),"USDJPY-Z", NormalizeDouble(bid+ StopLossSell * _Point, _Digits), 0.0,0,0,"SellStopEUR"); if(!SymbolInfoTick("USDJPY-Z", tick[0])) { Print("SymbolInfoTick() failed. Error ", GetLastError()); return; } Print("Info Bid: ",bid," Info Ask: ",ask); } //if (Orders==1) {CloseAllPositions();} } //+------------------------------------------------------------------+ // Alle Pos schließen //+------------------------------------------------------------------+ void CloseAllPositions() { double totalProfit = 0.0; NoTrade=false; for(int i = 0; i < PositionsTotal(); i++) { if(m_position.SelectByIndex(i)) { if(PositionGetSymbol(i) == "USDJPY-Z") { totalProfit=totalProfit+PositionGetDouble(POSITION_PROFIT); } } } Print("GuV=",totalProfit); if((totalProfit >= MyProfit)||(PositionsTotal()>1)) { for(int i = PositionsTotal() - 1; i >= 0; i--) // loop all Open Positions if(m_position.SelectByIndex(i)) // select a position { trade.PositionClose(m_position.Ticket()); // then delete it --period DeleteAllPendingOrders(); //Sleep(100); // Relax for 100 ms Print("Positions", "Positions " + (string)PositionsTotal(), 100, 80, 20, BLASRANGE_A); //Re write number of positions on the chart } } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Delete all pending orders | //+------------------------------------------------------------------+ void DeleteAllPendingOrders() { for(int i=OrdersTotal()-1;i>=0;i--) // returns the number of current orders if(m_order.SelectByIndex(i)) // selects the pending order by index for further access to its properties if(m_order.Magic()==MagNum) trade.OrderDelete(m_order.Ticket()); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void Trail () { // Loop through all open positions for(int i = PositionsTotal() - 1; i >= 0; i--) { // Get position ticket ulong ticket = PositionGetTicket(i); if(ticket > 0) { // Retrieve position details if(PositionSelectByTicket(ticket)) { double openPrice = PositionGetDouble(POSITION_PRICE_OPEN); double stopLoss = PositionGetDouble(POSITION_SL); double currentPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); double trailingStopBuy = TrailStopBuy * _Point; // Example: 50 points trailing stop double trailingStopSell = TrailStopSell * _Point; // Example: 50 points trailing stop // Check if it's a BUY position if((PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)&& (currentPrice>openPrice+trailingStopBuy)) { double newStopLoss = currentPrice - trailingStopBuy; if(newStopLoss > stopLoss) { // Modify the stop loss trade.PositionModify(ticket, newStopLoss, PositionGetDouble(POSITION_TP)); } } // Check if it's a SELL position else if((PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL)&&(currentPrice<openPrice-trailingStopSell)) { double newStopLoss = currentPrice + trailingStopSell; if(newStopLoss < stopLoss || stopLoss == 0) { // Modify the stop loss trade.PositionModify(ticket, newStopLoss, PositionGetDouble(POSITION_TP)); } } } } } } void EraseOnePending() { int OneOrder; OneOrder=OrdersTotal(); if (OneOrder==1) { DeleteAllPendingOrders(); } } bool TradeAllow() { bool Allowed=false; datetime currentTime = TimeCurrent(); MqlDateTime dt; TimeToStruct(currentTime, dt); // Wochentag prüfen (0 = Sonntag, 1 = Montag, ..., 6 = Samstag) bool isTradingDay = (dt.day_of_week == 1 && TradeMonday) || (dt.day_of_week == 2 && TradeTuesday) || (dt.day_of_week == 3 && TradeWednesday) || (dt.day_of_week == 4 && TradeThursday) || (dt.day_of_week == 5 && TradeFriday); // Uhrzeit prüfen bool isTradingTime = ((dt.hour >= StartHourAM && dt.hour < EndHourAM)||(dt.hour >= StartHourPM && dt.hour < EndHourPM)); if(isTradingDay && isTradingTime) { // Hier kannst du deine Handelslogik einfügen Print("Trading erlaubt: ", dt.day_of_week, " um ", dt.hour, " Uhr"); Allowed=true; } return Allowed; }
- 2025.09.21
- www.mql5.com
- Ich würde niemals eine 'Handelsfunktion' wie StartingStep() in Deinem Fall in OnInit aufrufen!
- Der Code ist zwar nett, aber Du willst doch den Unterschied zwischen live und Tester ve4rstehen. Bessert wäre es daher wenn Du die wichtigen Informationen in StartingStep() ausdruckst zB. Volume, Spread, .. aber auch die Zeit (TimeCurrent()) nicht nur Bid und Ask. Dann lässt Du den EA heute live laufen und morgen im visuellen Modus im Tester mit gleicher Beginnzeit.
- Ich würde niemals eine 'Handelsfunktion' wie StartingStep() in Deinem Fall in OnInit aufrufen!
- Der Code ist zwar nett, aber Du willst doch den Unterschied zwischen live und Tester ve4rstehen. Bessert wäre es daher wenn Du die wichtigen Informationen in StartingStep() ausdruckst zB. Volume, Spread, .. aber auch die Zeit (TimeCurrent()) nicht nur Bid und Ask. Dann lässt Du den EA heute live laufen und morgen im visuellen Modus im Tester mit gleicher Beginnzeit.
Wenn Sie den Strategietester mit der Modellierungsmethode „Jeder Tick anhand realer Ticks“ ausführen, werden genau dieselben realen Bedingungen verwendet. Jede andere Modellierungsmethode führt zu anderen Ergebnissen.
(Der englische Originaltext wurde automatisch übersetzt.)
If you run the Strategy Tester using the modelling method "Every tick based on real ticks", then it will use the exact same real conditions. Any other modelling method will give different results.
n Strategietester mit der Modellierungsmethode „Jeder Tick anhand realer Ticks“ ausführen, werden genau dieselben realen Bedingungen verwendet. Jede andere Modellierungsmethode führt zu anderen Ergebnissen.
seit wann macht er das? ich habe immer anhand realer Ticks getestet und hab damit aufgehört weil er das nie so gemacht hat
fällt bei den meisten Brokern nicht auf, weil der spread gleichbleibend ist. aber wen man einen Broker hat, der am Wochenende die Spreads in die höhe gibt ist das immer lästig gewesen
- Freie Handelsapplikationen
- Über 8.000 Signale zum Kopieren
- Wirtschaftsnachrichten für die Lage an den Finanzmärkte
Sie stimmen der Website-Richtlinie und den Nutzungsbedingungen zu.

Warum schießt der Strategietester an der Realität völlig vorbei?
Hallo liebe Gemeinde,
ich lasse meinen EA auf dem VPS mit Real-Konto laufen. Wenn ich dann den Strategietester drüber laufen lasse kommen völlig andere Trades zustande.
Weis jemand warum das so ist?
Real:
Vom Moderator bearbeitet, um Text und Anhänge aus dem entfernten doppelten Thema einzufügen.
Warum kann der MT5 Strategietester keine korrekten Ergebnisse reproduzieren?
Mein EA läuft 24/7 auf VPS mit Real-Konto. Seine Ergebnisse kann aber der Strategietester nicht ansatzweise reproduzieren. Erzeugt er nur Fantasiezahlen?
Beispiel 19.09.25 tatsächlich gelaufene Trades:
In der Anlage die Ergebnisse des Testers: