Trend Following, Exponential Moving Average, P&Q Rules

Trend-following system using EMA with P&Q entry thresholds, applied to Hang Seng futures, stocks and currencies. Full rules and Pine Script logic.

Published · Updated · Methodology: Technical Indicators

Part of: EMA Strategies

  • Methodology: Technical Indicators
  • Content type: strategy
  • Timeframes: Intra-day (minutes), Inter-day (days)
  • Markets: Stock Market, Hong Kong Hang Seng future indices, Currency markets

Indicators used

  • EMA
  • P (Entry Threshold)
  • Q (Exit Threshold)

Source video

Decoded from: Microsoft Word - bieeba_tf_draft05.doc by fst.um.edu.mo — watch the original

Strategy overview

Trend following, in its most reduced form, is the decision to hold a position while a measured trend persists and to close it once that measurement turns — and this entry arrives at it from an unusually formal direction. The source is not a trading channel: it is a draft document hosted on the Faculty of Science and Technology domain of the University of Macau, catalogued here under the filename it was decoded from — a Word document name that was never meant to serve as a title. That detail sets the register honestly. This is working-paper material, written for readers who expect a specification rather than a chart walkthrough.

What makes the entry distinctive is how little of it is visual. The method is stated as three named quantities: an exponential moving average that carries the trend, an entry threshold P, and an exit threshold Q. There is no discretion in that description and no market opinion in it — being in or out of a position reduces to a comparison against numbers. Governing entry and exit with two separate parameters rather than one reversing signal is itself a design statement: the exit is not assumed to be the mirror image of the entry, and the document treats P and Q as values to be determined from data rather than constants to be handed down. The catalogue entry spans both intraday (minutes) and inter-day (days) horizons, which fits a specification written to be scale-agnostic — the same three parameters, re-fitted, at whatever resolution.

That is also where the honest caution sits. Parameters obtained from historical price data are the part of any system most likely to have absorbed the particulars of that data, and a specification travels much more easily than the numbers that make it work. No structured rules were extracted from this source, and it carries no timestamped segments to navigate, so this page stays at the level of the concept and the framing the document itself gives it rather than presenting a rule set.

Topics

trend following strategy · ema strategy · p&q rules · stock market strategy · hong kong hang seng strategy · forex strategy · intraday strategy · swing trading · tradingview strategy · pine script · technical indicators · ema trend following · currency trading strategy

Frequently asked questions

What does the P&Q framing mean in a trend-following strategy?

It refers to a pair of thresholds rather than a single signal: one governs when a move is considered established enough to open a position, the other when a counter-move is considered enough to close it. Their values are treated as quantities to be determined from data, not as fixed constants.

Is this strategy taken from a YouTube video?

No. Unlike most entries in the catalogue, the source here is an academic draft document hosted on a university faculty domain (fst.um.edu.mo), not a trading channel — which is why it is catalogued under a document filename and carries no timestamps.

Why do trend-following systems tend to use an exponential moving average?

An EMA weights recent prices more heavily than older ones, so it turns sooner than a simple average of the same length. In a system whose only job is to decide whether a trend is still intact, that responsiveness is the trade-off being tuned — faster reaction against more false turns.

Can a strategy described this abstractly be tested?

Only after you commit to specific values for the averaging length and the two thresholds, since the description is a template rather than a finished rule set. Strategy Decoder catalogues sources like this one, but no structured rules were extracted from this document, so any testing means implementing and fitting the concept yourself on historical data before risking capital.

About this strategy page

This trading strategy was decoded by Strategy Decoder's AI from a public YouTube trading video and turned into a structured, reviewable specification. In the interactive app this page shows the full entry and exit logic, risk management settings, the indicators involved with their parameters, AlgoWizard-compatible logic and a Pine Script export ready for TradingView backtesting — plus an automated backtest verdict when one has been computed for this strategy.

Strategy Decoder catalogs 2,229 decoded strategies. Each one is extracted with confidence scoring, cross-linked to the indicators it uses, and kept up to date as new videos are processed daily. Load this page with JavaScript enabled to use the interactive tools, or start from the strategy explorer to filter by methodology, market and timeframe.

Other versions of this strategy

More decoded strategies