Skip to content
All library documents

Supertrend and SMA Trend Entries with Basket Profit Controls

Article Strategy library · Author: sorimag918

Summary

This TradingView strategy combines fast and slow Supertrend lines with a simple moving average to set directional bias. It enters long when the fast line is above the slow line and price is above the average, and short when the inverse conditions hold. Entries are limited by a maximum open trade count and a time delay between orders, allowing additional positions while a trend condition remains active.

Open positions are managed as a basket using total open profit. The script closes all trades at a profit target, applies a trailing basket threshold after a profit trigger, and closes the basket at a specified loss threshold. The document provides source code and parameter inputs, but no backtest results or performance analysis. Its DCA distance input is unused, and the reported equity-loss approximation relies on open profit rather than account equity; results may also depend on chart settings and execution assumptions.

Key ideas

  • Long and short entries require aligned fast and slow Supertrend values and price relative to an SMA.
  • The strategy can add positions subject to an open trade limit and a delay between orders.
  • Basket exits use a profit target, a trailing profit level, and an open-profit loss threshold.
  • The configured DCA distance does not affect the provided entry logic.
  • The document provides code but no evidence of historical performance.

Tags

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