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
71 lines of Pine Script v5 from strategy/周末震荡策略.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
周末布林带策略 opens a short when price crosses above the upper band while below the average, and a long when price crosses below the lower band while above the average. Entries are allowed only on Saturday or Sunday, inside a chosen date range, and only when the position is flat for more than ten bars. Size scales with an input leverage and equity. Exits use a two percent stop plus a trailing offset. Fixed take-profit orders in the source are commented out.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
杠杆倍数
float
1.5
input_leverage
开始
time
timestamp('1 Jan 2021')
startPeriodTime
结束
time
timestamp('31 Dec 2099')
endPeriodTime
布林带长度
int
25
bullLength
布林带倍数
float
2.0
bullMulti
趋势平均线长度
int
89
maLength
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 places resting limit orders at VWAP for pullbacks in the direction of a higher-timeframe EMA trend. Longs require the fast EMA above the slow EMA, a rising VWAP, and price above VWAP; shorts mirror those rules. A filled trade uses an ATR multiple
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 overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk
The Mean Reversion Strategy Template calculates a baseline mean using SMA, EMA, or VWAP alongside upper and lower deviation bands based on standard deviation, ATR, or percentage offsets. It generates long and short entries when price touches, bounces from, or
This strategy backtests a long Bollinger Band deal on the price chart for 3Commas-style bots. It plots short and long simple moving averages, offset bands, and the average entry price of the open deal. A long starts when price crosses the lower band inside a c
This strategy generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po