# there are no trading operations - page 3

3079

I have solved this problem.

Add this code before CheckVolumeValue :

```double min_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN);
if(lotlot<min_volume)
{
lotlot=min_volume;
}

//--- maximal allowed volume of trade operations
double max_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MAX);
if(lotlot>max_volume)
{
lotlot=max_volume;
}```

Before :

```extern double    Lots=0.01;

if(totalsell()==0  && IsNewOrderAllowed() && CheckVolumeValue(lotlot,lotcheck) && CheckMoneyForTrade(Symbol(),lotlot,OP_SELL))
{
int opensell=OrderSend(Symbol(),OP_SELL,lotlot,Bid,(int)Slippage,0,0,comment,MagicNumber,0,Green);
}```

After :

```extern double    Lots=0.01;

double min_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN);
if(lotlot<min_volume)
{
lotlot=min_volume;
}

//--- maximal allowed volume of trade operations
double max_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MAX);
if(lotlot>max_volume)
{
lotlot=max_volume;
}

if(totalsell()==0  && IsNewOrderAllowed() && CheckVolumeValue(lotlot,lotcheck) && CheckMoneyForTrade(Symbol(),lotlot,OP_SELL))
{
int opensell=OrderSend(Symbol(),OP_SELL,lotlot,Bid,(int)Slippage,0,0,comment,MagicNumber,0,Green);
}```

Regards

Rio Purwanggono

2014

what is the value of "lotcheck" ?
2442

The solution is simple, I just add the code:

iLots = NormalizeDouble(iLots,_Digits);

for the new lot orders

21911

Ubaidillah: I just add the code: iLots = NormalizeDouble(iLots,_Digits);
You used NormalizeDouble, It's use is usually wrong, as it is in your case.
2442

whroeder1:
You used NormalizeDouble, It's use is usually wrong, as it is in your case.

Oh I'm sorry, I mean this code:

```if(Lots<SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN)){
Lots=SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN);
Print("Lot value too small, and set to minimum symbol volume : ",Lots);
}

```
`Maybe it's because I'm too happy to paste the wrong code...`
152

Test failed with fixed defined lots@ 0.01/0.1 which are external params to my EA.Testing succeeded when i set Lots to 1.0...

maybe that helps some of you...

295

Manuel Joos:

Test failed with fixed defined lots@ 0.01/0.1 which are external params to my EA.Testing succeeded when i set Lots to 1.0...

maybe that helps some of you...

as far i observed, market validation use multiple setting/server type. Some broker or pair minimum lot order is 0.01 or 0.10 or 1.00. For example minimum lot for crude oil is 1.00 lot.