Forum

Testing strategies

How do others ensure their MQL5 code is functionally correctly? Coming from a software engineering background, I feel quite limited in the software testing options available for this. I have mostly manually tested my MQL5 code to date; however, as it grows in complexity, this (and the financial

OrderCalcProfit() problem

I have run into an intermittent problem with the OrderCalcProfit() function, can anyone help me see what might be causing it? I am using OrderCalcProfit() to determine the lot-size of a position such that it has a given risk based on percentage of my account. e.g. I want each trade to lose 0.5% of

Economic calendar timing out (ERR_CALENDAR_TIMEOUT)

I would like to add a news filter to my EAs. My plan is to build a service that will pull data from the brokers economic calendar and populate a local database. EAs would then use this database to avoid trading during certain news events; both for live testing and back testing. Unfortunately, I

Help with iBarShift

Hi. I was hoping someone could help me to understand iBarShift as it should do exactly what I'm looking for based on the documentation, but it's actual results are not what I'm expecting. In particular, I had understood by setting the parameter exact to true that the given time must line up to the

How do you define a custom comparer

Hi. I am trying and failing to create custom comparers for generic collections of objects in MQL5. Can someone please help me work out what I'm doing wrong? Here is a minimal example of what I've tried. #property indicator_chart_window #include <Generic/ArrayList.mqh> #include