本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//Created by Rouxam
// Hey Folks, this is in indicator that generates buy alerts combining Bollinger Bands and RSI.
// RSI validates the BB signal by confirming we are not in an oversold area.
//Interval: 3m to 15m
// Recommended settings for 3commas DCA bot
//- TP/TTP: 0.3%/0.1%,
//- Base Order: Your choice,
//- Safety Order: 1.2 * Your choice of base order
//- Safety Order Volume Scale: 1.2,
//- Safety Order Step Scale: 1.5,
//- Price Deviation to Open Safety Order (% from initial order): 0.25%,
//- Max Safety Trades Count: 7
//- DO NOT USE STOP LOSS
//
//> Create Alert with Buy Alert and link it to "Message for deal start signal"
//@version=4
study("Bollinger Bands Alerts for 3commas/DCA bot", overlay=true)
sigma = input(1.8, maxval=2.0, title="Standard Deviation")
ma_period = input(30, minval=1, title="Simple MA period")
rsi_period = input(14, minval=5, title="RSI Period")
rsi_ob = input(65, maxval=100, title="RSI Overbought threshold")
src = close
basis = sma(src, ma_period)
std_dev = sigma * stdev(src, ma_period)
upper = basis + std_dev
lower = basis - std_dev
below = src < lower
reset = low < basis
above = src > upper
buy_signal = crossunder(barssince(above), barssince(reset)) and rsi(close, rsi_period) < rsi_ob
plotshape(buy_signal, color=color.green, style=shape.triangleup, size=size.small, location=location.belowbar)
upper_plot = plot(upper, color=color.gray, transp=20, title = "Upper Band")
lower_plot = plot(lower, color=color.gray, transp=20, title = "Lower Band")
fill(lower_plot, upper_plot, color=color.gray, transp=95)