Filtering entries of a trend-following strategy

 

Hello everyone!

I am developing a trend-following strategy.

The working principle is quite simple: there is a base moving average (indicating the trend direction) and additional filters - moving averages on several timeframes - the price closes above the filters on the working timeframe - it opens a long position.
The working timeframe is from H2 to H6.
It can open up to 10 long positions along the trend, with the same entry logic for all.
Strict risk rules (fixed SL/TP, BE)
Position exit is slow - using a special trailing stop.

The number of entries is considerable, but due to the high risk-reward ratio, the mathematical expectation is good.
The logic is simple (see the trend - add positions along the trend - exit positions // resilience in a flat market - profit on large trends). The strategy is viable and I would like to improve it.

Several questions have arisen during implementation. Perhaps someone has encountered or worked with similar strategies:

1. Flat market filtering and early trend detection - does anyone have ideas on what could replace or supplement moving averages to reduce false entries?

2. Pyramiding filtering (adding positions) - how to organize position accumulation along the trend while preserving the overall logic?

3. Drawdown compression - it is essential, especially during flat market periods. The question is how to optimally implement going into protection and risk return (what professional solutions exist)?

 
ivanov86:
3. Drawdown compression - it is essential, especially during flat market periods. The question is how to optimally implement going into protection and risk return (what professional solutions exist)?

Forum on trading, automated trading systems and testing trading strategies

If an EA Is Truly Profitable, Why Sell It?

Ryan L Johnson, 2026.06.07 17:17

Here's a little known position sizing method to help with scaling up.

Let's assume that you have a simple entry and exit EA with a profit factor of 1.5, for example:

  1. Run it through the Tester.
  2. Read the Tester Report carefully.
  3. Pay particular attention to the months, days, and hours in which the EA is profitable.
  4. Code a time filter that blocks entries during the worst times in the EA.
  5. Run a fresh backtest with the time filter implemented.
  6. Examine the average count of consecutive loss trades─let's call this "NL".
  7. Code automatic position sizing based on say, 1% of account balance, into the EA.
  8. Code an exception to that 1% position size that triggers when NL+1 occurs (the EA has exceed its average loss count).
  9. Code an overriding minimum position size of say, 0.01, to operate when that exception occurs.

The purpose of that process is to solve the mystery of attempting to predict when the EA's logic will be profitable versus unprofitable. Arguably, the best way to track live prices, spread, slippage, etc. is to simply continue trading. Of course, it's nonsensical to continue on trading as if losing streaks don't exist─hence, the bottomed-out position size at the start of each losing streak. As soon as a tiny trade returns a profit, the balance-based position size is once again in effect. As a result the account balance grows, the default position size grows, the account balance grows─it's a vicious "profit loop." Get ready to add some zeros to the backend of your EA's net profit.


 
ivanov86:
1. Flat market filtering and early trend detection - does anyone have ideas on what could replace or supplement moving averages to reduce false entries?
Trend strength, directional momentum, or checking for significant volume (trading participation).
 
ivanov86:
2. Pyramiding filtering (adding positions) - how to organize position accumulation along the trend while preserving the overall logic?

As you're using only trend filters, you need to define short-term pullbacks that occur above your initial long entry price, and below your initial short entry price, respectively. This can be done using a leading indicator such as a Stochastic oscillator.

If you want to try to kill 2 birds with one stone (in relation to Conor Mcnamara's Post #2), use a Stochastic RSI oscillator instead.

 
Ryan L Johnson #:

As you're using only trend filters, you need to define short-term pullbacks that occur above your initial long entry price, and below your initial short entry price, respectively. This can be done using a leading indicator such as a Stochastic oscillator.

If you want to try to kill 2 birds with one stone (in relation to Conor Mcnamara's Post #2), use a Stochastic RSI oscillator instead.

Regarding pullbacks — 100%, but they will be implemented separately (in addition to trend-following, with their own dedicated total risk and logic). This is as a supplement and diversification (along with the same backreversals).

But right now my brain is hurting from:

  1. How to identify a trend with an adequate number of entries/losses.

  2. How to adequately filter entries during a trend.

I am approaching it fundamentally and mathematically (moving from general to specific):

  1. There is statistics — time interval / number of H2-6 candles over a period and the number of trend moves where we can make money.

  2. Suppose we enter after every green H4 candle — the number of entries decreases.

  3. The candle close must be above a certain moving average — the number of entries decreases. The moving average reflects price direction and the strength of the current candle relative to the chosen period. Possibly add volatility adaptation (MA + ATR).

  4. We open the first position, price moves higher — we add positions along the trend (yes, the average purchase price will be higher, but we can safely use larger risk if the trend confirms; if it doesn't, we risk little).

  5. When to add? Probably when price shows strength and wants to move higher — what signals that? Probably micro breakouts of local levels, breakouts of an MA on the high price with a short period, or price recovery after local pullbacks (where we could also add pullback entries).

  6. Drawdown compression is a survival tool in flat markets. We go into protection, but we also need to adequately restore the risk multiplier to normal. Option — use multi-level compression from total drawdown + additional (parallel) stepwise risk compression during series of stop losses (e.g., 10 stop losses, reduce risk by 30%, do this N times) — with stepwise risk recovery (at minimum when the open position's equity has enough profit to cover the stop loss of a new position with increased risk).

This is a very rough description — I am still searching, so please don't judge too harshly :)

 
ivanov86 #:
This is a very rough description — I am still searching, so please don't judge too harshly :)

No problem. I'm not judging at all. I'm merely providing ideas based on my experience.😉

My EA reduces its position size in flat markets. Your proposed EA reduces risk in flat markets. Six of one... half dozen of the other.