Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- // Concept creator of IFT John EHLERS
- // Updated and extended with Zones and EMA {Str3SS} aka Techn0Joe
- // Next update to include the Buy Sell signals
- // Watch for all lines to cross the EMA(yellow by default)
- // Indicates price movement best for longs above 50 or 100 or 200 based on market conditions and your agressiveness
- // Indicates price movement best for shorts below 50 or 100 or 200 based on market conditions and your agressiveness
- indicator('IFT Combo and EMA with zones', shorttitle='IFTCOMBOEMA')
- EMA = input(true, title='Show EMA line?')
- AVERAGE = input(true, title='Show AVERAGE Line?')
- STO = input(false, title='Show STOCHASTIC Line?')
- RSI = input(false, title='Show RSI Line?')
- CCI = input(false, title='Show CCI Line?')
- MFI = input(false, title='Show MFI Line?')
- //Average means: average value of all 4 inverse fisher trasformed indicators
- EmaMC = input(false, title='Show EMA Multicolor?')
- AvgMC = input(false, title='Show AVERAGE Multicolor?')
- ccilength = input(15, 'CCI Length')
- wmalength = input(15, title='Smoothing Length')
- v11 = 0.1 * (ta.cci(close, ccilength) / 4)
- v21 = ta.wma(v11, wmalength)
- INV1 = (math.exp(2 * v21) - 1) / (math.exp(2 * v21) + 1)
- rsilength = input(5, 'RSI Length')
- v12 = 0.1 * (ta.rsi(close, rsilength) - 50)
- v22 = ta.wma(v12, wmalength)
- INV2 = (math.exp(2 * v22) - 1) / (math.exp(2 * v22) + 1)
- stochlength = input(5, 'STOCH Length')
- v1 = 0.1 * (ta.stoch(close, high, low, stochlength) - 50)
- v2 = ta.wma(v1, wmalength)
- INVLine = (math.exp(2 * v2) - 1) / (math.exp(2 * v2) + 1)
- //MFI
- mfilength = input(5, 'MFI Length')
- source = hlc3
- up = math.sum(volume * (ta.change(source) <= 0 ? 0 : source), mfilength)
- lo = math.sum(volume * (ta.change(source) >= 0 ? 0 : source), mfilength)
- mfi = 100.0 - 100.0 / (1.0 + up / lo)
- v13 = 0.1 * (mfi - 50)
- v23 = ta.wma(v13, wmalength)
- INV3 = (math.exp(2 * v23) - 1) / (math.exp(2 * v23) + 1)
- AVINV = (INV1 + INV2 + INVLine + INV3) / 4
- ema_length = input.int(6, minval=1, title='EMA length')
- vema = ta.ema(INV1, ema_length)
- color rema = color.new(color.red, 30)
- plot(STO and INVLine ? INVLine : na, color=color.new(color.blue, 0), linewidth=1, title='STOCH')
- plot(CCI and INV1 ? INV1 : na, color=color.new(color.white, 0), linewidth=1, title='CCIv2')
- plot(RSI and INV2 ? INV2 : na, color=color.new(color.green, 0), linewidth=1, title='RSI')
- plot(MFI and INV3 ? INV3 : na, color=color.new(color.purple, 0), linewidth=1, title='MFI')
- plot(not AvgMC and AVERAGE and AVINV ? AVINV : na, color=color.new(color.green, 0), linewidth=3, title='AVERAGE')
- plot(AvgMC and AVERAGE and AVINV ? AVINV : na, color=AVINV > AVINV[1] ? color.green :color.red, linewidth=3, title='Average MC')
- plot(not EmaMC and EMA and vema ? vema : na, color=rema, linewidth=2, title='EMA')
- plot(EmaMC and EMA and vema ? vema : na, color=vema > vema[1] ? color.green :color.red, linewidth=2, title='Ema MC')
- color w1 = color.new(color.white, 60)
- color r1 = color.new(color.red, 50)
- color r2 = color.new(color.red, 20)
- color g1 = color.new(color.green, 50)
- color g2 = color.new(color.green, 20)
- //hline(0.5, color=r1)
- hline(0.75, color=r2)
- //hline(-0.5, color=g1)
- hline(-0.75, color=g2)
- hline(0, color=w1)
- // Used for fill area at top and bottom
- color p0 = color.new(color.gray, 100)
- h1 = hline(0.75, color=p0)
- h2 = hline(1, color=p0)
- h3 = hline(-.75, color=p0)
- h4 = hline(-1, color=p0)
- color z1 = color.new(color.gray, 85)
- fill(h1, h2, color=z1)
- fill(h3, h4, color=z1)
- //var table atrDisplay = table.new(position.top_center, 1, 1)
- // We call `ta.atr()` outside the `if` block so it executes on each bar.
- //myAtr = tostring(INV1)
- //table.cell(atrDisplay, 0, 0, "CCI:" + myAtr , text_color = color.white)
- threeone = input(true, title='Highlight 3-1 Strat bar combo?')
- onethree = input(true, title='Highlight 1-3 Strat bar combo?')
- inBar = low > low[1] and high < high[1]
- outBar = low < low[1] and high > high[1]
- combo31 = low[1] < low[2] and high[1] > high[2] and low > low[1] and high < high[1]
- combo13 = low[2] < low[1] and high[2] > high[1] and low[1] > low and high[1] < high
- color y1 = color.new(color.yellow, 90)
- color b1 = color.new(color.blue, 90)
- bgcolor(threeone and combo31 == 1 ? y1 : na, offset=-1, title='3-1 Bar Combo')
- bgcolor(threeone and combo31 == 1 ? y1 : na, title='3-1 - Bar Combo')
- plotshape(threeone and combo31 == 1, style=shape.labelup, text='3-1', location=location.top, color=color.new(color.yellow, 0), textcolor=color.new(color.black, 0))
- bgcolor(threeone and combo13 == 1 ? b1 : na, offset=-1, title='1-3 - Bar Combo')
- bgcolor(combo13 == 1 ? b1 : na, title='1-3 - Bar Combo')
- plotshape(combo13 == 1, style=shape.labelup, text='1-3', location=location.top, color=color.new(color.blue, 0), textcolor=color.new(color.white, 0))
- //fast = input(3, title="LBR Fast Length")
- //slow = input(10, title="LBR Slow Length")
- //smoothing = input(16, title="LBR Signal Smoothing")
- //[fastline, slowline, histline] = macd(close,fast,slow,smoothing)
- //plot(0, color=gray)
- //plot(fastline, color=fastline > 0 ? green : red, style=histogram)
- //plot(fastline, color=fastline > fastline[1] ? color.green :color.red)
- //plot(slowline, color=slowline > slowline[1] ? color.green : color.red)
- //plot(fastline, color=color.green, linewidth=3, title="Fast")
- //plot(slowline, color=color.red, linewidth=2, title="Slow")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement