Experts: Smart Trend Follower

 

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

 

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
 
kosty3 #:hi the ea have error

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.

CheckMoneyForTrade function not working on GOLD
CheckMoneyForTrade function not working on GOLD
  • 2018.04.25
  • Raphael Schwietering
  • www.mql5.com
Hi, i have a question. I have to do this So i use that code from here https://www.mql5...
 
@Ryan L Johnson #: 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.

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.


@kosty3 #: 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

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.

 
kosty3 #:

hi the ea have error

this ea work on me
 
kosty3 #:

hi the ea have error

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;
Files:
 

this is the problem  gLotLimit= SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_LIMIT);

my broker answer 0......so i put 1 and is ok

 

I get this error when I try to run a backtest on XM:

2025.03.14 00:35:45.411 Core 01 2022.05.16 07:30:00   Error in CheckMoneyForTrade code=4002


Symbol is GOLD#, timeframe M15


 
Please be aware if some EA is not using SL, u are the SL.