Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

StrategyTester in pips - MetaTrader 4 Expert - MT4/MT5 Resources

author EAcpu | 5 reads | 0 comments |

StrategyTester in pips - expert for MetaTrader 4

StrategyTester in pips - expert for MetaTrader 4

The code was created because the main strategy tester did not meet my expectations.
My EA has all symbols and everything depends on the sum of points, not the currency. Furthermore, the symbols have different pip values, so I need to systematize the results. Another problem is that the standard tester uses the current swap point, which makes the results seem random to me. In recent months, swap points have changed more than before. Additionally, brokers have different swaps. My testers systematize everything.

Results are pre-filtered: rules 1, 2, 3. Of course, you can add your own.
-rule1 is in the maxDD function and depends on Lots.
- Rules 2 and 3 are checked in the AnalyzeTrades function before sending the save.

The EA is just an empty sketch with ready-made functionality. JavaScript functions are in separate files. You can change them as needed and the files will not be overwritten.
You can check this in two ways. Insert the content of OnTick() from MACD Sample.mq4 and adjust the variables, or faster download the working EA Short Trend Reversal and apply additional optimization sets.

Program sequence:
-Set optimization parameters
- Enable strategy tester in points
- Set filters
- Disable "Test selected results"
Run optimization open html file, sort, select/deselect results, save .csv file to csv_done folder
- Deselect optimization parameters
- Enable "Test selected results"
- Select "stage1 results array"
Run optimization

For ShortTrendReversal, the above two steps are in the accompanying .set file.

Finally, before enabling optimization, disable genetic optimization. Also, if you change the optimization parameters in the first step, you must clear the tester's cache, as the tester skips calculations, which are essential.

The following Windows script is used to clean the tester cache and the last created files

 rem @echo close put mt4_path = "full_path_to_metatrader4\tester\files\ShortTrendReversal" delete %mt4_path%\..\..\caches\*.* /P
delete %mt4_path%\..\..\history\*.* /P for /F%%a in ( 'dir /B /O:-D /A:-D /T:C %mt4_path%\*.html' ) do delete /P "%mt4_path%\%%a" & go to deldone: deldone for /F%%a in ( 'dir /B /O:-D /A:-D /T:C %mt4_path%\csv_done\*.html' ) do delete /P "%mt4_path%\csv_done\%%a" & go to Deldone: Deldone pause 

StrategyTester in pips - expert for MetaTrader 4StrategyTester in pips - expert for MetaTrader 4


Attachment download

📎 opt_step1.set (2.64 KB)

📎 opt_step2.set (2.64 KB)

📎 StrategyTesterInPips_sketch.mq4 (52.84 KB)

Source: MQL5 #62861

Verification code Refresh