hi the ea have error
2025.02.05 03:00:28.887 Core 01 2025.01.27 10:00:00 Error in CheckMoneyForTrade code=4002
According to this Post in another thread, a return statement is missing.
Note that the OP there said that it works on currency pairs only.

- 2018.04.25
- Raphael Schwietering
- www.mql5.com
Your answer is unrelated. Just because both EAs use a function called "CheckMoneyForTrade" does not mean they are exactly the same.
In each of these cases the implementation is different and the errors being reported are also different.
This EA is for MT5/MQL5, and the topic you referenced is for MT4/MQL4. The two functions and the platforms are different.
I ask that you please pay more attention to the issue, before answering with something that may be misleading.
2025.02.05 03:00:28.887 Core 01 2025.01.27 10:00:00 Error in CheckMoneyForTrade code=4002
The error reported is the following ...
ERR_WRONG_INTERNAL_PARAMETER
4002
Wrong parameter in the inner call of the client terminal function
To resolve the issue, more information will be needed, so that the author can debug the code.
You will probably have to provide information such as Symbol, Time-frame and input parameters used for the EA, and also a copy of the log entries around which the error occurred.
Personally, I consider the function in question somewhat inconsistent and missing a few checks, even if it originated in a MetaQuotes article, but it's the responsibility of the author to verify and fix it if necessary.
I got it working when I set the request.type_filling...you need to set it to the one your broker uses
I won't use an EA code that I didn't build myself, so I almost didn't download it, but I'm always curious to see how another persons EA performs.
Also for validating the lot...I set the fallback to 0.01 instead of 0.0
lot = CheckMoneyForTrade(pair, lot, orderType)? lot : 0.01;
this is the problem gLotLimit= SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_LIMIT);
my broker answer 0......so i put 1 and is ok

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Smart Trend Follower:
This EA is designed to automatically follow market trends using signals from the Moving Average and Stochastic Oscillator indicators. The EA detects buy and sell signals by utilizing MA crossovers and confirms the trend with Stochastic. Additionally, the EA includes automatic position management, such as setting Take Profit, Stop Loss, and lot size doubling to enhance trading effectiveness in trending markets.
Author: Yulianto Hiu