Skip to content
All library documents

A Moving-Average Stock Strategy with Entry and Exit Conditions

Article SuperMind

Summary

The document presents a single-stock daily trading rule using recent closing prices and moving averages. It buys with available cash when the latest close is more than 1% above the 10-day average. The exit condition in the code is different from the heading’s stated rule: it sells when the latest close is above the 20-day average and the account has a position. It also records the latest price and logs trades.

The example names a Chinese-listed stock and uses the CSI 300 as its benchmark, but provides no performance results despite the heading’s reference to a half-year backtest. The code labels some calculations inconsistently, and its sell condition does not match the title’s claim of selling below a 20-day average. It gives no transaction-cost, position-risk, or out-of-sample analysis, so it does not establish that the rules are profitable.

Key ideas

  • The entry rule buys with available cash when the latest close exceeds the 10-day average by more than 1%.\nThe implemented exit rule sells when the latest close is above the 20-day average while a position is held.\nThe strategy code operates on one stock and sets the CSI 300 as its benchmark.\nThe stated half-year backtest has no reported results in the document.

Tags

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