OrderSend: Error code 131 - page 2

 
David Diez:

Passed!

"If a check shows that there are insufficient funds to perform a trade operation, it is necessary to output an error message to the log instead of calling the OrderSend() function".

Just added that error message and passed the validation. Thanks to all.


Can u give step to do sir?? I still dont understand .. so first step what should i do??
 
 you need to call GetLastError() method and then with Errordescription() to see details of error
 
you can also handle the error and after that with Print() function it will show also in terminal not only in logs
 
David Diez:

Passed!

"If a check shows that there are insufficient funds to perform a trade operation, it is necessary to output an error message to the log instead of calling the OrderSend() function".

Just added that error message and passed the validation. Thanks to all.

Hello David,

Can you please put the code that helped you here?
together with the initialization if you would like?
Thank you very much!

 
Is it possible someone could copy the code here so we can understand it? thanks!
 
German Mazzaferro:
Is it possible someone could copy the code here so we can understand it? thanks!

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

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.
 
What is Wrong on my code ?  saying error 131 return value of order select

***
 
Lucas Rocha #What is Wrong on my code ?  saying error 131 return value of order select
// THIS EA CODE HAS BEEN GENERATED USING FOREXEADVISOR STRATEGY BUILDER 0.2 on: 5/14/2020 5:39:16 AM

That is not your code. That is code generated by a 3rd party tool, known for generating very bad code.

So, if you have an issue with it, please contact the author of that tool. Alternatively, take some time to learn to code in MQL yourself.

 
// THIS EA CODE HAS BEEN GENERATED USING FOREXEADVISOR STRATEGY BUILDER 0.2 on: 5/14/2020 5:39:16 AM

EA builder, EA Builder Pro, EATree, Etasoft forex generator, Forex Strategy Builder, ForexEAdvisor STRATEGY BUILDER, ForexRobotAcademy.com, FX EA Builder, fxDreema, Forex Generator, FxPro, Molanis, Octa-FX Meta Editor, Online Forex Expert Advisor Generator, Strategy Builder FX, Strategy Quant, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.

  1. Since you haven't learned MQL4/5, therefor there is no common language for us to communicate.
    If we tell you what you need, you can't code it.
    If we give you the code, you don't know how to integrate it into yours.
    We are willing to HELP you when you post your attempt (using Code button) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

  2. EA builder makes bad code counting up while closing multiple orders.
    EA builder makes bad code Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
    EA builder makes bad code, not adjusting for 4/5 digit brokers, TP/SL and slippage.
    EA builder makes bad code, not adjusting for ECN brokers. pre-Build 500)
    EA builder makes bad code, not checking return codes.

  3. EATree uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)

  4. FX EA Builder makes bad code, not checking return codes.
    FX EA Builder makes bad code, loosing open tickets on terminal restart. No recovery (crash/power failure.)
    FX EA Builder makes bad code, not adjusting stops for the spread.
    FX EA Builder makes bad code, using OrdersTotal directly.

  5. FOREXEADVISOR STRATEGY BUILDER makes bad code, non-updateing global variables.
    FOREXEADVISOR STRATEGY BUILDER makes bad code, compilation errors.
    FOREXEADVISOR STRATEGY BUILDER makes bad code, not checking return codes.

Learn to code it, or pay someone (Freelance) someone to code it.
          Hiring to write script - General - MQL5 programming forum #1 (2019)

 

I have the same problem with my EA. It does not work.

I have a function what I call before OrderSend, where I calculate the lotsize:

if(Lots< SymbolInfoDouble(Pair,SYMBOL_VOLUME_MIN))
   Lots= SymbolInfoDouble(Pair,SYMBOL_VOLUME_MIN);

if(Lots> SymbolInfoDouble(Pair,SYMBOL_VOLUME_MAX))
   Lots= SymbolInfoDouble(Pair,SYMBOL_VOLUME_MAX);

But the report still says there is an error 131.

I cannot get my head around it.

Reason: