need to help about LowestCandle and HighestCandle

 
void OnTick()
  {
   
  
  
double HighestCandle=High[iHighest(NULL,0,MODE_HIGH,144,9)];
double LowestCandle =Low[iLowest(NULL,0,MODE_LOW,144,9)];

double mcd1 = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,1 );
double mcdL= iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,LowestCandle);
double mcdH = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,HighestCandle);


if(mcd1<mcdL && Open[1]> LowestCandle && Close[1] < LowestCandle   )

Comment("SELL");

else
 if(mcd1>mcdH &&Open[1]< HighestCandle && Close[1]> HighestCandle  )
Comment ("BUY");
 }

can some one tell me where is the probleme here

why it sdont work ??

 
ALI AMRIOUI:

can some one tell me where is the probleme here

why it sdont work ??

i wana MACD give me the the value of lowest candle and the value of the highest candle

 
double mcd1 = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,1 );
double mcdL= iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,LowestCandle);
double mcdH = iMACD(NULL,0,12,26,9,PRICE_WEIGHTED,MODE_MAIN,HighestCandle);

The last parameter of iMACD is the bar index you want. The first line read the last formed bar. In the other two, you are passing a price, not an index.

 
William Roeder:

The last parameter of iMACD is the bar index you want. The first line read the last formed bar. In the other two, you are passing a price, not an index.

William Roeder:

The last parameter of iMACD is the bar index you want. The first line read the last formed bar. In the other two, you are passing a price, not an index.

what i should doing then.. i wana to get the MACD value of lowest price and highest price.. plz help

 
ALI AMRIOUI:what i should doing then.. i wana to get the MACD value of lowest price and highest price..

Pass the indexes of the lowest/highest candles.

 
William Roeder:

Pass the indexes of the lowest/highest candles.

how i can do that??

can u writed for me