Ciro Soto / Publications
Codes
Useful #define statements for MetaTrader 5
These are some #define statements that are useful to perform operations in your EA. You only need to assign the name of your variables at the beginning of the file, and then let the other #define statements do the work. In order to use this file, add #include to the first line in your EA file
Articles
A Generic Optimization Formulation (GOF) to Implement Custom Max with Constraints for MetaTrader 5
In this article we will present a way to implement optimization problems with multiple objectives and constraints when selecting "Custom Max" in the Setting tab of the MetaTrader 5 terminal. As an example, the optimization problem could be: Maximize Profit Factor, Net Profit, and Recovery Factor
Forum
Setting the Input Parameters for the Strategy Tester Programmatically
Hi all, I want to use the strategy tester to perform a Monte Carlo sensitivity analysis of an optimum Set of variables already obtained with the fast optimization. I wanted to start from the optimum set, and perform 10,000 simulations with random perturbations around the parameter's optimum values
real ticks in Metaquotes Demo account are missing
Hello all, I am getting these messages "no real ticks within a day" in the Journal tab when running a EA test. It happens with EURUSD, XAUUSD, USDJPY, and more. It happens in two different computers (one running Linux and another one running Windows) It happens for any EA I tried. It happens while
Automatic Validation - Invalids Stops & Prices
The Automatic validation is giving errors that I can't reproduce in my computer. Let's review just the first error of [Invalid Stops]. Here is the code to review the freeze level and adjust SL & TP void ReviewPositionModificationForFREEZE_LEVEL( int direction, double tp, double &newSL
Disable/Enable Auto/Algo-Trading
Hello all, I want to sell an EA in the Market. Can I use this code below, or is this not allowed by the rules? thanks #include <WinAPI\winapi.mqh> #define MT_WMCMD_EXPERTS 32851 #define WM_COMMAND 0x0111 #define GA_ROOT 2 //+------------------------------------------------------------------+ //|
Calendar Economic Functions
Do the Calendar Economic Functions in MQ5 work during testing or optimization? It seems it doesn't, but I wonder if I am doing using them incorrectly. this is the code that works find in live trading, but always returns false during testing/optimization. MqlCalendarValue valuesC1[], valuesC2[];
invalid pointer in Expert.mqh
I am getting " invalid pointer access in 'Expert.mqh' (358,8)" in the journal tab. It happens when I change a input parameter in the set file. This is where it happens inside Expert.mqh: //+------------------------------------------------------------------+ //| Initialization signal object
percent margin below 1% when using CMoney classes
double CAccountInfo::MaxLotCheck( const string symbol, const ENUM_ORDER_TYPE trade_operation, const double price, const double percent) const { double margin= 0.0 ; //--- checks if (symbol== "" || price<= 0.0 || percent< 1 || percent> 100 ) in this piece of code
debug button is disabled
Since yesterday I can't debug my main EA because the debug button is disabled (grayed out). I am able to debug indicators, but not the EA. Any body knows the reason for that to happen
Undesired extra chart
Hi all, When running a single simulation in the Strategy Tester with the "visual mode with the display of charts, indicators and trades" checked ON (Settings tab), I get a new separate window with the full simulation. That is what I want. However, I also get another (undesired) chart in the terminal
Optimizing time frame - Tester question
1) One of my input variables is SimTimeFrame (input ENUM_TIMEFRAMES SimTimeFrame ); 2) In the tab "Settings" I set the time frame to "M1", and set Modeling to "Every tick based on real ticks" 3) I run the optimization with "Custom max." 4) In the tab " Optimization Results " I select one of the

