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

Tester for testing a large number of combinations of trading setups - MetaTrader 5 Expert | MT5 EA Download

author EAcpu | 2 reads | 0 comments |

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Welcome to Binary Tester.

The purpose of this EA is to test different indicators to optimize trading scenarios.

Everyone has their own opinion on what the best trading setup is and the advice is never-ending! It would be better if you test it...

Is this EA perfect? No, of course not! I'm open to suggestions for modifications. But the core logic is solid :-)

This EA is used to test combinations of trading scenarios to get the best setup. It will run through all combinations of trading decisions of your choice in a binary fashion and provide the results for each scenario or sequence.

The commented out "Prerequisites" area is where you should include your idea or something you've already tested as a good prerequisite to an open buying decision and/or a closed buying decision. If you have something here, you should start your test sequence from 0 to use that as the basis for your test results! If you comment this out, it should start at 1.

A case statement is a separate condition that you want to test in conjunction with all other case statement tests. Examples of case statements for BuySequence can be MA30 > EMA12 or rates[1].low < BollingerBandsLow[1], etc. No matter what conditions you define. The EA will then test every unique combination of all statements and provide the results for that unique sequence.

For example, if you enter 3 in BuySequence, it will test with both cases 1 and 2. (since 1 and 2 = 3)

If you enter 4 in BuySequence, it will only test case 4. If you enter 5, it will test case statements 1 and 4, but not case 2. This is binary logic.

By testing the range from 1 to 7, it will test all combinations of case statements 1-4 (4+2+1). (i.e. case 1, case 2, case 4).

This means it will test 1 on the first pass, 2 on the second pass, 1 & 2 on the third pass, 4 on the fourth pass, 1 & 4 on the fifth pass, 2&4 on the sixth pass, and 1,2 & 4 on the seventh pass.

     It indexes all combinations in binary fashion. This is the core logic.

Here are some things to note when using Testinator

0) Don't use organic optimization as this will look for patterns in the test index and get closer to that index and will not test all scenarios. There is no pattern in this test scenario because each test sequence is completely different.

1) It may produce a different sequence than what you think it is doing. Note) It is possible to produce sequence combinations that are extremely rare or may never occur, resulting in few or no trades or trades remaining open until the end of the test.

2) It is possible (and likely) that duplicate results will occur. Multiple results showing the same profit, loss, number of trades, etc... NOTE) This is a naturally occurring situation because two or more sequences can be true simultaneously and always. Just choose the smaller of the serial numbers.

3) Large combinations are possible, but the MT5 tester has limitations. NOTE) I have successfully tested up to a million combinations. The XML file is large, but Excel opens and does not truncate the data. Additionally, if you need to process large data sets and perform further analysis, using tools like MySQL is highly recommended. Saving the file as CSV and then importing it into MySQL is the easiest solution for me.

4) When testing large combinations, using more processors is highly recommended. I used a local network farm (an extra multi-core computer at my house) and the MQL5 Cloud Network. MQL5 Cloud Network is awesome! In one case, the local network farm took about 32 hours, while the cloud completed the same test in 10 minutes. This particular test costs about $4, but it's worth it to me. I was originally going to use a Killer AMD setup with multiple cores/threads, but for now I'll stick with the cloud.

5) Watch out for your mistakes! ! ! Please check everything carefully before starting the test. Before leaving the terminal, take a look at the results to see if they match your expectations. Nothing will make you more unhappy than running a very long test, only to find out that your condition configuration settings are incorrect, or that the sequence should start with 0 (prerequisite) instead of 1 or some other number. Simple mistakes can cost you time and money and produce very unreliable results.

6) Have a clear goal of what you are looking for (see Q&A section) and don't get stuck in a testing cycle without a clear end-to-end scope! Analysis paralysis can easily occur.

7) If you test the opening price and find a good sequence, perform a test of the buy and close sequence on each price move. If it's good, it should still be good on every quote or every quote based on real quotes.

P.S. As of today (January 5, 2020, version 2286), I will avoid using the "All symbols selected in MarketWatch" optimization test option. I've run this and then tested it once on a forex pair with completely different results. Additionally, "faster calculation of PIP profits" can also produce strange results. The EA I ran produced positive bankroll results but negative PIP results.

Q&A/Comments

Q) What exactly am I looking for?

a) Indicators provide some indication that the market is moving in a direction. Sometimes they are right, and sometimes (many times) they are wrong, or "cheated" by the market. You are looking for a trading setup where the number of correct pips is greater than the number of false pips. When a forgery occurs, you close the order quickly to avoid losing too much money. thereby obtaining net profit. See screenshot at the end.

Q) Can I add different or custom indicators?

a) If you're asking this question, then no, you probably shouldn't. Find someone on MQL5.com ( https://www.mql5.com/en/job ) or elsewhere to make the changes for you. Keep in mind that your sequence range will change. You can also delete sequences if you like, but remember to keep the sequence case numbers as binary sequences (1, 2, 4, 8, 16...) and your test range should stop at the sum of these numbers.

Q) Will there be an MQL4 version?

a) No, in fact, I have written a code. But Metatrader 4 only uses a single core, and Cloud is not available for MT4. Unless Intel or AMD launch the Bazillion GHZ single-core performance processor, the plan is to continue using MQL5 for development and testing. If you find a good trading setup, you can easily migrate it back to MQ4 EA.

Q) What is OnTester feature and how to use it?

a) This is the average bar for closing positions. It will appear in the "Custom" column of the data export.

The CSTS (Coefficient of Safe Trade System) value for this trade series has been commented out.

      If you want to use it and can get a coefficient of 1 or greater, then it might be a good trading system. Reference: https://www.mql5.com/en/articles/286

Q) Metatrader crashes/freezes, how can I get the results of my run?

a) Look at the top bar of the tester window, there is a way to see past results. Just select the expert and click "View previous results". Hopefully it should be there. MT5 also has a great feature where if you run it again, it will pick up where you left off, or pull the results of what was done previously.

Q) How to import data into Excel/MySQL?

a) In the tester window, right click and select Export to XML. Then I immediately save as "Excel or CSV". Importing this into MySQL is a bit complicated. Specifically depends on your operating system and version. There is a lot of information on the Internet.

Q) You are not using MQLRates (or any other part of EA) correctly! You don't know what you are doing.

a) I'm open to helpful suggestions.

Q) Your trailing stop is complete nonsense! Tracking should only be done after making a profit.

a) See answer above :-)

Q) This is so stupid, you're just fumbling in the dark.

a) 1) Yes, so. 2) Stop being so negative.

Q) I have a suggestion/need help/want to talk about a different EA.

a) Email me: quint@savoon.com

I have a day job so can't guarantee how quickly I'll respond.

Q) This is awesome, it should find the perfect trading setup! Should I quit my job tomorrow and devote myself full time to finding the golden setup?

a) No, a bird in the hand is worth two in the bush. Put your money in the bank first and then talk to your boss.

core logic observation

1)     The more entry conditions there are in a buying decision, the fewer transactions will occur. This is because the likelihood of meeting all of these conditions becomes increasingly rare. The number of entry conditions has nothing to do with a good trade setup. More doesn’t always equal better, and less is harder to measure.

2)     The more exit conditions included in the decision to close a position, the longer the trade will be held. This is because the likelihood of meeting all of these conditions becomes increasingly rare. Here's the && versus || debate, and how exit conditions can get extremely complicated. The core premise of the && vs || (AND vs OR) debate is that take profit and stop loss can also be expressed by exit conditions, but not by AND. This can be achieved through code changes, and will probably appear in version 2 :-) But if it does, the number of possibilities will grow exponentially.

3)     When comparing two trading setups, the measurement of profit factor only applies to different trading setups with the same approximate trading volume. For example, you should not compare a trading setup of 12 trades per year with a profit factor of 3.4 to a trading setup of 732 trades per year with a profit factor of 2.1. Mathematically, it's apples and oranges. In order to compare these two trading setups, you would need to run only 12 trades per year over 61 years to get an approximate comparison.

4)     When trading a time frame, the trading logic should be reasonably close to that time frame. For example, a trade setup using the M1 time frame should end in a fairly short period of time, as the decision to end after a few weeks has nothing to do with your minute-based entry logic. Likewise, trading setups where core decisions are made based on weekly or monthly timeframes should not be routinely closed on short notice as the entry logic still holds.

5) The number of trades generated by a strategy is a widely underutilized but very important metric. This will yield many results and determining the quality of the strategy will become difficult. Remember, the more conditions you add to your strategy, the fewer deals you will get. You should somehow make a profit by losing these trades. Think of transaction volume as a cost. The perfect strategy would be one that trades every price move, with no losses and no retracements. It's impossible, so we just assume. Therefore, the worst strategy is to trade only once, which will lose money and consume your entire account. I can explain the importance of trading on both a macro and micro level. On a macro level, let's say you have a crazy strategy that generates 1000 trades per year with a profit of $150. You add more conditions to the strategy and earn $160 per year, but only on 10 trades. Yes, more money, but can you really believe 10 trades a year? At a micro level, this measure allows you to use lost transaction costs for comparison. For example, if your trading scenario generates 500 trades with a profit of $80 and a drawdown of 3%, and the new condition you add generates only 480 trades but generates a profit of $95 and a drawdown of 7%. You can measure that you lost 20 trades and lost 5%, with a profit of $15. You don't want to add a new condition and result in 400 trades with a profit of $75 and a drawdown of 3%. You can measure that you have lost money on a trade, but you have also lost profits!

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5

Testinator for testing massive combinations of trade setups - expert for MetaTrader 5


Attachment download

📎 testinator_v1.30a.mq5 (101.41 KB)

Source: MQL5 #27546

Verification code Refresh