Forum

Find ChartID by periode

Hi, i try to draw on a chart. For the first one (Period M1) it works fine. For the second one (Period M5) it failed. I think i need to find the chartid for the second chart but how i can do it? Is there a function to get the chartid by periode? Also i wondering, if i make a smal loop it only print

Second period in tester not showing

Hello. I want to use a indicator with 2 periods so in the ea code it works fine. Only on the tester and here at the charts i have the problem, that i see the two tabs " EURUSD , M1" and "EURUSD, M5". Only in the first is content avivable. If i click on the second tab, nothing changes - did i have to

Compare ENUMs

Hi, i try to understand why the following if-statement not works. void OnTradeTransaction ( const MqlTradeTransaction &trans, const MqlTradeRequest &request, const MqlTradeResult &result) { ENUM_TRADE_TRANSACTION_TYPE type=trans.type;

Find related orders and positions

Hi, i try to understand the logic of mt5 how to do and handle trades ( Orders, Positions and Deals in MetaTrader 5 - MQL5 Articles ) At the moment i'm really confused. If i see it correctly, there is no kind of id, wich marks the first trade to open a order and his positions and the positions of the

Pass array values directly on function call?

Hi, i want to ask if something like this is possible void my_function( string array[]){ } //Call the function and pass datas directly my_function({ "text1" , "text2" , "text3" });

Possible to use 2 different structures in 1 array?

Hello, is it possible to use two structures in 1 array? Something link that? struct mystructA { string fieldnameA; int value_intA; double value_doubleA; string value_stringA; }; struct mystructB

Modify, edit or change a structure

Hello, i try to find a answear if it is possible to change a defined structure, later maybe to add a new element to the struct? Is it possible? struct struct_ar { string fieldname; // Name of the field, also for headline int value_int;

Draw Linke without boxes

Hi, I want to draw a line on the chart. It works but, i want to draw without the boxes - what i have to do for it? DrawTrendLine(chartid, "line_" + TimeCurrent (),windowid, time_start, my_val1+ 50 , time_end, my_val2+ 50

Basic question about passing and handling global vars to a function

Hello, i've the following basic question. if i define a array in global scope. double myglobalarray[]; myglobalarray[0]=987; Is it possible to pass this array to a function, work, fill and change his values at the end at global scope, without knowing/working with the name of the global var inside

How to remove first element from multidimensional array and add new at the end

Hello, i have the following array-Structure. myarray[level1][level2] Now i store some values myarray[0][0]=val0_1 myarray[1][0]=val1_1 myarray[3][0]...etc. [1]=val0_2 [1]=val1_2 [2]=val0_3 [2]=val1_3 [3]=val0_4 [3]=val1_4 etc