TRADINGVIEW CODE
This system is long only, given the temporary extension of market of being long and not short (in extension ,you can prove to develp an inverse t.s. for short case)
————————————————————————-
//@version=2
////////////////////////////////////////////////////////////
// Copyright by Saucius, 2019
////////////////////////////////////////////////////////////
strategy(title="Revenge Long Saub bands only shares easy",overlay = true,max_bars_back=2000)
Length = input(9, minval=1)
m = input(0.9, minval = 0.1, step = 0.1)
l1 = Length/2
l2 = round(l1)
l3 = Length – l2
TRIMH = sma(sma(high, l2), l3)
TRIML = sma(sma(low, l2), l3)
xHighBand = (1+m/100) * TRIMH
xLowBand = (1-m/100) * TRIML
halfband = (xHighBand + xLowBand)/2
// classical entry: like Keltner Channel, when close breaks upper Band
strategy.entry("Long", true, when=crossover(close,xHighBand))
// entry #2 from the bottom: 2 closes upon inferior band. This means: if prices are lower than the Lower Band and the close confirms consecutevely twice to be over, it's a good entry point, even if the trend is not clear again.
entry2 = close[2]<xLowBand[2] and close[1]>xLowBand[1] and close>xLowBand
strategy.entry("Long", true, when= entry2)
////////////////////////////////////////////////////////////
// Copyright by Saucius, 2019
////////////////////////////////////////////////////////////
strategy(title="Revenge Long Saub bands only shares easy",overlay = true,max_bars_back=2000)
Length = input(9, minval=1)
m = input(0.9, minval = 0.1, step = 0.1)
l1 = Length/2
l2 = round(l1)
l3 = Length – l2
TRIMH = sma(sma(high, l2), l3)
TRIML = sma(sma(low, l2), l3)
xHighBand = (1+m/100) * TRIMH
xLowBand = (1-m/100) * TRIML
halfband = (xHighBand + xLowBand)/2
// classical entry: like Keltner Channel, when close breaks upper Band
strategy.entry("Long", true, when=crossover(close,xHighBand))
// entry #2 from the bottom: 2 closes upon inferior band. This means: if prices are lower than the Lower Band and the close confirms consecutevely twice to be over, it's a good entry point, even if the trend is not clear again.
entry2 = close[2]<xLowBand[2] and close[1]>xLowBand[1] and close>xLowBand
strategy.entry("Long", true, when= entry2)
// exit at market cases:
//1. classical exit (like Keltner Channel, when prices are under the lower band
//2. "moderated" exit : when close is confirmed twice under the halfband (halfband is quite similar to a moving average)
//3. "scalping" exit: when prices retrace or go under the HigherBand. This exit is warmly suggested when you have opened in the #2 way, "from the bottom", since it's probable that there is a godd gain yet.
//. 4 when CCI reaches extreme values (you don't need any confirm that prices are high enough)
// exit 2 = 2 close under halfband
exit2 = close[1] < halfband[1] and close < halfband
strategy.close("Long", when=crossunder(close, xHighBand))
strategy.close("Long", when=crossunder(close,halfband))
strategy.close("Long", when=crossunder(close, xLowBand))
//
CCIX = cci(close,20)
strategy.close("Long", when= (CCIX > 200 ))
// exit 2 = 2 close under halfband
exit2 = close[1] < halfband[1] and close < halfband
strategy.close("Long", when=crossunder(close, xHighBand))
strategy.close("Long", when=crossunder(close,halfband))
strategy.close("Long", when=crossunder(close, xLowBand))
//
CCIX = cci(close,20)
strategy.close("Long", when= (CCIX > 200 ))
———————–
GOOD TRADE and let me know if you lieke My Bands!!!
No comments:
Post a Comment