Filtering entries and exits of the Renko EA

This post is a follow-up to "Open Source Renko EA for Metatrader 5". If you have not seen that post, please read it now.


Renko EA provides access to four filters. Three are moving average based, and one built around the super trend indicator. If you are using the Ultimate Renko indicator for renko charting on MT5, you have access to the following moving average types:

  • Exponential moving average
  • Linear-Weighted moving average
  • Linear Regression
  • Simple moving average
  • Smoothed moving average
  • A volume-Weighted moving average using tick volume
  • A volume-Weighted moving average using real volume
Any one of these may serve as an entry or exit filter by the renko trading robot. All filters are disabled by default.


Using the moving average filters in renko trading

To utilize the moving average filters in the Renko EA, the ultimate renko indicator must have the corresponding moving averages (MA1, MA2, and MA3) active.

 

You only need to enable the MAs that will function as filters. If you need all three MAs as filters, they need to be enabled.

The logic behind the MA filters 1, 2, and 3 for renko trading

The filter logic is defined in the Renko_EA_Logic.mqh and Filters.mqh files. Renko EA's TryOpenTrade method first checks the individual filters (via FilterShortOK and Filter LongOK methods) and enters a trade if all filter conditions are acknowledged.
 
The MA filters check if the last completed renko brick opened or closed below the MA(s) for a valid short trade and opened or closed above the MA(s) for a valid long trade. All filters must comply.


 
The idea is really simple - only short signals below the MA(s) and only long signals above the MA(s) are valid.

Using the super trend filter in the Renko EA

To take advantage of the super trend filter of the renko EA, the ultimate renko indicator must have the super trend channel enabled. 

 

The logic behind the super trend filter is identical to the MA filter logic. The super trend's middle line is treated as an MA. Valid signals are short signals below the supper trend line and long signals above the super trend line.


What about the exits?

Filtered exits work differently. If any of the filters are set for exits or entries & exits, the OkToCloseByFilter method is checked.

The logic here is to use the filter(s) as valid exit conditions. For example, if we use the MA1 (21 EMA) and Super Trend filters for the exits, short trades will be closed if the renko closes or opens above MA1 and the Super Trend line. Long trades will be closed if the renko closes or opens below MA1 and the Super Trend line.



The renko indicator for MT5 can be downloaded from >> here <<. It already includes the Renko EA source code. You may use it as a reference for creating your personal EA.  If you wish to use a different renko solution for Metatrader, you can grab the renko EA source from GitHub and modify it freely.

You'll find more information on filtering entries in the following post: https://renko-trading-robots.blogspot.com/2021/02/refined-filters-in-renko-ea-version-2.html

Please post your comments and suggestions for improvement blow.


Comments

Popular posts from this blog

Open Source Renko EA for Metatrader 5

Refined filters in Renko EA version 2