1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
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
146 lines of Pine Script v5 from BEAM DCA Strategy Monthly.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.
BEAM DCA Strategy Monthly normalizes asset risk between 0 and 1, placing buy orders when risk falls below 0.5 on a specific day of the month and triggering sell orders when risk rises above 0.5. User settings allow adjustment of DCA amounts, execution days, backtest date filters, and optional linear or parabolic diminishing returns models. It plots on the main chart without predefined stop-loss orders.
Risk level bands derived from moving average baseline
Monthly dollar-cost averaging on user-selected days
Linear and parabolic diminishing returns adjustments
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Diminishing Returns
string
Off
T_ceiling
DCA Day of Month
int
1
day
DCA Amount
int
1000
DCAamount
Buy Orders
bool
true
T_buy
Sell Orders
bool
true
T_sell
Backtest Start Year
int
2018
testStartYear
Backtest Start Month
int
1
testStartMonth
Backtest Start Day
int
1
testStartDay
Backtest Period (days)
int
9999
testPeriodLen
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.
This strategy combines two sets of Bollinger Bands with a Laguerre RSI oscillator plotted on the price chart. It generates buy and sell signals when price touches the upper or lower bands or zones. The strategy allows enabling or disabling entries and includes
This strategy plots Bollinger Bands directly on the price chart. It computes the middle band as the simple moving average of the close price over the input length and the upper and lower bands by multiplying the standard deviation by the multiplier and adding
The script calculates the yield spread between long-term and short-term US Treasury yields (T10Y2Y or manual US10Y minus US02Y) and plots the spread line on a separate pane. It signals long entries on steepening beyond a user threshold in reversion mode or SMA
This strategy plots Bollinger Bands on the price chart with adjustable length, standard deviation, and offset. It defines buy and sell zones using candle size percentage and body size thresholds. Long positions enter when the lower zone is breached without con
This strategy calculates dynamic support and resistance levels using pivot highs and lows alongside a custom smoothed trend filter and a 3-period EMA. It identifies entry opportunities when price breaks out relative to the trend filter and short-term EMA cross
The Chained Linear Regression Reversal Strategy plots linear regression channels with upper and lower standard deviation bands directly on the price chart across a user-defined time window. When price breaks out of the static channel for a confirmed number of