Skip to content
All library documents

Strategy Template with Loss Controls and Configurable Trailing Stops

Article TradingView scripts

Summary

This script is a reusable strategy scaffold rather than a distinctive entry system. Its example rules go long when price is above a 100-period EMA and short when price is below it, while requiring the strategy to be flat. Users can limit long and short entries to separate sessions and can choose percentage, ATR, or swing-based exit logic, with options for static or trailing stops and intra-bar or confirmed-bar evaluation.

The template also includes a maximum cash drawdown rule and an optional loss-streak pause measured against a selected timeframe. The included code focuses on implementation choices and risk controls; it does not provide backtest results or evidence that the sample EMA conditions have an edge. Some logic is truncated in the supplied document, and the default session and disabled streak control may need review before use. Its main value is as a configurable starting point for strategy development and testing.

Key ideas

  • The sample entry rules take long positions above a 100-period EMA and short positions below it.
  • Separate session inputs can constrain when long and short entries are allowed.
  • Exit choices include percentage, ATR, and swing-based trails, with static-stop and bar-evaluation options.
  • An optional loss-streak pause and a cash drawdown limit provide basic risk controls.
  • The document contains no performance evidence for the template or its sample signals.

Tags

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