ehaerim

[퍼옴] 볼린저 + RSI, 더블 스트래티지 (by ChartArt) v1.1

ehaerim Telah dikemas kini   
TVC:SPX   Indeks S&P 500


이 전략은 볼린저 밴드RSI 지표를 함께 써서 가격이 윗쪽 볼린저 밴드 위로 올라 갈 때 사고, 반대로 내려 갈 때는 팝니다. 이 간단한 전략은 RSI볼린저 밴드가 둘 다 한꺼번에 과매도 또는 과매수 조건을 만족할 때만 트리거된다.

업데이트
버전 1.1 에서는 전략을 좀 더 단순하게 하여 더 적은 갯수의 인풋을 썼으며, 볼린저 밴드의 기초가 되는 단순이동평균에 대해 기간을 200으로 써서 성공적인 백테스팅 결과를 얻을 수 있었다. 또한 색깔 얼러트 수를 줄였으면서도 좀 더 연관성 있는 트레이딩 기회를 얻을 수 있도록 하였다.
Komen:
//@version=2
strategy("Bollinger + RSI, Double Strategy (by ChartArt) v1.1", shorttitle="CA_-_RSI_Bol_Strat_1.1", overlay=true)

// ChartArt's RSI + Bollinger Bands, Double Strategy - Update
//
// Version 1.1
// Idea by ChartArt on January 18, 2015.
//
// This strategy uses the RSI indicator
// together with the Bollinger Bands
// to sell when the price is above the
// upper Bollinger Band (and to buy when
// this value is below the lower band).
//
// This simple strategy only triggers when
// both the RSI and the Bollinger Bands
// indicators are at the same time in
// a overbought or oversold condition.
//
// In this version 1.1 the strategy was
// both simplified for the user and
// made more successful in backtesting.
//
// List of my work:
// www.tradingview.com/u/ChartArt/
//
// __ __ ___ __ ___
// / ` |__| /\ |__) | /\ |__) |
// \__, | | /~~\ | \ | /~~\ | \ |
//
//


///////////// RSI
RSIlength = input(6,title="RSI Period Length")
RSIoverSold = 50
RSIoverBought = 50
price = close
vrsi = rsi(price, RSIlength)


///////////// Bollinger Bands
BBlength = input(200, minval=1,title="Bollinger Period Length")
BBmult = 2 // input(2.0, minval=0.001, maxval=50,title="Bollinger Bands Standard Deviation")
BBbasis = sma(price, BBlength)
BBdev = BBmult * stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
source = close
buyEntry = crossover(source, BBlower)
sellEntry = crossunder(source, BBupper)
plot(BBbasis, color=aqua,title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=silver,title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=silver,title="Bollinger Bands Lower Line")
fill(p1, p2)


///////////// Colors
switch1=input(true, title="Enable Bar Color?")
switch2=input(true, title="Enable Background Color?")
TrendColor = RSIoverBought and (price > BBupper and price < BBupper) and BBbasis < BBbasis ? red : RSIoverSold and (price < BBlower and price > BBlower) and BBbasis > BBbasis ? green : na
barcolor(switch1?TrendColor:na)
bgcolor(switch2?TrendColor:na,transp=50)


///////////// RSI + Bollinger Bands Strategy
if (not na(vrsi))

if (crossover(vrsi, RSIoverSold) and crossover(source, BBlower))
strategy.entry("RSI_BB_L", strategy.long, stop=BBlower, oca_type=strategy.oca.cancel, comment="RSI_BB_L")
else
strategy.cancel(id="RSI_BB_L")

if (crossunder(vrsi, RSIoverBought) and crossunder(source, BBupper))
strategy.entry("RSI_BB_S", strategy.short, stop=BBupper, oca_type=strategy.oca.cancel, comment="RSI_BB_S")
else
strategy.cancel(id="RSI_BB_S")

//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)
Komen:
그리고, 첫 버전때와 마찬가지로 이 전략도 더 큰 타임프레임의 종가를 쓰지 않고 있어 현재 캔들이 완성된 뒤에도 다시 그리지는 않으며, 다른 모든 TradingView 지표처럼 현재 캔들이 완성되지 않은 상태에서 다시 그릴 수도 있다.

모든 트레이딩은 많은 리스크를 안고 있습니다; 과거 성적이 반드시 미래 결과를 나타내지는 않습니다. 이론적 또는 모의 성적은 근본적으로 한계를 갖고 있습니다. 실제 거래내역과 달리, 모의 결과는 실제 거래를 나타내지 않습니다. 또한, 실제고 거래가 이루어 지지 않았기 때문에 그 결과는 만일 유동성 부족 등과 같은 어떤 특정한 시장요소가 혹시라도 있었을 경우, 그 영향이 과소 또는 과대 평가되었을 수 있습니다. 모의 트레이딩 프로그램은 일반적으로 이미 지나간 과거의 거래를 이용한다는 잇점을 갖는 설계적 종속성을 띌 수밖에 없다는 사실을 인식하여야 합니다. 어떤 경우에도, 모의 트레이딩 프로그램이 보여주는 결과와 비슷한 수익이나 손실을 낼 수 있다는 표현이나 보장을 하지 않습니다.


덧말씀. 고급 유저의 경우, 이 전략 스크립트에 나오는 여러 함수를 보고 싶다면 버전 1.0을 쓰시기 바랍니다.:

Bollinger + RSI, Double Strategy (by ChartArt)

HaeRim Lee
TradingView Korea Service Manager (kr.tradingview.com)
MultiCharts Korea Service Provider (www.investware.net)
TView: ehaerim
Skype: ehaerim
Kakao: ehaerim
Mobile: +82-10-4035-2873
Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.