Pinbar with MA: filter Pinbars with the trend and enter when price touches the MA

Used alone, Pinbars often signal against the trend. This article explains how to use a moving average to keep only Pinbars in the trend direction, two common ways to enter, and what to watch out for.

KnowledgeHoang Trong · 18/11/2026 · 5 min read

What is a Pinbar

Pinbar (pin bar) is a candle with a small body, one very long wick and a short opposite wick. The long wick shows that during the candle, price was pushed hard in one direction and then pulled back. In other words, the price level at the tip of the wick was rejected.

  • Long lower wick Pinbar (bullish pinbar): sellers pushed price down deep but buyers pulled it back up, hinting at buying pressure.
  • Long upper wick Pinbar (bearish pinbar): buyers pushed price up high but sellers pulled it back down, hinting at selling pressure.

A common way to measure it: the long wick is at least 60% of the candle length, the body no more than 30%, and the opposite wick no more than 15%.

Why combine it with an MA

Pinbars appear very often, and many go against the main trend. For example, in a strong downtrend there is the occasional long lower wick Pinbar, but price usually only ticks up a little before falling further.

A moving average (MA) is a simple way to define the trend: price above the MA is an uptrend, below it a downtrend. Combined, we only keep Pinbars that go with the trend:

  • Price above the MA: only consider long lower wick Pinbars to BUY.
  • Price below the MA: only consider long upper wick Pinbars to SELL.

This filter removes most counter-trend Pinbars, at the cost of fewer signals.

Two ways to enter

1. With the trend. Every Pinbar in the MA direction is a signal. A long lower wick Pinbar closing above the MA is a BUY; a long upper wick Pinbar closing below the MA is a SELL. This gives more signals.

2. Pinbar touches the MA. Stricter: the Pinbar's wick must touch or pierce the MA. This is when price pulls back to the MA within a trend, the MA acts as dynamic support (or resistance), and price is pushed back in the trend direction. Many Price Action traders see this as a clean entry because two reasons line up at once: an important price area and a rejection candle.

With both approaches, wait for the Pinbar candle to close before acting. A forming candle can look like a Pinbar and turn into something else by the time it closes.

Which MA to use

  • Period: a short MA (20) hugs price and changes trend quickly; a long MA (100, 200) is slower but steadier. 50 is often used as a middle ground.
  • MA type: EMA reacts faster to recent prices than SMA, so it's often used for the touch-the-MA scenario.
  • Timeframe: the same settings give different results on different timeframes. Test on the timeframe you plan to use.

There are no settings that work for every market. The best approach is to backtest a few sets of settings and choose the one that fits how you trade.

Things to watch out for

  • Ranging markets: price keeps crossing back and forth over the MA, the trend is unclear and signals fail easily. This is a weakness shared by every MA-based method.
  • Always use a stop loss: a Pinbar is a probability, not a certainty. Many traders place the stop loss below the Pinbar's wick (for a BUY) or above it (for a SELL).
  • Candle size: very small Pinbars (when price barely moves) mean little. Set a minimum candle length.

Automating it with an EA

Watching for trend-following Pinbars by eye means sitting in front of the screen every time a candle closes. Pinbar with MA Forex Robot (GD-4002) does this automatically in MetaTrader 4 and MetaTrader 5: it detects Pinbars by the ratios you set, filters them by the MA, includes both the With the trend and Touch MA scenarios, plus stop loss, take profit, break-even and Trailing Stop. The EA has a 7-day demo trial so you can check it first.

If you'd rather use Pinbars with RSI instead of an MA, see Pinbar with RSI Forex Robot (GD-4001).

More articlesHow to enable WebRequest on MT4 and MT5 (with menu paths)→What is an EA? What to know before using a trading robot→Building an EA for prop firm challenges: 6 must-have risk rules→

Have a strategy you want to automate?

Call or message on Zalo for advice and a quote within 1 hour.