Netsrac TradeAid - A detailed example of strategy development

14 April 2024, 18:13
Carsten Pflug
0
100

This article is related to the Expert Advisor "TradeAid", which can be found in the market here: https://www.mql5.com/en/market/product/115824/


Let's develop a simple strategy with TraidAid - I think this is the easiest way to understand how TraidAid works. We will use the MT5 strategy tester. I assume that you know how to use it. If not, you should definitely look into it.

Let's start with what is probably the simplest thing you can do in trading. We build a moving average cross from a slow and a fast moving average and apply this to GBPUSD. We use the M30 timeframe and a simple stop well as a simple take profit. We specify both in pips. Of course, we already know that this will not be enough for financial prosperity, but let's start slowly.

We go to the "ENTRY SECTION SELECT" area and select "true" for "Use Moving Average section". This tells the EA that the moving average section should be relevant for opening a trade. Important: All other values for "ENTRY SECTION SELECT" are set to "false".


To reiterate: the section settings will only have an influence on the opening of a trade if "true" is selected.

Now go to the "EXIT SECTION SELECT" area and select "true" for "Use Simple Stoploss / Simple Takeprofit". All others must be left at "false".


Scroll down a little until you reach the "TRADE SETTINGS" area. Here we correct the lot size, if necessary, as well as the magic and the order comment. Important: Always use a unique magic if you are running several strategies in one Metatrader instance.

Keep scrolling until you reach the "MOVING AVERAGES" section. This shouldn't take long. Let's build a cross from a 6 and a 40 EMA. We had also decided to work in a 30-minute timeframe. So we set the following for "Moving Average 1":

Timeframe of MA 1         30 Minutes
Period MA 1                       6

We set the following for “Moving Average 2”:

Timeframe of MA 2         30 Minutes
Period MA 2                       40

We leave all other settings unchanged. You can make optimisations here later if you wish. Take a look at the settings in the screenshot:


If you scroll down a little further (you can already see it in the screenshot), you will reach the magic part of TraidAid. In the "Moving Average Conditions" you define the rules according to which a trade is to take place. Let's build the cross. We select "Long" for the condition "MA 1 crosses MA 2 upwards". For the condition "MA 1 crosses MA 2 downwards", we logically select "Short".

What have we done with these settings? We tell the TraidAid to go "long" when MA 1 (the fast moving average) crosses MA 2 (the slow moving average) upwards. It should go "short" if it is the other way round.

We leave all other conditions at "---". This means that these conditions are not analysed. But I'm sure you already have ideas about what to do with them, don't you?

Now we need to configure the stop and the take profit. To do this, scroll down until you reach "SIMPLE STOPLOSS / SIMPLE TAKEPROFIT". Let's make it simple and use a stop of 20 pips and a take profit of 40 pips. This corresponds to a risk/reward ratio of 1:2.


We now have the strategy tester carry out a backtest. This will be more or less good or bad. It won't be particularly great. This is what it looks like for me:


Let's use this data to develop the strategy further and add another condition. As we can see, the strategy is profitable on Tuesday, Wednesday and Thursday. It does not perform so well on Monday and Friday. In addition, many losses are made early in the morning. So let's see how we can use the time functions of the TraidAid. Important: Note that the MT5 backtester calculates profits and losses of a trade when it has been closed. So we have to think a bit and draw conclusions about the opening times.

In the settings, scroll all the way up to "ENTRY SECTION SELECT" and now set the "Use Time section" option to "true" in addition to the Moving Average section. This tells TraidAid that it should now also take the time into account in addition to the moving average cross. This is what the settings now look like:


So leave the settings you made earlier in the Moving Averages area untouched and scroll down until you reach "TIME". We will now set the time functions there.


We have defined that our time window should be open from 5 am to 2 pm. To do this, we have set "Timehour 1" to 5 and "Timehour 2" to 14. With the conditions "Time is after Time 1" and "Time is before Time 2", we have defined that we want to trade after Time 1 and before Time 2. Please note: We have not specified "Long" or "Short" here, but "Trade allowed". Our moving average cross is still a condition for a trade, but is now only "allowed" if the time is right. Got it? If not, read again - these things are very important for understanding the TradeAid. Especially when the strategies become more complex.

Now please take a look at the days of the week. We have a "true" on all days, but Monday and Friday have a "false". Think about what this could mean.

Sure. No trades are opened on Mondays and Fridays, no matter what time and what cross we have.

So let's run the backtest again. It now looks like this for me:



Now let's add one last parameter. It might be a good idea to use a higher-level filter for entry. How about if we take an RSI from the 4 hour chart and use it as an additional filter for entry? Let's give it a try.

Scroll all the way up to "ENTRY SECTION SELECT" and set "Use RSI section" to "true". We have now activated three conditions.


Now scroll down to "RELATIVE STRENGTH INDEX - RSI" and set things up as shown in the screenshot. Pay particular attention to the relationship between the configured "Level 1" and the conditions "RSI is above Level 1" and "RSI is below Level 1".


With these settings, we want to ensure that a trade is only entered into if the RSI of the higher-level timeframe H4 is above or below the 50 line. In this way, we want to follow the overriding trend. Let's now run the test one more time:


That already looks good. Now, however, it is important to test this strategy further. There is always a risk with this type of strategy development that over-optimisation has taken place. Of course, we have to rule this out by testing other assets and other time periods. It might also be a good idea not to hold trades overnight. Perhaps it makes sense to use another trend indicator such as the ADX. And much much more. The good news is that TradeAid can do all this. And TradeAid will be able to do much more.

Good luck and thanks for reading!

Attached Files:

TradeAid_00_INIT.set - use this setfile to reset the ea to a "init position" without any configured entry or exit parameter - this is a very important setfile in the development process
TradeAid_01_MA_Cross_ATR.set - a simple MA-cross strategy with ATR stop an ATR take profit
TradeAid_02_MA_Cross_RSI_Time.set - this is the setfile for our example in this article