Codes

Ascending Sort A Struct Array By A Field Example for MetaTrader 5

This is an example of ascending sort a struct list by a field. You can find out and customize the above algorithm depending on the purpose of use, this is the most basic example is also a direction to resolve the arrangement in an array of structure. The algorithm used in this example is Quick Sort

SAR ADX Signal for MetaTrader 5

SAR ADX Signal with mobile notification, rewritten from MT4 version (source no longer found). This is a repaintable indicator, please be careful when using it

No Repaint Heiken Ashi for MetaTrader 5

The Heiken Ashi indicator with no repaint or repaint mode input option

Forum

CharArrayToString bug with build 5660

I just discovered an error when decoding base64 code after updating the terminal (in previous versions this error was not encountered) string Base64Encode( string text) { uchar src[], dst[], key[] = {}; StringToCharArray (text, src, 0 , - 1 , CP_UTF8 ); ArrayResize (src, ArraySize (src) - 1 );

Error: Invalid tick after extend

Sometimes it happens, I don't know why

What happened to Algo Forge MT5 Build 5200?

Nothing changes but all files marked as modified? Is that a new feature

AccountInfoDouble(ACCOUNT_PROFIT) Error

void OnStart () { Comment ( AccountInfoDouble ( ACCOUNT_PROFIT )); } It always returns 0.0

Is there a way to restart the test with changed input programmatically?

The specific idea is as follows: EA has inputs: int countorders= 1 string timeclose = "5:00" double lot = 0.04 ... After running, EA returns a result set of inputs in a file as follows: countorders = 4 timeclose = "7:25" lots = 0.04 ... Start testing again with that input and continue repeating X

Real Time CustomRatesUpdate() Eat A Lot Of Disk Space !!!

I'm using CustomRatesUpdate() function . It costs up to 2-3GB of disk space on real time running interval 1 sec in 24 hours (version A) but while I copy M1 timeframe data from server then CustomRatesUpdate() from 8/2024 just in 7MB (version B) . CustomRatesReplace() also has the same effect Version

OnTradeTransaction : Not Catching Enough Events When Performing Close All Positions Bulk Operation

I tested this code without errors when closing each position one at a time. But when performing Close All Positions Bulk Operation, it does not recognize enough events. You can watch the video for more information. int OnInit () { //--- return ( INIT_SUCCEEDED ); } void OnDeinit ( const int

Optimization Result Different From Single Result

I just realized it after retesting the results with a single test. I rechecked some random passes, they all did not work as optimized results. I rechecked the parameters, and it's the same. I have no idea why it happened like that. My EA doesn't use iCustom or external resources. Since it's not

Storage Error: Failed Creating Diff Data

I got this error while committing files to MQL5 storage . I tried: - Restart MT5 several times - Relogging my account But still getting this error. MQL5 recently has errors that are tough to explain

Backtesting Status Never Completed, Empty Backtest Report

I have a problem when performing a backtest. After finishing the test, I don't have the results of the Backtest report, the status always stops at around 98-99%. And I don't have any error message in the logging tab. When I profile history, my program doesn't have an infinite loop. I noticed that