Skip to content
All library documents

Contrarian Trading from Retail Sentiment with a Moving Average Filter

Article MQL5 code base

Summary

The document outlines an automated trading approach that uses retail positioning data from an external sentiment API. Its contrarian premise is to consider selling when retail traders are predominantly long and buying when they are predominantly short. A moving average crossover filter is described as a technical confirmation layer, while chart elements display the sentiment readings to the user.

The text explains how to configure the expert advisor in MetaTrader 4, including supplying an API key, setting short and long moving-average periods, and enabling automated trading. It frames retail positioning as a possible sign of crowded trades or reversal risk, but provides no implementation details for the crossover rules, thresholds, trade exits, sizing, or risk limits. No backtest, performance results, or evidence that retail traders systematically take the wrong side is included, so the stated rationale remains a hypothesis rather than a demonstrated edge.

Key ideas

  • The approach takes a contrarian view of retail positioning, selling crowded long exposure and buying crowded short exposure.
  • A moving average crossover serves as a technical filter alongside sentiment data.
  • The expert advisor can visualize sentiment and optionally trade automatically after API setup.
  • The document provides no performance evidence or detailed exit and risk-management rules.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.