Strategy · Pine Script v5 · On the chart

Custom Strategy with DSMA

by wynnforthework

This strategy calculates short and long-period Deviation Scaled Moving Averages (DSMA) powered by a SuperSmoother filter to adapt to price volatility.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code118
Settings14inputs
LicenceNone stated
Last update1 year ago7 Oct 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Custom Strategy with DSMA combines breakout bands, RSI momentum levels, and long-term EMA trend filters to signal entries. Position sizing is calculated dynamically using ATR and a defined account risk percentage. The strategy uses fixed percentage stop-loss and take-profit targets while allowing up to three pyramid positions. Fast and slow DSMA lines are plotted directly on the main price chart.

Details

Published by

wynnforthework on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Moving averages, Breakout, Oscillators & momentum

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy can add several entries in the same direction

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
每笔交易的风险比例 (%)float0.5risk_per_trade
回溯周期int20lookback
突破倍数float2.0breakout_mult
止损百分比 (%)float1.5stop_loss_percent
止盈百分比 (%)float3.0take_profit_percent
最大开仓数量int3max_positions
ATR 周期int14atr_period
移动平均线长度int100ma_len
RSI 周期int14rsi_period
RSI 超买阈值int70rsi_overbought
RSI 超卖阈值int30rsi_oversold
时间趋势参数timeframeDtimeframe
Show all 14 settings
SettingTypeDefaultVariable
开始时间timetimestamp("01 Dec 2022 03:00 +0000")startTime
结束时间timetimestamp("01 Jan 2028 23:59 +0000")endTime
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

106 stars

Calculates a momentum squeeze using Bollinger Bands and Keltner Channels alongside a trend-filtering moving average. It generates long and short entries based on squeeze momentum bar conditions and an optional pre-squeeze dot count filter. Exits can trigger on

Strategy v5 Oscillators & momentumVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of Athena Momentum Squeeze - Autoview

Bollinger bands examples

by tradingstrategy-ai
53 stars

This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open

Strategy v5 Volatility & bandsOscillators & momentum
Updated 3 years ago · None stated GitHub repository of Bollinger bands examples

ADA4H Optuna Strategy

by skywalker0803r
42 stars

This strategy trades longs and shorts on the price chart. Long entries require a close above the prior Donchian high, a close above a long-term SMA, and RSI above a threshold, with size set as a percentage of equity. Long exits use a stop at the prior Donchian

Strategy v5 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of ADA4H Optuna Strategy

Edge 59

by subos2008
6 stars

Edge 59 is a price-chart strategy that combines an ADX directional filter, a weighted moving average, and a trend-follower channel. The channel uses an exponential moving average of close, optionally smoothed by linear regression, and a percentage of a fixed 2

Strategy v5 TrendOscillators & momentum Repaints
Updated 2 years ago · Custom licence GitHub repository of Edge 59

AG Momentum Breakout

by eltonaguiar
4 stars

AG Momentum Breakout is a strategy that identifies continuation signals after pullbacks in trending markets. It filters for uptrends using EMAs and detects recent pullbacks via RSI conditions before entering on RSI crossovers above 50 with ADX confirmation. Th

Strategy v6 TrendOscillators & momentum
Updated today · None stated GitHub repository of AG Momentum Breakout
4 stars

Christian Qullamaggie Strategy is a trend-following and breakout strategy overlay designed to identify high-momentum trading opportunities directly on the price chart. It evaluates market conditions using fast, mid, and slow EMAs, average true range (ATR), and

Strategy v6 BreakoutTrend
Updated 7 months ago · None stated GitHub repository of Christian Qullamaggie Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers