Volume limit reached

 

Hi everyone,

I need your help. I have tried my best to fix the code, but this error still keeps on occur. How to fix this?

I have tried all the method mentioned below, but it seems still did not work.

Volume limit reached problem when publishing the EA - Easy Trading Strategy - Expert Advisors and Automated Trading - MQL5 programming forum


Volume limit reached problem when publishing the EA
Volume limit reached problem when publishing the EA
  • 2021.08.12
  • www.mql5.com
Hi everyone, there is an issue I saw many people had when they were trying to publish their EAs. Here is some output I get(errors...
 
Eng Wai Chung:

Hi everyone,

I need your help. I have tried my best to fix the code, but this error still keeps on occur. How to fix this?

I have tried all the method mentioned below, but it seems still did not work.

Volume limit reached problem when publishing the EA - Easy Trading Strategy - Expert Advisors and Automated Trading - MQL5 programming forum


https://www.mql5.com/en/articles/2555


Normally all the solutions are here.

The maximum volume that an account has the right is can be crossed. I do not know the details, but if you put all the checks present in the page you have a very solid control.


The checks a trading robot must pass before publication in the Market
The checks a trading robot must pass before publication in the Market
  • www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 
Eng Wai Chung: Hi everyone, I need your help. I have tried my best to fix the code, but this error still keeps on occur. How to fix this? I have tried all the method mentioned below, but it seems still did not work.

Volume limit reached problem when publishing the EA - Easy Trading Strategy - Expert Advisors and Automated Trading - MQL5 programming forum

Forum on trading, automated trading systems and testing trading strategies

Volume Limit Reached - Validation for new Expert Advisor error

Fernando Carreiro, 2022.07.22 18:22

Your EA must be coded to read the broker's contract specifications, such volume limitations, and prevent that from happening.

SYMBOL_VOLUME_MIN

Minimal volume for a deal

double

SYMBOL_VOLUME_MAX

Maximal volume for a deal

double

SYMBOL_VOLUME_STEP

Minimal volume change step for deal execution

double

SYMBOL_VOLUME_LIMIT

Maximum allowed aggregate volume of an open position and pending orders in one direction (buy or sell) for the symbol. For example, with the limitation of 5 lots, you can have an open buy position with the volume of 5 lots and place a pending order Sell Limit with the volume of 5 lots. But in this case you cannot place a Buy Limit pending order (since the total volume in one direction will exceed the limitation) or place Sell Limit with the volume more than 5 lots.

double

Articles

The checks a trading robot must pass before publication in the Market

MetaQuotes, 2016.08.01 09:30

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
 
Anthony De Barros #:

https://www.mql5.com/en/articles/2555


Normally all the solutions are here.

The maximum volume that an account has the right is can be crossed. I do not know the details, but if you put all the checks present in the page you have a very solid control.


Hi,

"The maximum volume that an account has the right is can be crossed."

I don't understand this sentence, what do you mean?

 
Fernando Carreiro #:

Hi,

I checked that my overall symbol volume limit is 0.0

How to increase my volume limit?

Looking forward for your respond.


Thank you,

D.

 
Eng Wai Chung #:

Hi,

I checked that my overall symbol volume limit is 0.0

How to increase my volume limit?

Looking forward for your respond.


Thank you,

D.

Some brokers have the limit set at 0.0, I assume that this means that there is no limit from the broker.

Your broker may set it at 0.0, but other brokers won't. (The validation tester obviously sets a limit)

In your function to check the limit, you should check whether the limit is 0.0 and act accordingly.

 
Keith Watford #:

Some brokers have the limit set at 0.0, I assume that this means that there is no limit from the broker.

Your broker may set it at 0.0, but other brokers won't. (The validation tester obviously sets a limit)

In your function to check the limit, you should check whether the limit is 0.0 and act accordingly.

Thank you so much Keith!

Because of your explanation, I finally able to pass the validation tester!

Indeed,0.0 means there is no limit from the broker! That's mean we need to create a function to act accordingly for those broker that sets a limit. 

Appreciate that.

 
Eng Wai Chung #:

Thank you so much Keith!

Because of your explanation, I finally able to pass the validation tester!

Indeed,0.0 means there is no limit from the broker! That's mean we need to create a function to act accordingly for those broker that sets a limit. 

Appreciate that.

Please write here what you wrote after SYMBOL_VOLUME_MAX); ?

I am having the same problem with my EA

 

This problem was frustrating...

But this thread actually helped me understand what the issue is.

This was my fix:

         if(SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_LIMIT) != 0) {

            if(lots > SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_LIMIT)) return 0;

           }

In my broker SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_LIMIT) is equal to 0.0. So if it's not my broker and if the lots I'm about to enter a trade with are more than the SYMBOL_VOLUME_LIMIT (of the tested broker) -> don't enter!

Thank you for the explanation folks.

Reason: