# how to convert the Open[x] High[x] Low[x] Close[x] from MQL4 to MQL5 ?

66

these variables are not available on mql5

what function can i construct to better emulate these Open[0] High[0] Low[0] Close[0]  ?

Moderator
2326

PS - probably best not to double post, people don't like it ;-)

66

honest_knave:

PS - probably best not to double post, people don't like it ;-)

i was already following this article.... but they not tell everything there...

to simplify the conversion i did these functions.. im not experienced enough to see if these are the best commands for indicators could you tell about ?

-----------------------------

-----------------------------

-----------------------------

double _open(int index)

{

if(index < 0) return(-1);

double Arr[];

if(CopyOpen(_Symbol,_Period, index, 1, Arr)>0) return(Arr[0]);

else return(-1);

}

double _low(int index)

{

if(index < 0) return(-1);

double Arr[];

if(CopyLow(_Symbol,_Period, index, 1, Arr)>0) return(Arr[0]);

else return(-1);

}

double _high(int index)

{

if(index < 0) return(-1);

double Arr[];

if(CopyHigh(_Symbol,_Period, index, 1, Arr)>0) return(Arr[0]);

else return(-1);

}

double _close(int index)

{

if(index < 0) return(-1);

double Arr[];

if(CopyClose(_Symbol,_Period, index, 1, Arr)>0) return(Arr[0]);

else return(-1);

}

datetime _time(int index)

{

if(index < 0) return(-1);

datetime Arr[];

if(CopyTime(_Symbol,_Period, index, 1, Arr)>0) return(Arr[0]);

else return(-1);

}

int _bars(){

return Bars(_Symbol,_Period);

//int teste = Bars(_Symbol,_Period);

}

double _bid(){

return SymbolInfoDouble(_Symbol,SYMBOL_BID);

Moderator
34448

Forum on trading, automated trading systems and testing trading strategies

I strongly suggest you to do some searches before creating new topics.