please help with finding candle body high and lows in a range.

 
channelHigh= MathMax(iHighest(NULL,PERIOD_M30,MODE_CLOSE,5,1),iHighest(NULL,PERIOD_M30,MODE_OPEN,5,1) );

channelLow= MathMin(iLowest(NULL,PERIOD_M30,MODE_CLOSE, 5,1),iLowest(NULL,PERIOD_M30, MODE_OPEN,5,1) );

what i am trying to find is only the candle bodies NOT WICKS, so the highest open and close for the last 5 periods and the lowest open close for the last 5 periods.

the script seems fine but its not working, please help! thank you.
 
Use iHigh, iLow.
 
do you mind editing that script with ihigh and ilow? i read the doc and it uses shift instead of periods back. i dont know how.
 
the return of iHighest(...)  is index not value !!!
 
could anyone please give me a sample of what i would use instead? i looked up iHigh, says it returns the high of the candle, i am looking for the higher of open/close.
 
Do you mean you are trying to find the biggest and smallest candle body within a range?
 
craig, i am trying to find the highest price of the open and close AND lowest of the open close in a range. imagine on a chart, you draw a channel that ignores the wicks, only using the candle bodies.
 
double highest_open = High[iHighest(NULL, PERIOD_M30, MODE_OPEN, 5, 1)];
double highest_close = High[iHighest(NULL, PERIOD_M30, MODE_CLOSE, 5, 1)];
double lowest_open = Low[iLowest(NULL, PERIOD_M30, MODE_OPEN, 5, 1)];
double lowest_close = Low[iLowest(NULL, PERIOD_M30, MODE_CLOSE, 5, 1)];
 
thank you craig, i'll try, and you mean ihigh and ilow correct? i looked up the documentation.

ihigh
"Returns High value for the bar of indicated symbol with timeframe and shift."

doesnt that give the highest price of the wick?
 
double highest_open = Open[iHighest(NULL, PERIOD_M30, MODE_OPEN, 5, 1)];
double highest_close = Close[iHighest(NULL, PERIOD_M30, MODE_CLOSE, 5, 1)];
double lowest_open = Open[iLowest(NULL, PERIOD_M30, MODE_OPEN, 5, 1)];
double lowest_close = Close[iLowest(NULL, PERIOD_M30, MODE_CLOSE, 5, 1)];

iHighest returns a index, so Open[index] must be what you need.
It's so f**kin confusing!!
 
ahaha. i know! thats interesting. thank you so much man.

i tried it out with iopen and iclose. now my ea doesnt even take trades anymore. thats just odd.