Error 4051. Invalid lots amount for OrderSend function

 

Hi guys, I want to upload EA in the market but I am getting error 4051, the problem is that Lot size exceeds minimum and maximum values, How can I calculate below code correctly so that it would not exceed minimal and maximal lot sizes? Thanks!

   minLot = MathMax(MinLots, MarketInfo(Symbol(), MODE_MINLOT));
   maxLot = MathMin(MaxLots, MarketInfo(Symbol(), MODE_MAXLOT));

Can someone help me?

 

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't know what MinLots or MaxLots is. Nor can we see your OrderSend.

 
William Roeder #:

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
     How To Ask Questions The Smart Way. (2004)
          Be precise and informative about your problem

We can't know what MinLots or MaxLots is. Nor can we see your OrderSend.

Hi thanks! There is a mql4 file: 

Files:
The-ea.mq4  11 kb
 
Can someone tell what's problem?
 
Buba Akhrakhadze #:
Can someone tell what's problem?

I have test it your ea.. I did not see any problem in the tester.. the ea is placing pending orders  ...  

 
Daniel Cioca #:

I have test it your ea.. I did not see any problem in the tester.. the ea is placing pending orders  ...  

Yes but I can't uoload it to market

Reason: