Help me with a code - page 2

 
Giovanni Salatto:

This is the code that gives the three errors

What you doing?

Copy and paste, not need delete and add new  brackets.

OnTick() starting with double brackets???

NormalizeLot() you have delete the ending brackets???

For last time.... this is correct code... copy and paste!!!

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
   {
   if(UseMM==true) LotSize=NormalizeLot(((AccountBalance()*AccountLeverage())/100000000)*Risk); else LotSize=NormalizeLot(LotSize);
   }

//+-----------------------------------------------------------

double NormalizeLot(double LotsSize)
{
  //---------------------------------------------------------------------
  if(IsConnected())
  {
  return(MathMin(MathMax((MathRound(LotsSize/MarketInfo(Symbol(),MODE_LOTSTEP))*MarketInfo(Symbol(),MODE_LOTSTEP)),MarketInfo(Symbol(),MODE_MINLOT)),MarketInfo(Symbol(),MODE_MAXLOT)));
  }
  else
  {
  return(NormalizeDouble(LotsSize,2));
  }
}
  //---------------------------------------------------------------------
 
Nikolaos Pantzos:

What you doing?

Copy and paste, not need delete and add new  brackets.

OnTick() starting with double brackets???

NormalizeLot() you have delete the ending brackets???

For last time.... this is correct code... copy and paste!!!

if I copy and paste without doing anything it even makes me 24 errors. Obviously I'm wrong something. Anyway thanks for the contribution, I don't want to abuse you !!!

 
Giovanni Salatto:

if I copy and paste without doing anything it even makes me 24 errors. Obviously I'm wrong something. Anyway thanks for the contribution, I don't want to abuse you !!!

The problem maybe is in the rest part of the code.

I can't help without seeing the whole code.

My code working perfect. As you can to see using the file.



Files:
123.mq4  2 kb
 

It works perfectly. Simple and effective code. Thank you very much!
Reason: