Forum

Why Does the MQL5 strategy tester give different results when the same hard-coded strategy is used on a different time frame?

If I hardcode the time period, for all the ema handles as Period_H6 for a simple ema crossover strategy, and run the tester with H6 selected, as expected it provides a profitable result. However when I change the tester time setting to H4, it gives a different and much worse result. There is no

How can I use ArrayPrint on a 3 dimensional array?

double arr3[ 3 ][ 2 ][ 2 ]; arr3[ 0 ][ 0 ][ 0 ]= 1 ; arr3[ 0 ][ 0 ][ 1 ]= 2 ; arr3[ 0 ][ 1 ][ 0 ]= 11 ; arr3[ 0 ][ 1 ][ 1 ]= 12 ; arr3[ 1 ][ 0 ][ 0 ]= 111 ; arr3[ 1 ][ 0 ][ 1 ]= 112 ; Print ( "it is " ); ArrayPrint (arr3); I've created a 3d array and partially populated it. However I can't get

How can I use ArrayInsert on a 2 dimensional array

double array[ 10 ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }; double array2[ 10 ] = { 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 }; for ( int i = 0 ; i < 10 ; i++){ ArrayInsert (array,array2, 0 , 0 , 1 ); } ArrayPrint (array); To provide some background and a simple illustration using a 1 d

Is there a way to create an Array of arrays in MQL5?

Trying to create an array, which will hold say 10 arrays each of size 5 made up of type double

What is the correct full syntax for creating a list in MQL5?

Sorry for the simple question, I am very new to MQL5. I know how to create a generic array, but am now trying to create a list of undefined size, which values can be added to. Most of the literature I read seemed to go over my head

Expert advisor closing trades early after the first following candle and stopping the simulation

Whenever I run it through the strategy tester , the trade always closes on the first candle after opening and then the simulation stops out. First time writing one of these, but any help would be much appreciated. Code is as follows #include <Trade/Trade.mqh> CTrade trade; int OnInit () { Print