Uses the open/closes not h/low and offsets the channel.
Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact svenissimo for more information, or follow the author's instructions below.
TradingView does not suggest paying for a script and using it until you 100% trust its author and understand how the script works. In many cases you can find a good open-source alternative for free in our Public Library.
Warning: please read before requesting access.
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.
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)
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")
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?
To compensate for the 'noise' this would generate.. we offset the channel back by 'offset'.