Premium Market Analysis, Trader Education, Software, and Trading Strategies. Thirty Years Of Skin In The Game

Quantitative trading

Price Action Anomaly Detection Time Lags

Photo by AlphaTradeZone

The best anomaly detection signals have zero maximum adverse excursion but they are rare. There is often a lag before the signal starts generating a profit.

The Maximum Adverse Excursion (developed by John Sweeney), or MAE, is the maximum loss generated after a trade is placed.

An MAE of zero is always desirable but rarely possible. Markets are volatile and most profitable trades have non-zero MAE.

Our price action anomaly detection algorithm attempts to minimize MAE but there will always be trades that go against the initial signal.

A recent example was a long signal for SPY ETF after the close of January 18, 2023.


The above price action anomaly signals were generated by scanning 31 ETFs in the daily timeframe. After the signals were generated, they were validated on a portfolio of all 31 ETFs. Those that met the criteria were considered potential price action anomalies. The portfolio backtest results for the above example are shown below.


The SPY signal met the criteria for potential price action anomalies but the trade MAE from the open of the next day to the low was -0.54%. However, the next day the market opened higher and rallied, and also yesterday moved higher, as shown in the chart below.


The gain from the open of January 19 to the close of January 23 was +2.8% and the MFE (Maximum Favorable Excursion) was +3.3%. This price anomaly signal had a lag of one day before it started generating a profit.

An example of QQQ ETF from November 8, 2022, is included in this article. 

Q1: What is a reasonable lag for price action anomalies before they start generating a profit?

A reasonable lag to determine whether the anomaly is valid is one day maximum. After that, the strength of the anomaly diminishes fast. Identifying price action anomalies that profit immediately is possible but rare, but a lag of more than one day usually means the signal was a Type-I, of a false positive.

Q2: What is the maximum lag after which it is preferable to close a losing trade?

We believe that two days is the maximum lag for closing a losing trade but context is important. These are discretionary quantitative trades and more parameters should be factored in to decide when to close the losers, including a stop-loss.

Q3: Let profits of profitable trades run, or close them as soon as they generate a profit?

Price action anomaly detection and trading are not related to trend following but have a very short-term nature. Therefore, if at a close of a day, there is a profit, it may be better to close the trade and search for the next anomaly. However, this is not a rule of some sort but a heuristic. Context is always important.

10% off all premium content, strategies, and software, with Discount Code NOW10. Click here to subscribe.

By subscribing you have immediate access to hundreds of articles. Premium Insights subscribers have immediate access to more than a hundred articles and All in One subscribers have access to all premium articles, books, premium insights, and market signals content.



Subscribe for free notifications of new posts and updates from the Price Action Lab Blog and get the PDF book “Profitability and Systematic Trading” (Wiley, 2008) free of charge.

Disclaimer:  No part of the analysis in this blog constitutes a trade recommendation. The past performance of any trading system or methodology is not necessarily indicative of future results. Read the full disclaimer here.

Charting and backtesting program: Amibroker. Data provider: Norgate Data