Percentage of a candle

 
Hey there I want to calculate the % out of the range of a candle. and on the basis of that I want my EA to place orders on the next candle. but it's not working. please tell me where i have done wrong.
void openbuystop()
{
  char a=  (High[1]-Low[1])*0.04;
   if (OrderSend(Symbol(),OP_BUYSTOP,lot,a*Point+High[1],3,High[1],a*Point+High[1]+tp*Point,NULL,magic,0,NULL)== true)
   {
      Alert("Order Sent");
   }
   else
   fun_err(GetLastError());
}

void opensellstop()
{
  char b =  (High[1]-Low[1])*0.04;
    if (OrderSend(Symbol(),OP_SELLSTOP,lot,Low[1]-b*Point,3,Low[1],Low[1]-b*Point-tp*Point,NULL,magic,0,NULL)== true)
   {
      Alert("Order Sent");
   }
   else
   fun_err(GetLastError());
}
 

Do you know what char means?

Just place you cursor above it and press F1.

You'd better use double.

 

Sorry. It was previously done. I have tried using double. But then also it is not working.

 
gooly:

Do you know what char means?

Just place you cursor above it and press F1.

You'd better use double.

Can you help in these please?
 

no need to multiply with Point!!

double a =  (High[1]-Low[1])*0.04; // a is already in Points
if (OrderSend(Symbol(),OP_BUYSTOP,lot,a+High[1],3,High[1],a+High[1]+tp*Point,NULL,magic,0,NULL)== true)
Reason: