svenissimo

ChannelBreakOutStrategy

1367 views
53
1367 15
Breakout channel for OANDA:EURUSD .

Uses the open/closes not h/low and offsets the channel.
Remove from Favorite Scripts Add to Favorite Scripts
Hello I tried to Dm message you. What is "offset" how did you define "offset" in your code or is it already pre-defined? and what exactly is the "upper and lower bound" ? Also is there any built in indicator that can provide a clear image of when the strategy is about to enter in a trade?
+1 Reply
Hello does this strategy repaints?

Thanks
+1 Reply
thank you.
Reply
please access me
Reply
Trying to get my head around this ... is this what it does?
if the lowest price of current epoch is smaller than the downBound value of 2 epochs ago, then SELL
if the lowest price of current epoch is higher than the upBound of 2 epochs ago, then BUY
Reply
meadowfellow meadowfellow
@svenissimo

Sorry, I mean:
if the lowest price of current epoch is smaller than the downBound value of 2 epochs ago, then SELL
if the highest price of current epoch is higher than the upBound of 2 epochs ago, then BUY

Is this how it works?
Reply
svenissimo meadowfellow
@meadowfellow, its a simple breakout of the upper and lowerbound. The only thing this does that most do not is that it does *not* use the previous 'length' Highs + Lows to calculate the bounds. It instead uses the max/min opens and closes. This results in a smaller channel to breakout.

To compensate for the 'noise' this would generate.. we offset the channel back by 'offset'.
Reply
very good.
Reply
Hey All.. I can't seem to update the permissions to make it public..
The code is VERY simple and the only difference is a use of the open/close rather than hi/lo so here... fill your boots.

//@version=2
strategy("ChannelBreakOutStrategy", overlay=true, default_qty_value=1000, initial_capital=1000)
// defaults: 1000 units on a 1000 account. No MM,
//
// Creates a chanel of 'length' based on the max of the opens and closes.. Not the high's, and the min of the open and closes.
// This channel is offset by 'offset'.
// So a 5 day channel with a 2 bar offset, is essentially the max/min opens/closes 7-2bars ago. (5 length)

length = input(title="Length", type=integer, minval=1, maxval=1000, defval=5)
off = input(title="Offset", type=integer, minval=0, maxval=1000, defval=2)

upBound = offset(highest(max(open,close), length),off)
downBound = offset(lowest(min(open,close), length),off)

plot(upBound)
plot(downBound)

if (not na(close))
strategy.entry("ChBrkLE", strategy.long, stop=upBound + syminfo.mintick, comment="ChBrkLE")
strategy.entry("ChBrkSE", strategy.short, stop=downBound - syminfo.mintick, comment="ChBrkSE")

+4 Reply
Hello, I like the channel strategy aspect of your strategy. Would you please share the code with me. I am trying to learn quickly and this would be a great example for me.

Thanks!
+1 Reply
EN English (UK)
EN English
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
HE עברית
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out