Strategi ini menggunakan indikator Bollinger Band untuk menilai amplitudo fluktuasi harga, dikombinasikan dengan pola K-line untuk operasi terobosan harga. Rel atas dan bawah Bollinger Band dapat secara kasar menilai tren harga naik dan turun. Menggabungkannya dengan indikator pola K-line dapat mengetahui waktu beli dan jual yang relatif jelas. Strategi ini terutama menilai terobosan di bawah Bollinger Band untuk pergi panjang, terobosan di atas rel untuk pergi pendek, sementara menggabungkan indikator Stoch untuk menilai status overbought dan oversold, dan menggunakan pola K-line untuk memberikan sinyal beli dan jual alternatif.
Strategi ini terdiri dari indikator utama berikut:
Indikator Bollinger Band, termasuk Bollinger middle rail, upper rail dan lower rail. Bollinger Band menghitung rentang fluktuasi harga melalui standar deviasi harga, sehingga menilai tren fluktuasi harga.
Indikator saham, untuk menilai apakah saham berada dalam status overbought atau oversold.
Pola K-line, menilai beberapa pola umum seperti garis besar Yang, garis besar Yin dll sebagai peluang perdagangan alternatif.
Kondisi beli: Harga melintasi rel bawah Bollinger, indikator Stoch menunjukkan status oversold (K<20, D<20), rata-rata bergerak cepat melintasi rata-rata bergerak lambat.
Kondisi jual: Harga melintasi di bawah rel atas Bollinger, atau stop loss ketika menguntungkan.
Strategi ini menggabungkan analisis tren dan penilaian overbought / oversold, yang mengurangi tingkat sinyal palsu, dan memungkinkan masuk pasar tepat waktu ketika tren muncul.
Menggabungkan Bollinger Band dan indikator Stoch, dapat membeli pada titik rendah yang jelas, mengurangi risiko.
Pola K-line berfungsi sebagai kondisi tambahan, menghindari pembelian yang salah di pasar yang terikat jangkauan.
Mengadopsi penilaian kondisi ganda meningkatkan stabilitas dan keandalan strategi.
Mekanisme stop loss menghindari kerugian besar.
Perdagangan dengan Bollinger Bands cenderung terjebak. Diskontinuitas harga dapat menyebabkan kerugian yang relatif besar.
Indikator Stoch memiliki probabilitas tinggi untuk mengeluarkan sinyal palsu.
Sangat mudah untuk menghasilkan sinyal perdagangan yang salah di pasar yang terikat rentang.
Butuh stop loss tepat waktu untuk mengendalikan risiko.
Perlu memperhatikan kekuatan terobosan untuk menghindari penarikan setelah lonjakan tinggi.
Optimalkan saham, pilih saham dengan fluktuasi besar dan tren yang jelas.
Mengoptimalkan parameter Bollinger, menyesuaikan siklus rel tengah, mengoptimalkan pemahaman titik beli / jual.
Mengoptimalkan parameter Stoch, menyesuaikan siklus garis K dan garis D, meningkatkan keandalan indikator.
Tambahkan penilaian kondisi volume perdagangan untuk menghindari pullback setelah melonjak tinggi.
Tambahkan strategi stop loss seperti trailing stop loss, moving stop loss dll untuk mengendalikan risiko kerugian.
Evaluasi penambahan indikator teknis lainnya seperti MACD, KDJ dll untuk meningkatkan stabilitas strategi.
Uji periode kepemilikan yang berbeda untuk mengoptimalkan rasio keuntungan dan penarikan.
Strategi ini mengintegrasikan Bollinger Band, indikator saham dengan indikator fundamental teknis. Di bawah premis mengendalikan risiko, ia membeli pada harga terendah dan menjual di dekat rekor tertinggi, mewujudkan model keuntungan yang relatif stabil. Tetapi juga membawa risiko seperti terjebak, stop loss yang tidak efektif dll. Meningkatkan stabilitas dan profitabilitas lebih lanjut dapat dicapai dengan mengoptimalkan parameter dan menambahkan indikator penilaian lainnya. Strategi ini cocok untuk investor yang berdagang ketika harga berayun di sekitar zona overbought dan oversold.
/*backtest start: 2023-10-29 00:00:00 end: 2023-11-03 18:00:00 period: 1m basePeriod: 1m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=3 strategy("Bollinger e Tendência", overlay=true) //MÉDIAS periodolenta = 14 periodosimples = 47 periodome = 7 psimples = input(title="Período da média simples", defval=periodosimples) pexp = input(title="Período da média exponencial", defval=periodome) pexplenta = input(title="Período da média exp lenta", defval=periodolenta) msimples = sma(close, psimples) mexp = ema(close, pexp) mexplenta = ema(close, pexplenta) plot(msimples, linewidth=2, color=yellow) plot(mexp, linewidth=5, color=white) plot(mexplenta, linewidth=2, color=orange) //BOLLANGER length = input(21, minval=2) src = input(close, title="Source") mult = input(1.5, minval=0.001, maxval=50) basis = sma(src, length) dev = mult * stdev(src, length) upperBol = basis + dev lowerBol = basis - dev p1 = plot(upperBol, title="Upper", color=blue, linewidth=3) p2 = plot(lowerBol, title="Lower", color=blue, linewidth=3) fill(p1, p2, color = purple, transp=90) //BBW (altura do Bollanger) basis2 = sma(close, 21) bbw = (upperBol-lowerBol)/basis2 //STOCH E FORÇA source = close lengthRSI = input(11, minval=2), lengthStoch = input(7, minval=2) smoothK = input(3,minval=3), smoothD = input(4,minval=3) OverSold = input(20), OverBought = input(80) rsi1 = rsi(source, lengthRSI) k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK) d = sma(k, smoothD) hline(OverSold,color=blue) hline(OverBought,color=blue) // Cor das Tendências (Verde ou Vermelho) // Baseado no código: "Pivot Daily Price Color" (by Rimko) pivot = (high + low + close ) / 3.0 dtime_pivot = request.security(syminfo.tickerid, 'D', pivot[1]) pv = dtime_pivot ? dtime_pivot : na pe = ema(close,periodome) col = sma(close,1)>pv?green:red col2 = sma(close,1)>pe?green:red offs_daily = 0 pp=plot(pv, title="Daily Pivot",style=linebr, color=black,linewidth=2) p=plot(sma(close,1), transp=100, editable=false) pema = plot(pe, title="EMA",style=line, color=black,linewidth=2, transp = 50) fill(p,pema,color=col2,title="EMA to price color", transp = 50) fill(pp,p,color=col, title="Privot to price color", transp = 90) //************************************************************************************************************************************************* // Candles (identificação): // Baseado no código: "Candlesticks Pattern Identified" (by Repo32) trend= input(5, minval=1, title="Trend in Bars") DojiSize = input(0.05, minval=0.01, title="Doji size") data=(abs(open - close) <= (high - low) * DojiSize) //plotchar(data, title="Doji", color=white) plotshape(data, title="Doji", color=white, style=shape.cross) //text='Doji' data6=(close[1] > open[1] and open > close and open <= close[1] and open[1] <= close and open - close < close[1] - open[1] and open[trend] < open) plotshape(data6, title= "Bearish Harami", color=red, style=shape.triangledown) //, text="Harami\nde Baixa" data8=(close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1] and open[trend] < open) plotshape(data8, title= "Bearish Engulfing", color=red, style=shape.triangledown) //, text="Engolfo\nde Baixa" data13=(open[1]<close[1] and open<=open[1] and close<=open and open[trend] < open) plotshape(data13, title= "Bearish Kicker", color=red, style=shape.triangledown) //, text="Kicker\nde Baixa" data14=(((high-low>4*(open-close))and((close-low)/(.001+high-low)>=0.75)and((open-low)/(.001+high-low)>=0.75))and open[trend] < open and high[1] < open and high[2] < open) plotshape(data14, title= "Hanging Man", location=location.belowbar, color=red, style=shape.triangledown) //, text="Enforcado" data7=(open[1] > close[1] and close > open and close <= open[1] and close[1] <= open and close - open < open[1] - close[1] and open[trend] > open) plotshape(data7, title= "Bullish Harami", location=location.belowbar, color=lime, style=shape.triangleup) //, text="Mulher\nGrávida" data9=(open[1] > close[1] and close > open and close >= open[1] and close[1] >= open and close - open > open[1] - close[1] and open[trend] > open) plotshape(data9, title= "Bullish Engulfing", location=location.belowbar, color=lime, style=shape.triangleup) //, text="Engolfo\nde Alta" //uppercandle = highest(10)[1] data10=(close[1] < open[1] and open < low[1] and close > close[1] + ((open[1] - close[1])/2) and close < open[1] and open[trend] > open) plotshape(data10, title= "Piercing Line", location=location.belowbar, color=lime, style=shape.triangleup) //, text="Piercing" lowercandle = lowest(10)[1] data11=(low == open and open < lowercandle and open < close and close > ((high[1] - low[1]) / 2) + low[1] and open[trend] > open) plotshape(data11, title= "Bullish Belt", location=location.belowbar, color=lime, style=shape.triangleup) //, text="Contenção\nde Alta" data12=(open[1]>close[1] and open>=open[1] and close>open and open[trend] > open) plotshape(data12, title= "Bullish Kicker", location=location.belowbar, color=lime, style=shape.triangleup)//, text="Kicker\nde Alta" data5=(((high - low)>3*(open -close)) and ((close - low)/(.001 + high - low) > 0.6) and ((open - low)/(.001 + high - low) > 0.6)) plotshape(data5, title= "Hammer", location=location.belowbar, color=white, style=shape.diamond) data5b=(((high - low)>3*(open -close)) and ((high - close)/(.001 + high - low) > 0.6) and ((high - open)/(.001 + high - low) > 0.6)) plotshape(data5b, title= "Inverted Hammer", location=location.belowbar, color=white, style=shape.diamond) //, text="Martelo\nInvertido" data2=(close[2] > open[2] and min(open[1], close[1]) > close[2] and open < min(open[1], close[1]) and close < open ) //plotshape(data2, title= "Evening Star", location=location.belowbar, color=red, style=shape.arrowdown, text="Estrela\nda Tarde") plotchar(data2, title="Evening Star", color=white) data3=(close[2] < open[2] and max(open[1], close[1]) < close[2] and open > max(open[1], close[1]) and close > open ) //plotshape(data3, title= "Morning Star", location=location.belowbar, color=lime, style=shape.arrowup, text="Estrela\nda Manhã") plotchar(data3, title="Morning Star", color=white, location=location.belowbar) data4=(open[1] < close[1] and open > close[1] and high - max(open, close) >= abs(open - close) * 3 and min(close, open) - low <= abs(open - close)) //plotshape(data4, title= "Shooting Star", color=red, style=shape.arrowdown, text="Estrela\nCadente") plotchar(data4, title="Shooting Star", color=white) //********************************************************************************************************** // Ações: momento = strategy.position_size[0] > strategy.position_size[1] valorcompra = valuewhen(momento, open, 0) valorbbw = input(title="Altura Máxima do Bollinger", defval=10) alerta = crossunder(close, lowerBol) alertcondition(alerta, title='Abaixo da Banda Baixa', message='Fechou abaixo da banda baixa...!') //data7 data9 data10 data11 data12 compra = crossover(close, lowerBol) and ((k<=20) and (d<=20)) and (mexp>mexp[1]) //compra = (data7 or data9 or data10 or data11 or data12) and (msimples>msimples[1]) and ((k<=20) and (d<=20)) and (bbw<valorbbw/1000) //compra = (open<close) and (crossover (close, lowerBol)) and ((k<=20) and (d<=20)) and (bbw<valorbbw/1000) and (msimples>msimples[1]) venda = crossover(close, upperBol) //(close >= (valorcompra + (valorcompra * 0.025))) strategy.entry ("Compra", strategy.long, when=compra) strategy.entry ("Venda", strategy.short, when=venda) //plotshape(series=compra, title="Compra", style=shape.triangleup, location=location.belowbar, color=green, text="COMPRA", size=size.small) //plotshape(series=venda, title="Venda", style=shape.triangledown, location=location.abovebar, color=red, text="VENDA", size=size.small)