Channel BreakOut Strategy

Definition

The Channel BreakOut Strategy creates a channel with its bands based on the highest and lowest values for the last X bars (X is the value of the 'Length' setting). The strategy enters long if the high of the current bar is higher than the upper channel band of the previous bar. It enters short if the low of the current bar is lower than the lower channel band of the previous bar.

Calculations

Pine Script 
//@version=4 strategy("Bollinger Bands Strategy directed", overlay=true) source = close length = input(20, minval=1) mult = input(2.0, minval=0.001, maxval=50) direction = input(0, title = "Strategy Direction", type=input.integer, minval=-1, maxval=1) strategy.risk.allow_entry_in(direction == 0 ? strategy.direction.all : (direction < 0 ? strategy.direction.short : strategy.direction.long)) basis = sma(source, length) dev = mult * stdev(source, length) upper = basis + dev lower = basis - dev if (crossover(source, lower)) strategy.entry("BBandLE", strategy.long, stop=lower, oca_name="BollingerBands", oca_type=strategy.oca.cancel, comment="BBandLE") else strategy.cancel(id="BBandLE") if (crossunder(source, upper)) strategy.entry("BBandSE", strategy.short, stop=upper, oca_name="BollingerBands", oca_type=strategy.oca.cancel, comment="BBandSE") else strategy.cancel(id="BBandSE") //plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)

Summary

The Channel Breakout Strategy attempts to create a strategy just like its name says - trades based on whether a symbol breaks out from a channel or not. The channel is dependent on the length, which is chosen in the strategy settings. The strategy then enters long if the high of the current bar is higher than the upper channel band of the previous bar. It enters short if the low of the current bar is lower than the lower channel band of the previous bar.

홈으로 스탁 스크리너 포렉스 스크리너 크립토 스크리너 이코노믹 캘린더 사용안내 차트 특징 프라이싱 프렌드 리퍼하기 하우스룰(내부규정) 헬프 센터 웹사이트 & 브로커 솔루션 위젯 차팅 솔루션 라이트웨이트 차팅 라이브러리 블로그 & 뉴스 트위터
프로화일 프로화일설정 계정 및 빌링 리퍼드 프렌즈 코인 나의 서포트 티켓 헬프 센터 공개아이디어 팔로어 팔로잉 비밀메시지 채팅 로그아웃