Beginner-get high price

 

Hi,


I am a beginner with MT4 and i would like to do a simple thing but i am not sure i do it right because the result are a bit strange in backtest.

I would like to compute the HIGH or LOW of a serie over long period of time (3 or 6 month) using 1 minute data. I try to do it using the function highest but it does not seem to work.

Can anyone help please???


Thank you

 

show your code

 

Hi,


Here is the code:


void CheckForOpen()
{
int res;

if(Volume[0]>1) return;
indice=90*24*60;


if(Close[0]<iLowest(NULL,0,MODE_HIGH,indice,0))
{STOPLOSS=AccountEquity();
mmax=AccountEquity();
res=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"",MAGICMA,0,Blue);
prix=Open[0];
h=Hour();
a=1;
day=TimeDayOfYear(TimeCurrent()) ;
return;
}



if(Close[0]>iHighest(NULL,0,MODE_HIGH,indice,0))
{
STOPLOSS=AccountEquity();
mmax=AccountEquity();
res=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"",MAGICMA,0,Red);
prix=Open[0];
h=Hour();
a=1;
day=TimeDayOfYear(TimeCurrent()) ;
return;
}



}


It supposed to be running with one min data...



Thank for your help!

 

I do not understand the code but I guess That's what you meant

try to replace this code:

if(Close[0]<iLowest(NULL,0,MODE_HIGH,indice,0))
if(Close[0]>iHighest(NULL,0,MODE_HIGH,indice,0))

with this:

if(Close[0]<Low[iLowest(NULL,0,MODE_LOW,indice,0)])

if(Close[0]>High[iHighest(NULL,0,MODE_HIGH,indice,0)])
 
Thank you very much!