Expert Advisors and Automated Trading - page 22

I am getting a Unknown Critical error on line 14 while single stepping through XmlParserScript.mq5 in MetaEditor. why? How to fix? string res=xmldoc.SetXml(xml);
I'm just starting to program with MQL5 and I'm looking for a simple program to learn about trendline breakouts with price lines
Hi! I wanted to ask if someone can 'spot' me and double check if my logic is correct with regards to using a RSI to spot a market reversal by means of a using a 1minute RSI with a 14 period value. Is there any room for improvement for better accuracy? int OnInit () { RSIOneMinute = iRSI (
Hi, WHat is the replaced function of WindowExpertName() in MQL5 ? How can i get expert name in MQL5? Thanks
Hi guys anyone know why if i try to read a file ib folder file return me always zero ? #property strict input string TemplateName = "LINE" ; // Nome template (senza .tpl) input int ReadIntervalSeconds = 10 ; // Intervallo di lettura file (in secondi) string current_symbol = "" ; // Simbolo
hello everybody. I tried to create my first, simple, expert advisor to be use for XAUUSD. but when i put it into MT5 grafic, nothing happen.. it is not working. is there here someone more expert than me that can check the code and let me understand what is wrong ? thanks a lot in advance regards
Dear, I am facing the following problem when using Expert Advisors (EAS) in Metatrader 5: Although automatic negotiation is globally activated ("Autotrading" button in green) and the EA is correctly configured to allow live negotiation, I get messages like this in the terminal log: CTRADE
  problem with NormalizeDouble  (13   1 2)
Hi I have this code double result = NormalizeDouble (Current_Balance/ 20000 , _Digits ); When the balance is 200 $, the result is really 0.016 but the output is 0.02 !! I know that MT5 doesn't accept 0.016 as a certain volume so I'd like to set the "result" to 0.01 not 0.02. Please help me with
Is there another way to receive indicator alerts using a VPS? Is there a difference between EA alerts and indicator alerts
Folks, anyone know if it's possible to tile charts horizontally by an MQL5 api call or something ? alternatively, is there a way to set a hotkey for that ? thx
I'm getting this in weekdays and have put my codes inside if(IsTradeAllowed()) but my EA is still trying to open/close a trade I've seen some post mentioning that the broker will close their service to do something for 5 mins or so.
Folks, anyone know if it's possible to tile charts horizontally by an MQL5 api call or something ? alternatively, is there a way to set a hotkey for that ? thx
Hi all, I’m automating forward tests in MT5 portable using .ini files. MT5 launches with /config correctly, but Strategy Tester does not auto-run. No HTML report is created. All paths, .set, ExecutionMode=4, dates, etc. are set. Is there any way to force MT5 to auto-start the test when launched via
MetaTrader 5 produces different backtest results when you use exactly the same settings for the Visual Backtester and Non-Visual Backtester. When I use the Visual mode everything is normal and goes as expected, when I uncheck the visual mode hoping to get the same results but faster, this is what I
Good morning, I have an EA code that is giving me problems. I would like to replicate in code when I apply a 7-period SMA moving average on the 14-period RSI indicator and I tell it “first indicator data.” I thought it would be enough to take the RSI values and calculate a moving average on those
For some reason during optimization i only have access to 16 cores....How can i get access to the rest of my cores locally? I dont want to use the local network farm, as i remember i wasnt using more than 16
My EA has the following function: int GetHistories( ENUM_TIMEFRAMES timeframe) { MqlRates Rates[]; int copied = 0 ; ResetLastError (); string symbx= Symbol (); for ( int x= 0 ; x<mc.arrsymbx && ! IsStopped (); x++) { symbx=mc.DIRI[x]; string InpFileName = symbx + ".csv" ;
The uchar buffer array contents in MT5 is shown below: Message from DLL (len=19) in C++ reads: std::wstring myString = L "Hello from C++ DLL!\0\0" ; The uchar array contents is correct for the Unicoded text with '0' as part of each UTF-16 character. But MQL5 code string receivedString =
  Call Stack  (3)
While debugging in MetaEditor, is there a way to view the current Call Stack at a breakpoint
I would like to use an array of arrays as in the following code double data[ 2 ][ 1 ]; int indicatorIndex; int OnInit () { int index = indicatorIndex++; SetIndexBuffer (index,data[ 0 ], INDICATOR_DATA ); index = indicatorIndex++; SetIndexBuffer (index, data[ 1 ], INDICATOR_DATA ); } ... But
void OnStart () { Comment ( AccountInfoDouble ( ACCOUNT_PROFIT )); } It always returns 0.0
I'm a little rusty on my coding, but used to code C++ in Qt and KDE. The Medtaeditor reminds me very much of C++. I was coding the Ichimoku editor, and decided I liked the idea of using object oriented programming with CiIchimoku. Right off the bat I noticed that the Chikou data was retrieved by
Hello friends I want to know how can I get LocalTime() Or TimeCurrent() while using strategy tester. As Default during testing in the Strategy Tester , TimeCurrent() is simulated according to historical data. I need the time that are not refers to historical data. is there any DLL to get current
double var_dbl[ 5 ]; long var_long[ 5 ]; void OnStart () { ArrayInitialize (var_dbl, 123 ); ArrayInitialize (var_long, 123 ); ArrayPrint (var_dbl); ArrayPrint (var_long); //Result //var_dbl[123, 123, 123, 123, 123] //var_long[0, 0, 0, 0, 0] } Everyone can test it. Fix it please. Thank you
Validation when publishing Expert Adviser I received a "Not enough money" error, how can I fix it? No issues were encountered in backtesting or live trading
while(!FileIsEnding(h)) { string str = FileReadString(h); } Journal: 2025.06.29 01:40:56.806 MQL5 VirtualAlloc failed in large allocator, size=555032 Experts: 2025.06.29 01:40:56.806 (EURUSD,H1) out of memory in 'MyClass_File.mqh' (1310,15) The (1310,15) is string str = FileReadString(h);
The period switch of the chart in the K-line playback function of MT5 disappeared. How to restore it
Basically I just want to be able to check if there are news events so I could pause my program momentarily for a few minutes to avoid volatility
I am having issues with my simulations, it happens visual mode my expert works as it should, but when I try non - visual mode, shows a lot of mistakes , my expert is a multiframe expert that looks for several timeframes from biggest to smallest with confirmations in several times. I don´t think it
  Strange results of testing  (19   1 2)
Hello. I have coded EA and when start testing figure out strange things ( may be it strange just for me :) ) but want to understand how it possible. Test in Roboforex : test in ICMarket : Positions was opened and closed +- with the same price and same lot , but Roboforex make 161.62 $ lost and