Skip to content
All library documents

EMA Crossover Trading Strategy with Reversed Signal Conditions

Article Strategy library · Author: adrock22

Summary

This short script plots 12-period and 26-period exponential moving averages and opens long or short positions when their crossover conditions trigger. Its buy condition checks whether the 26-period average crosses above the 12-period average; its sell condition checks the reverse. Those directions are opposite the conventional interpretation in which the faster average crossing above the slower average is typically treated as bullish. A comment on the page raises this issue, and another commenter reports that the code does not run.

The page identifies the script as a backtest trading bot, but provides no market, test interval, performance report, risk controls, or evidence that the signals are profitable. It is therefore useful mainly as an example of a basic moving-average crossover and of why signal definitions and executable behavior should be checked. The displayed code uses entries on crossover events and plots both averages; the document does not describe exits beyond subsequent opposing entries.

Key ideas

  • The script uses crossovers between 12-period and 26-period exponential moving averages to trigger entries.
  • Its buy and sell conditions place the slower average's crossover direction opposite to the conventional bullish and bearish interpretation.
  • The page includes a comment questioning the signal direction and another reporting that the code fails to run.
  • No test results or risk-management rules are supplied, so profitability cannot be assessed.

Tags

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