Forum

How to get current month working day in MQL4?

Hi, How to get current month working day in MQL4? int CurrentWorkDay() { int WorkDay = 0; for (int i=Day(); i >= 1; i--) { if( TimeDayOfWeek(TimeToStr(TimeCurrent() - 60 * 60 * 24 * i,TIME_DATE)) >= 1 && TimeDayOfWeek(TimeToStr(TimeCurrent() - 60 * 60 * 24 * i,TIME_DATE)) <= 5 ) { WorkDay++;

[SOLVED] iCustom trouble

Hello, I am trying to get the values from indicator attached with iCustom: int barx = 0 ; int Loops = 8 ; for ( int x= 0 ; x<=Loops; x++) { ObjectCreate ("TEST" + ( string )x, OBJ_LABEL , 0 , 0 , 0 ); ObjectSet ("TEST" + ( string )x, OBJPROP_CORNER , 3 ); ObjectSet ("TEST" + ( string )x

iCustom TROUBLE - Too Many Extern Variables & repeatedly initialized and deinitialized

Hello, Already read Detailed Explanation of iCustom but still can't make iCustom working. As can see on above picture, ZigZagAdvanced_mj_v1.13 indicator has 66 extern variables. When include all 66 extern variables in iCustom: iCustom ( NULL , 0 ,"ZigZagAdvanced_mj_v1. 13 ","== set a unique prefix

Creating Enum from Array?

string TEST_A[ 3 ] = { "TEST_A_1" , "TEST_A_2" , "TEST_A_3" }; string TEST_B[ 5 ] = { "TEST_B_1" , "TEST_B_2" , "TEST_B_3" , "TEST_B_4" , "TEST_B_5" }; string TESTEnum[ 8 ]; ArrayResize (TESTEnum, ArraySize (TEST_A)+ ArraySize (TEST_B), ArraySize (TEST_A)+ ArraySize (TEST_B)); for ( int i= 0 ; i<

Data Types in Array

double test[ 3 ][ 2 ] = { { 1.11 , "test1" }, { 2.22 , "test2" }, { 3.33 , "test3" } }; // Result - compiler warnings "implicit conversion from 'string' to 'number'" // 1.11, 0 // 2.22, 0 // 3.33, 0 double test[ 3 ][ 2 ] = { { 1.11 , ( char ) "test1" }, { 2.22 , ( char ) "test2" }, { 3.33 ,( char )

Multiple Data Types in Multi Dimensional Array

int orderstotal = OrdersTotal (); int orders = 0 ; int ordticket[ 30 ][ 2 ]; ArrayResize (ordticket, 30 , 30 ); for ( int i = 0 ; i < orderstotal; i++) { if ( OrderSelect (i, SELECT_BY_POS , MODE_TRADES )== true ){ if ( OrderType () != OP_BUY || OrderSymbol () !=

How to pass ENUM values to Array?

I am very new to MQL4 How to pass ENUM values to array - ENUMDataInput ? How to programmatically count ENUM size (so I don't have defined ENUMSize=5) ? Thanks for the help. ‌ enum MALines{_20= 1 ,_34= 2 ,_50= 3 ,_100= 4 ,_200= 5 }; int ENUMSize= 5 ; void LinesArray( string ENUMDataInput, int

Help Please - indicator does not refresh on offline chart

Hello, This indicator doesn't refresh on offline chart (range bars). I really don't have a clue how to fix it. //+------------------------------------------------------------------+ //| LastManStandingIndicator.mq4 | //|