MolemoDibe_27:
Hi folks,
I am having problem with my tester not showing entry signals even when I test the strategy live(the trades don't open). The same strategy works fine on the account with both strategy tester and live test, the entry signals show. So, I am assuming that they must some setting that I must set.
I checked the visual mode when I do strategy test. But most important thing is that the different strategies are complied with no errors.
If you can copy and check if the strategy works on your side and maybe the is a line of code needed for the entry signals to be visible and trade to open.
The screenshot shows that the strategy complied.
I really appreciate any help.
Hi folks,
I am having problem with my tester not showing entry signals even when I test the strategy live(the trades don't open). The same strategy works fine on the account with both strategy tester and live test, the entry signals show. So, I am assuming that they must some setting that I must set.
I checked the visual mode when I do strategy test. But most important thing is that the different strategies are complied with no errors.
This class of the strategy I used .mqh
This is the .mq5 file, the strategy related to the above code.
Please help with this, because all the strategy I code myself don't work on my account but work on other account. And the other thing is that the example or robots that came with the mql5 work and shows entry signals.If you can copy and check if the strategy works on your side and maybe the is a line of code needed for the entry signals to be visible and trade to open.
The screenshot shows that the strategy complied.
I really appreciate any help.
According to what I read, all forms of immediate execution orders require the type_filling field to be set.

Documentation on MQL5: Constants, Enumerations and Structures / Data Structures / Trade Request Structure
- www.mql5.com
Interaction between the client terminal and a trade server for executing the order placing operation is performed by using trade requests. The...
Thank you, I got it to work on the same code provided before, I was just using wrong order. However I cant get it to work on time based strategy.
The code was in MQL4, i used ChartGPT to help with conversion to MQL5.
I don't not if the limit are not met or they is a problem with the code.
I would appreciate any help that might be with the code for entry signals or anything.
Thanks in advance.
The code was in MQL4, i used ChartGPT to help with conversion to MQL5.
I don't not if the limit are not met or they is a problem with the code.
I would appreciate any help that might be with the code for entry signals or anything.
Thanks in advance.
//+------------------------------------------------------------------+ //| Demo.mq5 | //| Copyright 2023, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2023, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.01" #property description "Demo" #property indicator_chart_window #property indicator_buffers 2 #property indicator_type1 DRAW_ARROW #property indicator_width1 5 #property indicator_color1 0xFFAA00 #property indicator_label1 "Buy" #property indicator_type2 DRAW_ARROW #property indicator_width2 5 #property indicator_color2 0x0000FF #property indicator_label2 "Sell" #define PLOT_MAXIMUM_BARS_BACK 5000 #define OMIT_OLDEST_BARS 50 double Buffer1[]; // Buy signals double Buffer2[]; // Sell signals datetime time_alert; double myPoint; input double tradeVolume = 0.1; // Trade volume (lots) input double maxSpread = 5.0; // Maximum allowable spread (points) // Order placement function bool PlaceOrder(bool isBuy) { MqlTradeRequest request; MqlTradeResult result; ZeroMemory(request); ZeroMemory(result); request.action = TRADE_ACTION_DEAL; request.symbol = _Symbol; request.volume = tradeVolume; request.type = isBuy ? ORDER_TYPE_BUY : ORDER_TYPE_SELL; request.price = isBuy ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID); request.deviation = 50; request.type_filling = ORDER_FILLING_IOC; request.type_time = ORDER_TIME_GTC; request.comment = isBuy ? "Buy Order" : "Sell Order"; if (!OrderSend(request, result)) { Print("Order placement failed. Error: ", GetLastError()); return false; } Print("Order placed successfully. Order ID: ", result.order); return true; } // Alert function for logging or messaging void myAlert(string type, string message) { if (type == "print") Print(message); else if (type == "error") Print(type + " | Demo @ " + Symbol() + ", " + IntegerToString(Period()) + " | " + message); else if (type == "indicator") Print(type + " | Demo @ " + Symbol() + ", " + IntegerToString(Period()) + " | " + message); } // Initialization function int OnInit() { // Set up indicator buffers SetIndexBuffer(0, Buffer1, INDICATOR_DATA); PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, EMPTY_VALUE); PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, MathMax(Bars(_Symbol, _Period) - PLOT_MAXIMUM_BARS_BACK + 1, OMIT_OLDEST_BARS + 1)); PlotIndexSetInteger(0, PLOT_ARROW, 241); SetIndexBuffer(1, Buffer2, INDICATOR_DATA); PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, EMPTY_VALUE); PlotIndexSetInteger(1, PLOT_DRAW_BEGIN, MathMax(Bars(_Symbol, _Period) - PLOT_MAXIMUM_BARS_BACK + 1, OMIT_OLDEST_BARS + 1)); PlotIndexSetInteger(1, PLOT_ARROW, 242); // Initialize myPoint for broker digits myPoint = Point(); if (Digits() == 5 || Digits() == 3) myPoint *= 10; return (INIT_SUCCEEDED); } // Main calculation function int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { int limit = rates_total - prev_calculated; // Initialize arrays ArraySetAsSeries(Buffer1, true); ArraySetAsSeries(Buffer2, true); if (prev_calculated < 1) { ArrayInitialize(Buffer1, EMPTY_VALUE); ArrayInitialize(Buffer2, EMPTY_VALUE); } else limit++; // Main calculation loop for (int i = limit - 1; i >= 0; i--) { if (i >= MathMin(PLOT_MAXIMUM_BARS_BACK - 1, rates_total - 1 - OMIT_OLDEST_BARS)) continue; int barshift_M1 = iBarShift(Symbol(), PERIOD_M1, time[i]); if (barshift_M1 < 0) continue; double spread = (SymbolInfoDouble(_Symbol, SYMBOL_ASK) - SymbolInfoDouble(_Symbol, SYMBOL_BID)) / _Point; if (iClose(NULL, PERIOD_M1, barshift_M1) > iOpen(NULL, PERIOD_M1, barshift_M1)) { Buffer1[i] = iLow(NULL, PERIOD_M1, barshift_M1); if (i == 0 && time[0] != time_alert) { if (spread <= maxSpread) { if (PlaceOrder(true)) myAlert("indicator", "Buy Order Placed"); } else myAlert("error", "Spread too high for Buy order"); time_alert = time[0]; } } else { Buffer1[i] = EMPTY_VALUE; } if (iClose(NULL, PERIOD_M1, barshift_M1) < iOpen(NULL, PERIOD_M1, barshift_M1)) { Buffer2[i] = iHigh(NULL, PERIOD_M1, barshift_M1); if (i == 0 && time[0] != time_alert) { if (spread <= maxSpread) { if (PlaceOrder(false)) myAlert("indicator", "Sell Order Placed"); } else myAlert("error", "Spread too high for Sell order"); time_alert = time[0]; } } else { Buffer2[i] = EMPTY_VALUE; } } return (rates_total); }
MolemoDibe_27 #: The code was in MQL4, i used ChartGPT to help with conversion to MQL5.
Please, don't request help for ChatGPT (or other A.I.) generated code. It generates horrible code, mixing MQL4 and MQL5.
Either learn to code manually or use the Freelance section for such requests — https://www.mql5.com/en/job

Trading applications for MetaTrader 5 to order
- 2025.01.01
- www.mql5.com
The largest freelance service with MQL5 application developers

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am having problem with my tester not showing entry signals even when I test the strategy live(the trades don't open). The same strategy works fine on the account with both strategy tester and live test, the entry signals show. So, I am assuming that they must some setting that I must set.
I checked the visual mode when I do strategy test. But most important thing is that the different strategies are complied with no errors.
This class of the strategy I used .mqh
This is the .mq5 file, the strategy related to the above code.
If you can copy and check if the strategy works on your side and maybe the is a line of code needed for the entry signals to be visible and trade to open.
The screenshot shows that the strategy complied.
I really appreciate any help.