1.) add a function double lotsNormalized(string symbol,double lots) to the EA:
2.) change code in ~ln 1034 as follows (add "//"):
comment this out: double SendLots = Lot;
insert this:
That should solve the problem with the wrong-entered lots.
Inserted Code
// examplecall: lotsNormalized(Symbol(),0.0009) double lotsNormalized(string symbol,double lots) { //--- int decimals; double minLots = MarketInfo(symbol,MODE_MINLOT); double maxLots = MarketInfo(symbol,MODE_MAXLOT); double lotStep = MarketInfo(symbol,MODE_LOTSTEP); if (lotStep == 0.001) decimals = 3; else if (lotStep == 0.01) decimals = 2; else if (lotStep == 0.10) decimals = 1; else if (lotStep == 1.00) decimals = 0; lots = NormalizeDouble(lots,decimals); if (lots < minLots) lots = minLots; if (lots > maxLots) lots = maxLots; return(lots); //--- }
2.) change code in ~ln 1034 as follows (add "//"):
comment this out: double SendLots = Lot;
insert this:
Inserted Code
double SendLots = lotsNormalized(Symbol(),Lot);
That should solve the problem with the wrong-entered lots.
PM me with coding requests and I'll probably put you on my ignore list