├── BO indicator.lua ├── BinaryMT2.lua ├── Consecutive Candle Count.lua ├── DiNapoli MACD [LazyBear].lua ├── DiNapoli Preferred Stochastic Oscillator [LazyBear].lua ├── EMA Strong Trend Market.lua ├── Engulfing Bars.lua ├── Follow Line Indicator.lua ├── KC.lua ├── Ketlner Channel & Stochastic.lua ├── MACD vs BB Indicator.lua ├── Momentum VMA KITKAT CROSS.lua ├── Quadratic Semaphore.lua ├── README.md ├── SQZMOMv2", title="Squeeze Momentum Indicator [LazyBear] Version2 by KıvanÇ fr3762.lua ├── SSL Channel - use heikinashi candle.lua ├── Simple Reversal Point.lua ├── Strategy MACD vs BB signal.lua ├── Support and resistance.lua ├── TDI - Traders Dynamic Index [Goldminds].lua ├── Vdubs Mr Mani.lua ├── ema 20:50:200 by Suman.lua ├── mr mani.lua ├── pivot_points.lua ├── sniper.lua ├── supertrend.lua ├── trend.lua └── wip.lua /BO indicator.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "BO indicator", overlay = true, icon = "indicators:BB" } 2 | 3 | period = input (20, "front.period", input.integer, 1) 4 | devs = input (1, "front.newind.stddev", input.integer, 1) 5 | 6 | overbought = input (1, "front.overbought", input.double, -2, 2, 0.1, false) 7 | oversold = input (0, "front.oversold", input.double, -2, 2, 0.1, false) 8 | 9 | source = input (1, "front.ind.source", input.string_selection, inputs.titles) 10 | fn = input (1, "front.newind.average", input.string_selection, averages.titles) 11 | 12 | input_group { 13 | "RSI", 14 | period1 = input (7, "front.period", input.integer, 1), 15 | source1 = input (1, "front.ind.source", input.string_selection, inputs.titles), 16 | fn1 = input (averages.ssma, "front.newind.average", input.string_selection, averages.titles), 17 | 18 | color = input { default = "#B42EFF", type = input.color }, 19 | width = input { default = 1, type = input.line_width} 20 | } 21 | 22 | 23 | local sourceSeries = inputs [source] 24 | local averageFunction = averages [fn] 25 | local sourceSeries1 = inputs [source1] 26 | local averageFunction1 = averages [fn1] 27 | 28 | CCIupLevel= 100 29 | CCIdnLevel=-100 30 | 31 | BBupLevel=1 32 | BBdnLevel=0 33 | 34 | RSIupLevel=70 35 | RSIdnLevel=30 36 | 37 | middle = averageFunction (sourceSeries, period) 38 | scaled_dev = devs * stdev (sourceSeries, period) 39 | 40 | top = middle + scaled_dev 41 | bottom = middle - scaled_dev 42 | 43 | bbr = (sourceSeries - bottom) / (top - bottom) 44 | 45 | 46 | delta = sourceSeries1 - sourceSeries1 [1] 47 | 48 | up1 = averageFunction (max (delta, 0), period) 49 | down1 = averageFunction (max (-delta, 0), period) 50 | 51 | rs = up1 / down1 52 | rsi = 100 - 100 / (1 + rs) 53 | 54 | src = close 55 | len = 7 56 | RSIupLevel=70 57 | RSIdnLevel=30 58 | up = rma(max(change(src), 0), len) 59 | down = rma(-min(change(src), 0), len) 60 | 61 | rsi1 = iff(down == 0 , 100 , iff( up == 0 , 0 , 100 - (100 / (1 + up / down)))) 62 | --rsi = (down == 0 , 100 ,iff( up == 0 , 0 ,iff( 100 - (100 / (1 + up / down))))) 63 | 64 | 65 | MAfast=9 66 | MAslow=21 67 | short = ema(close, MAfast) 68 | long = ema(close, MAslow) 69 | 70 | period_cci = 20 71 | nom = hlc3 - sma (hlc3, period_cci) 72 | denom = mad (hlc3, period_cci) * 0.015 73 | 74 | cci = nom / denom 75 | 76 | pu= (cci>CCIupLevel) and (rsi>RSIupLevel ) and (bbr>BBupLevel) and (open[1] > short[1] and close[1]>short[1]) 77 | pd= (cci= 0 , change1 , 0.0) 17 | loss = iff(change1 < 0 ,(-1) * change1 , 0.0) 18 | avgGain = rma(gain, Rlength) 19 | avgLoss = rma(loss, Rlength) 20 | rs = avgGain / avgLoss 21 | rsi = 100 - (100 / (1 + rs)) 22 | len = 14 23 | lensig = 14 24 | 25 | up = change(high) 26 | down = -change(low) 27 | plusDM = iff(na(up), na , iff(up > down and up > 0 , up , 0)) 28 | minusDM = iff(na(down), na , iff(down > up and down > 0 , down , 0)) 29 | trur = rma(tr, len) 30 | plus = fixnan(100 * rma(plusDM, len) / trur) 31 | minus = fixnan(100 * rma(minusDM, len) / trur) 32 | sum = plus + minus 33 | 34 | adx = 100 * rma(abs(plus - minus) / (plus + minus), lensig) 35 | 36 | top = (plusplus[2] and minus>minus[1]) or (plusminus[1] and minus[1]minus[2] and plus>plus[1]) or (minusplus[1] and plus[1] rsi[1] and adx < 25 40 | hiddenbulldiv = bottom and low > low[1] and rsi < rsi[1] and adx < 25 41 | 42 | 43 | plot_shape(hiddenbeardiv, "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 44 | plot_shape(hiddenbulldiv, "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') -------------------------------------------------------------------------------- /Consecutive Candle Count.lua: -------------------------------------------------------------------------------- 1 | instrument { 2 | name = "Consecutive Candle Count", 3 | short_name = "CCC", 4 | icon = "indicators:MACD" 5 | } 6 | 7 | 8 | barup = close > close[1] 9 | bardown = close < close[1] 10 | 11 | rundown = bars_since(bardown) 12 | runup = bars_since(barup) 13 | 14 | 15 | rect { 16 | first = 0, 17 | second = rundown, 18 | color = 'green', 19 | width = 0.8 20 | } 21 | 22 | rect { 23 | first = 0, 24 | second = -runup, 25 | color = 'red', 26 | width = 0.8 27 | } 28 | 29 | -------------------------------------------------------------------------------- /DiNapoli MACD [LazyBear].lua: -------------------------------------------------------------------------------- 1 | 2 | instrument { 3 | name = "DiNapoli MACD [LazyBear]", 4 | short_name = "DiNapoli MACD [LazyBear]", 5 | icon = "indicators:MACD" 6 | } 7 | lc = 17.5185 8 | sc = 8.3896 9 | sp = 9.0503 10 | src = close 11 | fs = nz(fs[1]) + 2.0 / (1.0 + sc) * (src- nz(fs[1])) 12 | ss = nz(ss[1]) + 2.0 / (1.0 + lc) * (src - nz(ss[1])) 13 | r = fs - ss 14 | s = nz(s[1]) + 2.0/(1 + sp)*(r - nz(s[1])) 15 | 16 | plot(s, "Dinapoli MACD", "teal", 2) 17 | 18 | print(r) 19 | 20 | rect { 21 | first = 0, 22 | second = r, 23 | color = iff(r>0 ,'green','red'), 24 | width = 0.4 25 | } 26 | -------------------------------------------------------------------------------- /DiNapoli Preferred Stochastic Oscillator [LazyBear].lua: -------------------------------------------------------------------------------- 1 | 2 | instrument { name = "DiNapoli Preferred Stochastic Oscillator [LazyBear]" } 3 | 4 | fk = 8 5 | sk = 3 6 | sd = 3 7 | min_ = lowest(low, fk) 8 | max_ = highest(high, fk) 9 | fast = (close - min_)/(max_ - min_)*100 10 | r = nz(r[1]) + (fast - nz(r[1]))/sk 11 | s = nz(s[1]) + (r - nz(s[1]))/sd 12 | 13 | obb = hline(70) 14 | oss = hline(30) 15 | 16 | fill_area (90, 10, "", rgba(255,255,255,0.05)) 17 | 18 | 19 | 20 | plot (r, "Dinapoli Stoch", '#56CEFF', 2) 21 | plot (s, "Signal", 'red', 2) 22 | -------------------------------------------------------------------------------- /EMA Strong Trend Market.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "EMA Strong Trend Market", overlay = true } 2 | 3 | len = 3 4 | src = high 5 | out = ema(src, len) 6 | HIGH = out 7 | 8 | len1 = 3 9 | src1 = low 10 | out1 = ema(src1, len1) 11 | LOW = out1 12 | 13 | HL2 = (HIGH+LOW)/2 14 | 15 | y = HIGH[1]HL2 and LOW[1]>HL2 17 | 18 | plot_shape(x, "short", shape_style.xcross, shape_size.large, 'red', shape_location.abovebar) 19 | plot_shape(y, "long", shape_style.xcross, shape_size.large, 'green', shape_location.bottom) 20 | 21 | -------------------------------------------------------------------------------- /Engulfing Bars.lua: -------------------------------------------------------------------------------- 1 | study("Engulfing Bars", shorttitle= "Bars", overlay = true) 2 | 3 | bearish=(close[1] > open[1] and open > close and open >= close[1] and open[1] >= close and open - close > close[1] - open[1] ) 4 | 5 | 6 | bullish=(open[1] > close[1] and close > open and close >= open[1] and close[1] >= open and close - open > open[1] - close[1] ) 7 | 8 | plot_shape(bearish, "Bearish Engulfing", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 9 | plot_shape(bullish, "Bullish Engulfing", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 10 | 11 | 12 | -------------------------------------------------------------------------------- /Follow Line Indicator.lua: -------------------------------------------------------------------------------- 1 | // © Dreadblitz 2 | //@version=4 3 | study(shorttitle="FLI", title="Follow Line Indicator", overlay=true) 4 | // 5 | BBperiod = input(defval = 21, title = "BB Period", type = input.integer, minval = 1) 6 | BBdeviations = input(defval = 1.00, title = "BB Deviations", type = input.float, minval = 0.1, step=0.05) 7 | UseATRfilter = input(defval = true, title = "ATR Filter", type = input.bool) 8 | ATRperiod = input(defval = 5, title = "ATR Period", type = input.integer, minval = 1) 9 | hl = input(defval = false, title = "Hide Labels", type = input.bool) 10 | // 11 | BBUpper=sma (close,BBperiod)+stdev(close, BBperiod)*BBdeviations 12 | BBLower=sma (close,BBperiod)-stdev(close, BBperiod)*BBdeviations 13 | // 14 | TrendLine = 0.0 15 | iTrend = 0.0 16 | buy = 0.0 17 | sell = 0.0 18 | // 19 | BBSignal = close>BBUpper? 1 : closeTrendLine[1] 28 | TrendLine:=TrendLine[1] 29 | if BBSignal == 0 and UseATRfilter == 1 30 | TrendLine:=TrendLine[1] 31 | // 32 | if BBSignal == 1 and UseATRfilter == 0 33 | TrendLine:=low 34 | if TrendLineTrendLine[1] 39 | TrendLine:=TrendLine[1] 40 | if BBSignal == 0 and UseATRfilter == 0 41 | TrendLine:=TrendLine[1] 42 | // 43 | iTrend:=iTrend[1] 44 | if TrendLine>TrendLine[1] 45 | iTrend:=1 46 | if TrendLine 0?color.blue:color.red ,style=plot.style_line,linewidth=2,transp=0,title="Trend Line") 53 | plotshape(buy == 1 and hl == false? TrendLine-atr(8) :na, text='💣', style= shape.labelup, location=location.absolute, color=color.blue, textcolor=color.white, offset=0, transp=0,size=size.auto) 54 | plotshape(sell == 1 and hl == false ?TrendLine+atr(8):na, text='🔨', style=shape.labeldown, location=location.absolute, color=color.red, textcolor=color.white, offset=0, transp=0,size=size.auto) 55 | // 56 | alertcondition(sell == 1 ,title="Sell",message="Sell") 57 | alertcondition(buy == 1 ,title="Buy",message="Buy") 58 | alertcondition(buy == 1 or sell == 1 ,title="Buy/Sell",message="Buy/Sell") 59 | -------------------------------------------------------------------------------- /KC.lua: -------------------------------------------------------------------------------- 1 | -- Indicator using Keltner Channel and Stochastic for Built-in IQ Option Script 2 | 3 | instrument { name = "KC Suman", overlay = true } 4 | 5 | -- Input Parameters 6 | period = input(20, "Keltner Channel Period", input.integer, 1) 7 | shift = input(2.5, "Keltner Channel Shift", input.double, 0.01, 300, 0.01) 8 | fn = input(averages.ema, "Smoothing Function", input.string_selection, averages.titles) 9 | source = input(1, "Source Type", input.string_selection, inputs.titles) 10 | 11 | -- Line Visibility and Style Settings 12 | input_group { 13 | "Keltner Channel - Lines", 14 | upper_line_visible = input { default = true, type = input.plot_visibility }, 15 | upper_line_color = input { default = "#21B190", type = input.color }, 16 | upper_line_width = input { default = 1, type = input.line_width }, 17 | 18 | middle_line_visible = input { default = true, type = input.plot_visibility }, 19 | middle_line_color = input { default = rgba(33, 177, 144, 0.6), type = input.color }, 20 | middle_line_width = input { default = 1, type = input.line_width }, 21 | 22 | lower_line_visible = input { default = true, type = input.plot_visibility }, 23 | lower_line_color = input { default = "#21B190", type = input.color }, 24 | lower_line_width = input { default = 1, type = input.line_width } 25 | } 26 | 27 | input_group { 28 | "Keltner Channel Fill", 29 | fill_visible = input { default = true, type = input.plot_visibility }, 30 | fill_color = input { default = rgba(33, 177, 144, 0.08), type = input.color } 31 | } 32 | 33 | -- Stochastic Inputs 34 | input_group { 35 | "Stochastic %K", 36 | k_period = input(5, "Period", input.integer, 1), 37 | smooth = input(3, "Smoothing", input.integer, 1) 38 | } 39 | input_group { 40 | "Stochastic %D", 41 | d_period = input(3, "Period", input.integer, 1) 42 | } 43 | 44 | -- Keltner Channel Calculation 45 | local averageFunction = averages[fn] 46 | local sourceSeries = inputs[source] 47 | local hlc3_avg = hlc3 48 | 49 | middle = averageFunction(hlc3_avg, period) 50 | offset = rma(tr, period) * shift 51 | upper_band = middle + offset 52 | lower_band = middle - offset 53 | 54 | -- Stochastic Calculation 55 | k = sma(stochastic(sourceSeries, k_period), smooth) * 100 56 | d = sma(k, d_period) 57 | 58 | -- Signal Logic 59 | stochUpperValue = 90 60 | stochLowerValue = 10 61 | 62 | shortSignal = k >= stochUpperValue and d >= stochUpperValue and upper_band <= close 63 | longSignal = k <= stochLowerValue and d <= stochLowerValue and lower_band >= close 64 | 65 | -- Plot Signals 66 | plot_shape(shortSignal, "Short Signal", shape_style.triangledown, shape_size.large, "red", shape_location.abovebar) 67 | plot_shape(longSignal, "Long Signal", shape_style.triangleup, shape_size.large, "green", shape_location.belowbar) 68 | 69 | -- Plot Keltner Channel 70 | if fill_visible then 71 | fill { first = upper_band, second = lower_band, color = fill_color } 72 | end 73 | if upper_line_visible then 74 | plot(upper_band, "Upper Band", upper_line_color, upper_line_width) 75 | end 76 | if middle_line_visible then 77 | plot(middle, "Middle Line", middle_line_color, middle_line_width) 78 | end 79 | if lower_line_visible then 80 | plot(lower_band, "Lower Band", lower_line_color, lower_line_width) 81 | end 82 | -------------------------------------------------------------------------------- /Ketlner Channel & Stochastic.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "Ketlner Channel & Stochastic", overlay = true } 2 | period = input (20, "front.period", input.integer, 1) 3 | shift = input (3, "front.newind.offset", input.double, 0.01, 300, 0.01) 4 | fn = input (averages.ema, "front.newind.average", input.string_selection, averages.titles) 5 | source = input (1, "front.ind.source", input.string_selection, inputs.titles) 6 | input_group { 7 | "front.top line", 8 | upper_line_visible = input { default = true, type = input.plot_visibility }, 9 | upper_line_color = input { default = "#21B190", type = input.color }, 10 | upper_line_width = input { default = 1, type = input.line_width } 11 | } 12 | input_group { 13 | "front.middle line", 14 | middle_line_visible = input { default = true, type = input.plot_visibility }, 15 | middle_line_color = input { default = rgba(33,177,144,0.6), type = input.color }, 16 | middle_line_width = input { default = 1, type = input.line_width } 17 | } 18 | input_group { 19 | "front.bottom line", 20 | lower_line_visible = input { default = true, type = input.plot_visibility }, 21 | lower_line_color = input { default = "#21B190", type = input.color }, 22 | lower_line_width = input { default = 1, type = input.line_width } 23 | } 24 | input_group { 25 | "front.newind.adx.fill", 26 | fill_visible = input { default = true, type = input.plot_visibility }, 27 | fill_color = input { default = rgba(33,177,144,0.08), type = input.color }, 28 | } 29 | 30 | input_group { 31 | "%K", 32 | k_period = input (5, "front.period", input.integer, 1), 33 | smooth = input (3, "front.platform.smothing", input.integer, 1), 34 | 35 | } 36 | 37 | input_group { 38 | "%D", 39 | d_period = input (3, "front.period", input.integer, 1), 40 | 41 | } 42 | 43 | 44 | local averageFunction = averages [fn] 45 | local sourceSeries = inputs [source] 46 | 47 | k = sma (stochastic (sourceSeries, k_period), smooth) * 100 48 | d = sma (k, d_period) 49 | 50 | 51 | 52 | middle = averageFunction (hlc3, period) 53 | offset = rma(tr, period) * shift 54 | h = middle + offset 55 | l = middle - offset 56 | 57 | 58 | short = h <= close 59 | long = l >= close 60 | 61 | stochUpperValue = 80 62 | stochLowerValue = 20 63 | shortk = k >= stochUpperValue and d >= stochUpperValue 64 | longk = k <= stochLowerValue and d <= stochLowerValue 65 | 66 | 67 | shortSignal = iff(((k >= stochUpperValue and d >= stochUpperValue and d >= k) and (h <= close)), true, false) 68 | longSignal = iff(((k <= stochLowerValue and d <= stochLowerValue and k >= d) and (l >= close)), true, false) 69 | 70 | plot_shape(shortSignal, "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar) 71 | plot_shape(longSignal, "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar) 72 | 73 | 74 | if fill_visible then 75 | fill { first = h, second = l, color = fill_color } 76 | end 77 | if upper_line_visible then 78 | plot (h, "h", upper_line_color, upper_line_width) 79 | end 80 | if lower_line_visible then 81 | plot (l, "l", lower_line_color, lower_line_width) 82 | end 83 | if middle_line_visible then 84 | plot (middle, "Middle", middle_line_color, middle_line_width) 85 | end 86 | 87 | -------------------------------------------------------------------------------- /MACD vs BB Indicator.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "MACD vs BB Indicator", overlay = false, icon="indicators:ATR" } 2 | 3 | fast_length = 8 4 | slow_length = 21 5 | src = close 6 | 7 | 8 | 9 | 10 | fast_ma = sma(src, fast_length) 11 | slow_ma = sma(src, slow_length) 12 | 13 | macd = fast_ma - slow_ma 14 | p1 = plot (macd, "MACD", 'blue', 1) 15 | length = 40 16 | mult = 2 17 | 18 | basis = sma(macd, length) 19 | dev = mult * stdev(macd, length) 20 | 21 | plot (basis, "BB basis", 'orange', 1) 22 | upper = basis + dev 23 | lower = basis - dev 24 | 25 | p2 = plot (upper, "BB upper", 'red', 1) 26 | p3 = plot (lower, "BB basis", 'green', 1) 27 | 28 | buy = macd[1] < lower[1] and macd > lower 29 | sell = macd[1] > upper[1] and macd < upper 30 | 31 | fill (macd, lower, "", iff( macdupper,'red',na)) 33 | 34 | fill_area { 35 | first = 0.01, 36 | second = -0.01, 37 | color = rgba(255,255,255,0.05) 38 | } -------------------------------------------------------------------------------- /Momentum VMA KITKAT CROSS.lua: -------------------------------------------------------------------------------- 1 | instrument { 2 | name = 'Momentum VMA KITKAT CROSS v2.1', 3 | icon = 'indicators:MA', 4 | overlay = true 5 | 6 | } 7 | 8 | input_group { 9 | "Level 1", 10 | 11 | level_1_color = input { default = "green", type = input.color }, 12 | level_1_width = input { default = 1, type = input.line_width } 13 | } 14 | 15 | input_group { 16 | "Level 2", 17 | 18 | level_2_color = input { default = "red", type = input.color }, 19 | level_2_width = input { default = 1, type = input.line_width } 20 | } 21 | 22 | length = 25 23 | src = close 24 | mvma = wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length))) 25 | --plot(mvma, linewidth=2, offset=+1, color=blue, transp=0, title="MVMA 1") 26 | plot(mvma, 'MVMA 1', 'blue' , 2, -1, style.solid_line, na_mode.continue) 27 | 28 | length2 = 21 29 | src2 = close 30 | mvma2 = wma(2*wma(src2, length2/2)-wma(src2, length2), round(sqrt(length2))) 31 | --plot(mvma2, linewidth=2, offset=+0, color=red, transp=0, title="MVMA 2") 32 | plot(mvma2, 'MVMA 2', 'red' , 2, -1, style.solid_line, na_mode.continue) 33 | 34 | 35 | source = close 36 | length3 = 9 37 | Lead = wma(2*wma(source, length3/2)-wma(source, length3), round(sqrt(length3))) 38 | --plot(Lead, linewidth=3, offset=+0, color=black, transp=0, title=" Lead MVMA") 39 | plot(Lead, 'Lead MVMA2', 'black' , 2, -1, style.solid_line, na_mode.continue) 40 | cross1 = value_when(Lead == mvma2 ,mvma2 , 2 ) 41 | --plot(cross1, 'Lead MVMA2', 'black' , 2, -1, style.solid_line, na_mode.continue) 42 | plot_shape(iff(Lead == mvma2,mvma2 ,na), "short", shape_style.cross, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 43 | --plot(cross(Lead,mvma2) ? mvma2 : na, style = cross, linewidth = 4, title="MVMA cross") 44 | 45 | RST = 16 46 | RSTT = value_when(high >= highest(high, RST), high, 0) 47 | RSTB = value_when(low <= lowest(low, RST), low, 0) 48 | plot (RSTT, "Resistance", iff(RSTT ~= RSTT[1], na ,level_2_color), 4, 0, style.levels, na_mode.restart) 49 | --plot (RSTB, "support", 'green', 4, 0, style.levels, na_mode.restart) 50 | plot (RSTB, "support", iff(RSTB ~= RSTB[1], na ,level_1_color), 4, 0, style.levels, na_mode.restart) 51 | --RT2 = plot(RSTT, color=RSTT != RSTT[1] ? na : red, linewidth=4, offset=+0, title="Resistance") 52 | --RB2 = plot(RSTB, color=RSTB != RSTB[1] ? na : green, linewidth=4, offset=0, title="Support") 53 | 54 | 55 | 56 | RST2 = 16 57 | RSTT2 = value_when(high >= highest(high, RST2), high, 1) 58 | RSTB2 = value_when(low <= lowest(low, RST2), low, 1) 59 | --RT22 = plot(RSTT2, color=RSTT2 != RSTT2[1] ? na : red, linewidth=9, offset=+0, title="Resistance") 60 | plot (RSTT2, "Resistance", iff(RSTT2 ~= RSTT2[1], na ,level_2_color), 9, 0, style.levels, na_mode.restart) 61 | --RB22 = plot(RSTB2, color=RSTB2 != RSTB2[1] ? na : green, linewidth=9, offset=0, title="Support") 62 | plot (RSTB2, "support", iff(RSTB2 ~= RSTB2[1], na ,level_1_color), 9, 0, style.levels, na_mode.restart) 63 | 64 | -------------------------------------------------------------------------------- /Quadratic Semaphore.lua: -------------------------------------------------------------------------------- 1 | 2 | instrument { name = "Quadratic Semaphore", overlay = true, icon="indicators:ATR" } 3 | p = input(6) 4 | length = input(30) 5 | x1 = bar_index 6 | x2 = sqrt(x1) 7 | y = high 8 | 9 | S11 = sum(x2,length) - sqrt(sum(x1,length)) / length 10 | S12 = sum(x1*x2,length) - (sum(x1,length) * sum(x2,length)) / length 11 | S22 = sum(sqrt(x2),length) - sqrt(sum(x2,length)) / length 12 | Sy1 = sum (y*x1,length) - (sum(y,length) * sum(x1,length)) / length 13 | Sy2 = sum (y*x2,length) - (sum(y,length) * sum(x2,length)) / length 14 | 15 | max1 = sma(x1,length) 16 | max2 = sma(x2,length) 17 | may = sma(y,length) 18 | b2 = ((Sy1 * S22) - (Sy2*S12))/(S22*S11 - sqrt(S12)) 19 | b3 = ((Sy2 * S11) - (Sy1 * S12))/(S22 * S11 - sqrt(S12)) 20 | b1 = may - b2*max1 - b3*max2 21 | qr = b1 + b2*x1 + b3*x2 22 | 23 | yl = low 24 | 25 | Sy1l = sum(yl*x1,length) - (sum(yl,length) * sum(x1,length)) / length 26 | Sy2l = sum(yl*x2,length) - (sum(yl,length) * sum(x2,length)) / length 27 | 28 | mayl = sma(yl,length) 29 | b2l = ((Sy1l * S22) - (Sy2l*S12))/(S22*S11 - sqrt(S12)) 30 | b3l = ((Sy2l * S11) - (Sy1l * S12))/(S22 * S11 - sqrt(S12)) 31 | b1l = mayl - b2l*max1 - b3l*max2 32 | qrl = b1l + b2l*x1 + b3l*x2 33 | 34 | period = round(p/2)+1 35 | hh = qr[period] 36 | ll = qrl[period] 37 | countH = 0 38 | countL = 0 39 | buy=0 40 | sell=0 41 | 42 | for i=0,period-1 do 43 | if qr[i]ll then countL =countL+1 return end 45 | 46 | end 47 | 48 | 49 | for i = period+1 , p+1 do 50 | if qr[i]ll then countL =countL+1 return end 52 | 53 | end 54 | 55 | if countH==p then 56 | pivotH = high[period] 57 | buy = true 58 | 59 | end 60 | 61 | 62 | if countL==p then 63 | pivotL = low[period] 64 | sell = true 65 | 66 | end 67 | 68 | plot_shape(buy, "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 69 | plot_shape(sell , "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IQ Option Lua Scripts 2 | 3 | Welcome to the **IQ Option Lua Scripts** repository! This repository contains various indicators and strategies for IQ Option, which can be loaded via script inside the IQ Option platform. 4 | 5 | ## Table of Contents 6 | 7 | - [Introduction](#introduction) 8 | - [Features](#features) 9 | - [Installation](#installation) 10 | - [Usage](#usage) 11 | - [Contributing](#contributing) 12 | - [License](#license) 13 | - [Contact](#contact) 14 | 15 | ## Introduction 16 | 17 | IQ Option Lua Scripts provides a collection of custom indicators and trading strategies designed to enhance your trading experience on the IQ Option platform. Each script is written in Lua and is tailored to work seamlessly with IQ Option. 18 | 19 | ## Features 20 | 21 | - A variety of custom indicators to assist in technical analysis. 22 | - Multiple trading strategies to help automate and improve trading performance. 23 | - Easy integration with the IQ Option platform. 24 | 25 | ## Installation 26 | 27 | To use these scripts, follow the steps below: 28 | 29 | 1. **Clone the Repository:** 30 | ```sh 31 | git clone https://github.com/sumanblack666/IQ-Option-Lua-scripts.git 32 | ``` 33 | 34 | 2. **Navigate to the Directory:** 35 | ```sh 36 | cd IQ-Option-Lua-scripts 37 | ``` 38 | 39 | 3. **Load Scripts into IQ Option:** 40 | - Open the IQ Option platform. 41 | - Navigate to the `Scripts` section. 42 | - Load the desired Lua script from the cloned repository. 43 | 44 | ## Usage 45 | 46 | Once the scripts are loaded into the IQ Option platform, you can start using the indicators and strategies to assist in your trading. Each script is designed to be user-friendly and provides various customization options. 47 | 48 | ### Running a Script 49 | 50 | To run a script, follow these steps: 51 | 52 | 1. Open the IQ Option platform. 53 | 2. Go to the `Scripts` section. 54 | 3. Select the script you want to run. 55 | 4. Click on `Run` to start using the script. 56 | 57 | 58 | ## Contributing 59 | 60 | Contributions are welcome! If you have any ideas, suggestions, or improvements, please feel free to submit a pull request or open an issue. 61 | 62 | ### Steps to Contribute 63 | 64 | 1. **Fork the Repository:** 65 | Click on the `Fork` button at the top right of this page to create a copy of this repository on your GitHub account. 66 | 67 | 2. **Clone the Repository:** 68 | ```sh 69 | git clone https://github.com//IQ-Option-Lua-scripts.git 70 | ``` 71 | 72 | 3. **Create a New Branch:** 73 | ```sh 74 | git checkout -b feature/your-feature-name 75 | ``` 76 | 77 | 4. **Make Changes:** 78 | Implement your changes or new features. 79 | 80 | 5. **Commit Changes:** 81 | ```sh 82 | git commit -m "Add feature: your-feature-name" 83 | ``` 84 | 85 | 6. **Push to the Branch:** 86 | ```sh 87 | git push origin feature/your-feature-name 88 | ``` 89 | 90 | 7. **Open a Pull Request:** 91 | Go to the original repository and click on `New Pull Request` to submit your changes for review. 92 | 93 | ## License 94 | 95 | This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details. 96 | 97 | ## Contact 98 | 99 | If you have any questions or need further assistance, feel free to contact: 100 | 101 | - **GitHub:** [sumanblack666](https://github.com/sumanblack666) 102 | - **Email:** sumanblack666@example.com 103 | 104 | Happy Trading! 105 | -------------------------------------------------------------------------------- /SQZMOMv2", title="Squeeze Momentum Indicator [LazyBear] Version2 by KıvanÇ fr3762.lua: -------------------------------------------------------------------------------- 1 | -- Squeeze Momentum Indicator (SQZMOMv3) 2 | instrument { name = "SQZMOMv3", title = "Squeeze Momentum Indicator" } 3 | 4 | -- Input Parameters 5 | length = input(20, "Bollinger Band Period", input.integer, 1) 6 | mult = input(2, "Bollinger Band Multiplier", input.integer, 1) 7 | lengthKC = input(20, "Keltner Channel Period", input.integer, 1) 8 | multKC = input(1.5, "Keltner Channel Multiplier", input.double, 1) 9 | SignalPeriod = input(5, "Signal Line Period", input.integer, 1) 10 | source = input(1, "Source Type", input.string_selection, inputs.titles) 11 | 12 | -- Line and Color Settings 13 | input_group { 14 | "Line Colors and Width", 15 | color1 = input { default = "red", type = input.color }, -- Signal line 16 | color2 = input { default = "blue", type = input.color }, -- Momentum line 17 | color3 = input { default = "black", type = input.color }, -- Squeeze on 18 | color4 = input { default = "gray", type = input.color }, -- Squeeze off 19 | color5 = input { default = "blue", type = input.color }, -- No squeeze 20 | width = input { default = 1, type = input.line_width } 21 | } 22 | 23 | -- Background Color Settings 24 | input_group { 25 | "Background", 26 | color6 = input { default = "lime", type = input.color }, -- Increasing momentum (positive) 27 | color7 = input { default = "green", type = input.color }, -- Decreasing momentum (positive) 28 | color8 = input { default = "red", type = input.color }, -- Increasing momentum (negative) 29 | color9 = input { default = "maroon", type = input.color }, -- Decreasing momentum (negative) 30 | bcolor_visible = input { default = true, type = input.plot_visibility } 31 | } 32 | 33 | -- Use True Range for Range Calculation 34 | useTrueRange = true 35 | 36 | -- Bollinger Band Calculation 37 | basis = sma(close, length) 38 | dev = mult * stdev(close, length) 39 | upperBB = basis + dev 40 | lowerBB = basis - dev 41 | 42 | -- Keltner Channel Calculation 43 | ma = sma(close, lengthKC) 44 | range = iff(useTrueRange, tr, high - low) 45 | rangema = sma(range, lengthKC) 46 | upperKC = ma + rangema * multKC 47 | lowerKC = ma - rangema * multKC 48 | 49 | -- Squeeze Logic 50 | sqzOn = (lowerBB > lowerKC) and (upperBB < upperKC) -- Squeeze on 51 | sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC) -- Squeeze off 52 | noSqz = not sqzOn and not sqzOff -- No squeeze condition 53 | 54 | -- Momentum Calculation 55 | val1 = (highest(high, lengthKC) + lowest(low, lengthKC)) / 2 56 | val2 = (val1 + sma(close, lengthKC)) / 2 57 | momentum = linreg(close - val2, lengthKC, 0) 58 | 59 | -- Background Color Logic 60 | bcolor = iff(momentum > 0, 61 | iff(momentum > nz(momentum[1]), color6, color7), 62 | iff(momentum < nz(momentum[1]), color8, color9)) 63 | 64 | -- Signal Line Calculation 65 | signal = sma(momentum, SignalPeriod) 66 | 67 | -- Squeeze Color Logic 68 | scolor = iff(noSqz, color5, 69 | iff(sqzOn, color3, color4)) 70 | 71 | -- Plot Background Fill 72 | if bcolor_visible then 73 | fill(0.001, -0.001, "", bcolor) 74 | end 75 | 76 | -- Plot Lines 77 | plot(momentum, "Momentum", color2, 2) 78 | plot(signal, "Signal Line", color1, 2) 79 | 80 | -- Plot Crosses for Squeeze Status 81 | plot(0, "Squeeze Status", scolor, 4, 0, style.crosses, 0) 82 | 83 | -- Uncomment if additional fill is desired between signal and momentum 84 | -- fill(signal, momentum, "", bcolor) 85 | -------------------------------------------------------------------------------- /SSL Channel - use heikinashi candle.lua: -------------------------------------------------------------------------------- 1 | instrument { 2 | name = 'SSL Channel - use heikinashi candle', 3 | icon = 'indicators:MA', 4 | overlay = true 5 | } 6 | 7 | --local Hlv = 0.0 8 | 9 | 10 | len = 13 11 | smaHigh = sma(high, len) 12 | smaLow = sma(low, len) 13 | 14 | Hlv = iff(close > smaHigh , 1 ,iff( close < smaLow , -1 , Hlv[1])) 15 | sslDown = iff(Hlv < 0 , smaHigh , smaLow) 16 | sslUp = iff(Hlv < 0 , smaLow , smaHigh) 17 | 18 | plot(sslDown, 'down', '#FF0000' , width, -1, style.solid_line, na_mode.continue) 19 | plot(sslUp, 'up', '#00FF00' , width, -1, style.solid_line, na_mode.continue) 20 | 21 | 22 | -------------------------------------------------------------------------------- /Simple Reversal Point.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "imple Reversal Point", overlay = true, icon="indicators:ATR" } 2 | 3 | c1 = close[1] < open[1] and close > open 4 | c2 = close > open[1] 5 | c3 = lowest(low,3) < lowest (low,50)[1] or lowest(low,3) < lowest(low,50)[2] or lowest(low,3) < lowest(low,50)[3] 6 | buy = c1 and c2 and c3 7 | 8 | c4 = close[1] > open[1] and close < open 9 | c5 = close < open[1] 10 | c6 = highest(high,3) > highest (high,50)[1] or highest(high,3) > highest(high,50)[2] or highest(high,3) > highest(high,50)[3] 11 | sell = c4 and c5 and c6 12 | 13 | plot_shape(buy, "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 14 | plot_shape(sell , "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') -------------------------------------------------------------------------------- /Strategy MACD vs BB signal.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "Strategy MACD vs BB signal", overlay = true, icon="indicators:ATR" } 2 | 3 | fast_length = 8 4 | slow_length = 21 5 | src = close 6 | 7 | 8 | 9 | 10 | fast_ma = sma(src, fast_length) 11 | slow_ma = sma(src, slow_length) 12 | 13 | macd = fast_ma - slow_ma 14 | p1 = plot (macd, "MACD", 'blue', 1) 15 | length = 40 16 | mult = 2 17 | 18 | basis = sma(macd, length) 19 | dev = mult * stdev(macd, length) 20 | 21 | plot (basis, "BB basis", 'orange', 1) 22 | upper = basis + dev 23 | lower = basis - dev 24 | 25 | p2 = plot (upper, "BB upper", 'red', 1) 26 | p3 = plot (lower, "BB basis", 'green', 1) 27 | 28 | buy = macd[1] < lower[1] and macd > lower 29 | sell = macd[1] > upper[1] and macd < upper 30 | 31 | fill (macd, lower, "", iff( macdupper,'red',na)) 33 | 34 | plot_shape(buy, "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 35 | plot_shape(sell, "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 36 | -------------------------------------------------------------------------------- /Support and resistance.lua: -------------------------------------------------------------------------------- 1 | instrument { 2 | name = 'Support and resistance', 3 | icon = 'indicators:MA', 4 | overlay = True 5 | } 6 | 7 | boxp=input (21, "front.newind.darvasbox.length", input.integer, 5) 8 | 9 | input_group { 10 | "Support and resistance", 11 | top_color = input { default = "red", type = input.color }, 12 | bottom_color = input { default = "green", type = input.color }, 13 | } 14 | 15 | RST = boxp 16 | 17 | RSTT = value_when(high >= highest(high, RST), high, 0) 18 | RSTB = value_when(low <= lowest(low, RST), low, 0) 19 | plot (RSTT, "Resistance", iff(RSTT ~= RSTT[1], na ,top_color), 4, 0, style.levels, na_mode.restart) 20 | plot (RSTB, "support", iff(RSTB ~= RSTB[1], na ,bottom_color), 4, 0, style.levels, na_mode.restart) 21 | -------------------------------------------------------------------------------- /TDI - Traders Dynamic Index [Goldminds].lua: -------------------------------------------------------------------------------- 1 | instrument { 2 | name = 'TDI - Traders Dynamic Index [Goldminds] use ashi candle', 3 | icon = 'indicators:MA', 4 | overlay = false 5 | } 6 | 7 | 8 | rsiPeriod = 13 9 | bandLength = 34 10 | lengthrsipl = 2 11 | lengthtradesl = 7 12 | 13 | src = close 14 | r = rsi(src, rsiPeriod) 15 | ma = sma(r, bandLength) 16 | offs = (1.6185 * stdev(r, bandLength)) 17 | up = ma + offs 18 | dn = ma - offs 19 | mid = (up + dn) / 2 20 | fastMA = sma(r, lengthrsipl) 21 | slowMA = sma(r, lengthtradesl) 22 | 23 | hline(32) 24 | hline(50) 25 | hline(68) 26 | 27 | uplot(up, "Upper Band", 'blue', 2) 28 | plot(dn, "Lower Band", 'blue', 2) 29 | plot(mid, "Middle of Bands", 'orange', 2) 30 | 31 | plot(slowMA, "Slow MA", 'green', 2) 32 | plot(fastMA, "Fast MA", 'fuchsia', 2) 33 | 34 | fill(up,mid,"",rgba(255,108,88,0.15)) 35 | 36 | fill(mid, dn, "", rgba(37,225,84,0.15)) 37 | -------------------------------------------------------------------------------- /Vdubs Mr Mani.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "Vdubs Mr Mani", overlay = true, icon="indicators:ATR" } 2 | 3 | input_group { 4 | "front.ind.dpo.generalline", 5 | up_color = input { default = "#58FF44", type = input.color }, 6 | down_color = input { default = "#57A1D0", type = input.color }, 7 | width = input { default = 1, type = input.line_width } 8 | } 9 | 10 | fn = input (averages.ema, "front.newind.average", input.string_selection, averages.titles) 11 | 12 | local avg = averages [fn] 13 | --ema signal 1 14 | src0 = close 15 | len0 = 13 16 | ema0 = ema(src0, len0) 17 | rising1 = ema0[0] > ema0[1] and ema0[1] > ema0[2] 18 | falling1 = ema0[2] > ema0[1] and ema0[1] > ema0[0] 19 | -- 20 | direction = iff(rising1, 1,iff(falling1, -1, 0 )) 21 | plot_color = iff(direction > 0 , up_color,iff( direction < 0, down_color , na)) 22 | plot(ema0, 'EMA', plot_color , width, -1, style.solid_line, na_mode.continue) 23 | --ema signal 2 24 | src02 = close 25 | len02 = 21 26 | ema02 = ema(src02, len02) 27 | rising2 = ema02[0] > ema02[1] and ema02[1] > ema02[2] 28 | falling2 = ema02[2] > ema02[1] and ema02[1] > ema02[0] 29 | direction2 = iff(rising2, 1,iff(falling2, -1, 0 )) 30 | plot_color2 = iff(direction2 > 0 , up_color,iff( direction2 < 0, down_color , na)) 31 | plot(ema02, 'EMA Signal 2', plot_color2 , width, -1, style.solid_line, na_mode.continue) 32 | 33 | --ema signal out 34 | 35 | fast = 5 36 | slow = 8 37 | avg0 = (low + close)/2 38 | avg1 = (high + close)/2 39 | vh1 = ema(highest(avg0, fast), 5) 40 | vl1 = ema(lowest(avg1, slow), 8) 41 | --print(vl1) 42 | 43 | e_ema1 = ema(close, 1) 44 | e_ema2 = ema(e_ema1, 1) 45 | e_ema3 = ema(e_ema2, 1) 46 | tema = 1 * (e_ema1 - e_ema2) + e_ema3 47 | --print(tema) 48 | 49 | 50 | e_e1 = ema(close, 8) 51 | e_e2 = ema(e_e1, 5) 52 | dema = 2 * e_e1 - e_e2 53 | --print(dema) 54 | signal = iff(tema > dema , max (vh1, vl1) , min (vh1, vl1)) 55 | --print(signal) 56 | 57 | 58 | is_call = tema > dema and signal > low and (signal-signal[1] > signal[1]-signal[2]) 59 | is_put = tema < dema and signal < high and (signal[1]-signal > signal[2]-signal[1]) 60 | 61 | 62 | period = 30 63 | plot_shape(iff(is_call and direction > 0 , 1, na), "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 64 | plot_shape(iff(is_put and direction < 0, 1, na) , "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 65 | plot (hma (src0, period), "HMA", '#FF00FF', 2) 66 | 67 | -- 68 | --vh1 = ema(highest(avg(low, close), fast), 5) 69 | --vl1 = ema(lowest(avg(high, close), slow), 8) -------------------------------------------------------------------------------- /ema 20:50:200 by Suman.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "ema 20/50/200 by Suman", overlay = true } 2 | local length = input (20, "EMA 1", input.integer, 1 , 250 ) 3 | local length1 = input (50, "EMA 2", input.integer, 1 , 250 ) 4 | local length2 = input (200, "EMA 3", input.integer, 1 , 250 ) 5 | local source = input (1, "front.ind.source", input.string_selection, inputs.titles_overlay) 6 | local follow = input(false, "Follow ema 200", input.boolean) 7 | local cross = input(false, "Ema 50 cross 200", input.boolean) 8 | 9 | 10 | 11 | input_group { 12 | "front.newind.lines", 13 | color = input { default = "green", type = input.color }, 14 | color1 = input { default = "yellow", type = input.color }, 15 | color2 = input { default = "red", type = input.color }, 16 | width = input { default = 1, type = input.line_width} 17 | } 18 | 19 | ema20 = ema(close,length) 20 | ema50 = ema(close,length1) 21 | ema200 = ema(close,length2) 22 | 23 | up = ema50[1] > ema20[1] and ema20 > ema50 24 | down = ema50[1] < ema20[1] and ema20 < ema50 25 | up1 = ema200[1] > ema50[1] and ema50 > ema200 26 | down1 = ema200[1] < ema50[1] and ema50 < ema200 27 | 28 | 29 | plot_shape(iff(follow,up and ema200[1] < ema200,up), "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 30 | plot_shape(iff(follow, down and ema200[1] > ema200 , down), "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 31 | 32 | if cross then 33 | plot_shape(up1, "long1", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY EMA200', 'green') 34 | plot_shape(down1, "short1", shape_style.triangleup, shape_size.large, 'red', shape_location.abovebar,0,'SELL EMA200', 'red') 35 | 36 | end 37 | 38 | 39 | 40 | 41 | plot (ema20, "ema 20", color, width) 42 | plot (ema50, "ema 50", color1, width) 43 | plot (ema200, "ema 200", color2, width) -------------------------------------------------------------------------------- /mr mani.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "Vdubs Mr Mani", overlay = true, icon="indicators:ATR" } 2 | 3 | input_group { 4 | "front.ind.dpo.generalline", 5 | up_color = input { default = "#58FF44", type = input.color }, 6 | down_color = input { default = "#57A1D0", type = input.color }, 7 | width = input { default = 1, type = input.line_width } 8 | } 9 | 10 | fn = input (averages.ema, "front.newind.average", input.string_selection, averages.titles) 11 | 12 | local avg = averages [fn] 13 | --ema signal 1 14 | src0 = close 15 | len0 = 13 16 | ema0 = ema(src0, len0) 17 | rising1 = ema0[0] > ema0[1] and ema0[1] > ema0[2] 18 | falling1 = ema0[2] > ema0[1] and ema0[1] > ema0[0] 19 | -- 20 | direction = iff(rising1, 1,iff(falling1, -1, 0 )) 21 | plot_color = iff(direction > 0 , up_color,iff( direction < 0, down_color , na)) 22 | plot(ema0, 'EMA', plot_color , width, -1, style.solid_line, na_mode.continue) 23 | --ema signal 2 24 | src02 = close 25 | len02 = 21 26 | ema02 = ema(src02, len02) 27 | rising2 = ema02[0] > ema02[1] and ema02[1] > ema02[2] 28 | falling2 = ema02[2] > ema02[1] and ema02[1] > ema02[0] 29 | direction2 = iff(rising2, 1,iff(falling2, -1, 0 )) 30 | plot_color2 = iff(direction2 > 0 , up_color,iff( direction2 < 0, down_color , na)) 31 | plot(ema02, 'EMA Signal 2', plot_color2 , width, -1, style.solid_line, na_mode.continue) 32 | 33 | --ema signal out 34 | 35 | fast = 5 36 | slow = 8 37 | avg0 = (low + close)/2 38 | avg1 = (high + close)/2 39 | vh1 = ema(highest(avg0, fast), 5) 40 | vl1 = ema(lowest(avg1, slow), 8) 41 | --print(vl1) 42 | 43 | e_ema1 = ema(close, 1) 44 | e_ema2 = ema(e_ema1, 1) 45 | e_ema3 = ema(e_ema2, 1) 46 | tema = 1 * (e_ema1 - e_ema2) + e_ema3 47 | --print(tema) 48 | 49 | 50 | e_e1 = ema(close, 8) 51 | e_e2 = ema(e_e1, 5) 52 | dema = 2 * e_e1 - e_e2 53 | --print(dema) 54 | signal = iff(tema > dema , max (vh1, vl1) , min (vh1, vl1)) 55 | --print(signal) 56 | 57 | 58 | is_call = tema > dema and signal > low and (signal-signal[1] > signal[1]-signal[2]) 59 | is_put = tema < dema and signal < high and (signal[1]-signal > signal[2]-signal[1]) 60 | 61 | 62 | period = 30 63 | plot_shape(iff(is_call and direction > 0 , 1, na), "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 64 | plot_shape(iff(is_put and direction < 0, 1, na) , "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 65 | plot (hma (src0, period), "HMA", '#FF00FF', 2) 66 | 67 | -- 68 | --vh1 = ema(highest(avg(low, close), fast), 5) 69 | --vl1 = ema(lowest(avg(high, close), slow), 8) -------------------------------------------------------------------------------- /pivot_points.lua: -------------------------------------------------------------------------------- 1 | --https://www.tradeviewforex.com/demarks-pivots.php 2 | instrument { name = "Pivot Points", icon="indicators:ADX", overlay = true } 3 | 4 | method_id = input (1, "Type", input.string_selection, { "Classic", "Fibonacci", "Camarilla", "Woodie", "DeMark" }) 5 | 6 | input_group { 7 | "Pivot Point", 8 | 9 | level_0_color = input { default = "red", type = input.color }, 10 | level_0_width = input { default = 1, type = input.line_width } 11 | } 12 | 13 | input_group { 14 | "Level 1", 15 | 16 | level_1_color = input { default = "green", type = input.color }, 17 | level_1_width = input { default = 1, type = input.line_width } 18 | } 19 | 20 | input_group { 21 | "Level 2", 22 | 23 | level_2_color = input { default = "blue", type = input.color }, 24 | level_2_width = input { default = 1, type = input.line_width } 25 | } 26 | 27 | input_group { 28 | "Level 3", 29 | 30 | level_3_color = input { default = "yellow", type = input.color }, 31 | level_3_width = input { default = 1, type = input.line_width } 32 | } 33 | 34 | local function classic(candle) 35 | p = (candle.high + candle.low + candle.close) / 3 36 | 37 | r1 = 2 * p - candle.low 38 | r2 = p + candle.high - candle.low 39 | r3 = candle.high + 2 * (p - candle.low) 40 | 41 | s1 = 2 * p - candle.high 42 | s2 = p - candle.high + candle.low 43 | s3 = candle.low - 2 * (candle.high - p) 44 | end 45 | 46 | local function fibonacci(candle) 47 | p = (candle.high + candle.low + candle.close) / 3 48 | 49 | r1 = p + (candle.high - candle.low) * 0.382 50 | r2 = p + (candle.high - candle.low) * 0.618 51 | r3 = p + (candle.high - candle.low) 52 | 53 | s1 = p - (candle.high - candle.low) * 0.382 54 | s2 = p - (candle.high - candle.low) * 0.618 55 | s3 = p - (candle.high - candle.low) 56 | end 57 | 58 | local function camarilla(candle) 59 | p = (candle.high + candle.low + candle.close) / 3 60 | 61 | r1 = p + (candle.high - candle.low) * 1.1 / 12 62 | r2 = p + (candle.high - candle.low) * 1.1 / 6 63 | r3 = p + (candle.high - candle.low) * 1.1 / 4 64 | 65 | s1 = p - (candle.high - candle.low) * 1.1 / 12 66 | s2 = p - (candle.high - candle.low) * 1.1 / 6 67 | s3 = p - (candle.high - candle.low) * 1.1 / 4 68 | end 69 | 70 | local function woodie(candle) 71 | p = (candle.high + candle.low + 2 * candle.close) / 4 72 | 73 | r1 = 2 * p - candle.low 74 | r2 = p + (candle.high - candle.low) 75 | 76 | s1 = 2 * p - candle.high 77 | s2 = p - (candle.high - candle.low) 78 | end 79 | 80 | local function demark(candle) 81 | x = candle.high + 2 * candle.low + candle.close 82 | 83 | r1 = x/2 - candle.low 84 | p = x / 4 85 | s1 = x/2 - candle.high 86 | end 87 | 88 | local methods = { classic, fibonacci, camarilla, woodie, demark } 89 | 90 | local resolution = "1W" 91 | 92 | if is_daily then 93 | resolution = "1M" 94 | elseif is_weekly or is_monthly then 95 | resolution = "1Y" 96 | end 97 | 98 | sec = security (current_ticker_id, resolution) 99 | 100 | if sec then 101 | local method = methods [method_id] 102 | 103 | method (sec) 104 | 105 | plot (p, "Pivot", level_0_color, level_0_width, 0, style.levels, na_mode.restart) 106 | 107 | plot (r1, "R1", level_1_color, level_1_width, 0, style.levels, na_mode.restart) 108 | plot (r2, "R2", level_2_color, level_2_width, 0, style.levels, na_mode.restart) 109 | plot (r3, "R3", level_3_color, level_3_width, 0, style.levels, na_mode.restart) 110 | 111 | plot (s1, "S1", level_1_color, level_1_width, 0, style.levels, na_mode.restart) 112 | plot (s2, "S2", level_2_color, level_2_width, 0, style.levels, na_mode.restart) 113 | plot (s3, "S3", level_3_color, level_3_width, 0, style.levels, na_mode.restart) 114 | end -------------------------------------------------------------------------------- /sniper.lua: -------------------------------------------------------------------------------- 1 | //╭╮╱╱╭╮╭╮╱╱╭╮ 2 | //┃╰╮╭╯┃┃┃╱╱┃┃ 3 | //╰╮┃┃╭┻╯┣╮╭┫╰━┳╮╭┳━━╮ 4 | //╱┃╰╯┃╭╮┃┃┃┃╭╮┃┃┃┃━━┫ 5 | //╱╰╮╭┫╰╯┃╰╯┃╰╯┃╰╯┣━━┃ 6 | //╱╱╰╯╰━━┻━━┻━━┻━━┻━━╯ 7 | //╭━━━┳╮╱╱╱╱╱╱╱╭╮ 8 | //┃╭━╮┃┃╱╱╱╱╱╱╱┃┃ 9 | //┃┃╱╰┫╰━┳━━┳━╮╭━╮╭━━┫┃ 10 | //┃┃╱╭┫╭╮┃╭╮┃╭╮┫╭╮┫┃━┫┃ 11 | //┃╰━╯┃┃┃┃╭╮┃┃┃┃┃┃┃┃━┫╰╮ 12 | //╰━━━┻╯╰┻╯╰┻╯╰┻╯╰┻━━┻━╯ 13 | //━╯ 14 | //Vdub FX SniperVX2 Color v2 / Vdub Rejection Spike v3 Full intergration - 15 | // ©Vdubus http://www.vdubus.co.uk/ 16 | study("Vdub FX SniperVX2 Color v2", overlay=true, shorttitle="Vdub_FX_SniperVX2_Color") 17 | //===================Candle body resistance Channel====================// 18 | len = 34 19 | src = input(close, title="Candle body resistance Channel") 20 | out = sma(src, len) 21 | last8h = highest(close, 13) 22 | lastl8 = lowest(close, 13) 23 | bearish = cross(close,out) == 1 and falling(close, 1) 24 | bullish = cross(close,out) == 1 and rising(close, 1) 25 | channel2=input(false, title="Bar Channel On/Off") 26 | ul2=plot(channel2?last8h:last8h==nz(last8h[1])?last8h:na, color=black, linewidth=1, style=linebr, title="Candle body resistance level top", offset=0) 27 | ll2=plot(channel2?lastl8:lastl8==nz(lastl8[1])?lastl8:na, color=black, linewidth=1, style=linebr, title="Candle body resistance level bottom", offset=0) 28 | fill(ul2, ll2, color=black, transp=90, title="Candle body resistance Channel") 29 | //=============================================================// 30 | //-------------LB--------------------------- 31 | channel=input(false, title="Resistance Channel 2 On/Off") 32 | up = closedown[1] ? nz(up[1]) : high 33 | down = closedown[1] ? nz(down[1]) : low 34 | ul=plot(channel?up:up==nz(up[1])?up:na, color=red, linewidth=1, style=linebr, title="Resistance Level top", offset=0) 35 | ll=plot(channel?down:down==nz(down[1])?down:na, color=green, linewidth=1, style=linebr, title="Resistance level bottom", offset=0) 36 | 37 | // Moddified [RS]Support and Resistance V0 38 | RST = input(title='Support / Resistance length:', type=integer, defval=6) // color zone length 39 | RSTT = valuewhen(high >= highest(high, RST), high, 0) 40 | RSTB = valuewhen(low <= lowest(low, RST), low, 0) 41 | RT2 = plot(RSTT, color=RSTT != RSTT[1] ? na : red, linewidth=1, offset=+0) 42 | RB2 = plot(RSTB, color=RSTB != RSTB[1] ? na : green, linewidth=1, offset=0) 43 | // 44 | //--------------------Trend colour ema------------------------------------------------// 45 | src0 = close, len0 = input(13, minval=1, title="EMA 1") 46 | ema0 = ema(src0, len0) 47 | direction = rising(ema0, 2) ? +1 : falling(ema0, 2) ? -1 : 0 48 | plot_color = direction > 0 ? lime: direction < 0 ? red : na 49 | plot(ema0, title="EMA", style=line, linewidth=1, color = plot_color) 50 | //--------------------Trend colour ema 2------------------------------------------------// 51 | src02 = close, len02 = input(21, minval=1, title="EMA 2") 52 | ema02 = ema(src02, len02) 53 | direction2 = rising(ema02, 2) ? +1 : falling(ema02, 2) ? -1 : 0 54 | plot_color2 = direction2 > 0 ? lime: direction2 < 0 ? red : na 55 | plot(ema02, title="EMA Signal 2", style=line, linewidth=1, color = plot_color2) 56 | // 57 | //--Modified vyacheslav.shindin-------------------------------------------------// Signal 1 58 | //Configured ema signal output 59 | fast = input(5, minval=1, title="Short Signal Generator") 60 | slow = input(8, minval=1) 61 | vh1 = ema(highest(avg(low, close), fast), 5) 62 | vl1 = ema(lowest(avg(high, close), slow), 8) 63 | // 64 | e_ema1 = ema(close, 1) 65 | e_ema2 = ema(e_ema1, 1) 66 | e_ema3 = ema(e_ema2, 1) 67 | tema = 1 * (e_ema1 - e_ema2) + e_ema3 68 | // 69 | e_e1 = ema(close, 8) 70 | e_e2 = ema(e_e1, 5) 71 | dema = 2 * e_e1 - e_e2 72 | signal = tema > dema ? max(vh1, vl1) : min(vh1, vl1) 73 | is_call = tema > dema and signal > low and (signal-signal[1] > signal[1]-signal[2]) 74 | is_put = tema < dema and signal < high and (signal[1]-signal > signal[2]-signal[1]) 75 | plotshape(is_call and direction > 0 ? 1 : na, title="BUY ARROW", color=green, text="*BUY*", style=shape.arrowup, location=location.belowbar) 76 | plotshape(is_put and direction < 0 ? -1 : na, title="SELL ARROW", color=red, text="*SELL*", style=shape.arrowdown) 77 | // 78 | //Modified - Rajandran R Supertrend----------------------------------------------------- // Signal 2 79 | Factor=3 80 | Pd=1 81 | atr1= rma(tr, Pd) 82 | Up=hl2-(Factor*atr1) 83 | Dn=hl2+(Factor*atr1) 84 | TrendUp = iff( close[1] > TrendUp[1], max(Up,TrendUp[1]) , Up) 85 | TrendDown=iff( close[1] < TrendDown[1], min(Dn,TrendDown[1]) , Dn) 86 | Trend = iff(close>TrendDown[1] , 1 , iff(close< TrendUp[1],-1,nz(Trend[1],0))) 87 | upt = Trend == 1 and Trend[1] == -1 88 | plotarrow(upt, title="Up Entry Arrow", colorup=lime, maxheight=1000, minheight=50, transp=85) 89 | plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=1000, minheight=50, transp=85) 90 | 91 | 92 | 93 | //=============Hull MA// 94 | show_hma = input(true, title="Display Hull MA Set:") 95 | hma_src = input(close, title="Hull MA's Source:") 96 | hma_base_length = input(8, minval=1, title="Hull MA's Base Length:") 97 | hma_length_scalar = input(5, minval=0, title="Hull MA's Length Scalar:") 98 | hullma(src, length)=>wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length))) 99 | plot(not show_hma ? na : hullma(hma_src, hma_base_length+hma_length_scalar*6), color=black, linewidth=3, title="Hull MA") 100 | //=============================================== 101 | // 102 | fill(ul2, RT2, color=red, transp=75, title="Fill") 103 | fill(ll2, RB2, color=green, transp=75, title="Fill") 104 | //////////////////////////////////////////////////////////////////////////////////////////// 105 | //////////////////////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /supertrend.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "Supertrend", overlay = true } 2 | 3 | period = input (7, "front.period", input.integer, 1) 4 | multiplier = input (3, "front.newind.multiplier", input.double, 0.01, 100, 0.01) 5 | 6 | input_group { 7 | "front.ind.dpo.generalline", 8 | up_color = input { default = "#25E154", type = input.color }, 9 | down_color = input { default = "#FF6C58", type = input.color }, 10 | width = input { default = 1, type = input.line_width } 11 | } 12 | 13 | offset = rma (tr, period) * multiplier 14 | 15 | up = hl2 - offset 16 | down = hl2 + offset 17 | 18 | trend_up = iff (not na(trend_up) and close [1] > trend_up [1], max (up, trend_up [1]), up) 19 | trend_down = iff (not na(trend_down) and close [1] < trend_down [1], min (down, trend_down [1]), down) 20 | 21 | trend = iff (close > trend_down [1], true, iff (close < trend_up [1], false, nz(trend [1], true))) 22 | tsl = iff (trend, trend_up, trend_down) 23 | 24 | plot (tsl, "Supertrend", trend () and up_color or down_color, width) -------------------------------------------------------------------------------- /trend.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "Supertrend", overlay = true } 2 | 3 | period = input (7, "front.period", input.integer, 1) 4 | multiplier = input (3, "front.newind.multiplier", input.double, 0.01, 100, 0.01) 5 | 6 | input_group { 7 | "front.ind.dpo.generalline", 8 | up_color = input { default = "#25E154", type = input.color }, 9 | down_color = input { default = "#FF6C58", type = input.color }, 10 | width = input { default = 1, type = input.line_width } 11 | } 12 | 13 | offset = rma (tr, period) * multiplier 14 | 15 | up = hl2 - offset 16 | down = hl2 + offset 17 | 18 | trend_up = iff (not na(trend_up) and close [1] > trend_up [1], max (up, trend_up [1]), up) 19 | trend_down = iff (not na(trend_down) and close [1] < trend_down [1], min (down, trend_down [1]), down) 20 | 21 | trend = iff (close > trend_down [1], true, iff (close < trend_up [1], false, nz(trend [1], true))) 22 | tsl = iff (trend, trend_up, trend_down) 23 | print(trend) 24 | print(trend_up) 25 | print(trend_down) 26 | --plot_shape(trend_up - trend , "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 27 | 28 | plot (tsl, "Supertrend", trend () and up_color or down_color, width) -------------------------------------------------------------------------------- /wip.lua: -------------------------------------------------------------------------------- 1 | instrument { name = "Vdubs Mr Mani", overlay = true, icon="indicators:ATR" } 2 | 3 | input_group { 4 | "front.ind.dpo.generalline", 5 | up_color = input { default = "#58FF44", type = input.color }, 6 | down_color = input { default = "#57A1D0", type = input.color }, 7 | width = input { default = 1, type = input.line_width } 8 | } 9 | 10 | fn = input (averages.ema, "front.newind.average", input.string_selection, averages.titles) 11 | 12 | local avg = averages [fn] 13 | --ema signal 1 14 | src0 = close 15 | len0 = 13 16 | ema0 = ema(src0, len0) 17 | rising1 = ema0[0] > ema0[1] and ema0[1] > ema0[2] 18 | falling1 = ema0[2] > ema0[1] and ema0[1] > ema0[0] 19 | -- 20 | direction = iff(rising1, 1,iff(falling1, -1, 0 )) 21 | plot_color = iff(direction > 0 , up_color,iff( direction < 0, down_color , na)) 22 | plot(ema0, 'EMA', plot_color , width, -1, style.solid_line, na_mode.continue) 23 | --ema signal 2 24 | src02 = close 25 | len02 = 21 26 | ema02 = ema(src02, len02) 27 | rising2 = ema02[0] > ema02[1] and ema02[1] > ema02[2] 28 | falling2 = ema02[2] > ema02[1] and ema02[1] > ema02[0] 29 | direction2 = iff(rising2, 1,iff(falling2, -1, 0 )) 30 | plot_color2 = iff(direction2 > 0 , up_color,iff( direction2 < 0, down_color , na)) 31 | plot(ema02, 'EMA Signal 2', plot_color2 , width, -1, style.solid_line, na_mode.continue) 32 | 33 | --ema signal out 34 | 35 | fast = 5 36 | slow = 8 37 | avg0 = (low + close)/2 38 | avg1 = (high + close)/2 39 | vh1 = ema(highest(avg0, fast), 5) 40 | vl1 = ema(lowest(avg1, slow), 8) 41 | --print(vl1) 42 | 43 | e_ema1 = ema(close, 1) 44 | e_ema2 = ema(e_ema1, 1) 45 | e_ema3 = ema(e_ema2, 1) 46 | tema = 1 * (e_ema1 - e_ema2) + e_ema3 47 | --print(tema) 48 | 49 | 50 | e_e1 = ema(close, 8) 51 | e_e2 = ema(e_e1, 5) 52 | dema = 2 * e_e1 - e_e2 53 | --print(dema) 54 | signal = iff(tema > dema , max (vh1, vl1) , min (vh1, vl1)) 55 | --print(signal) 56 | 57 | 58 | is_call = tema > dema and signal > low and (signal-signal[1] > signal[1]-signal[2]) 59 | is_put = tema < dema and signal < high and (signal[1]-signal > signal[2]-signal[1]) 60 | 61 | 62 | period = 30 63 | plot_shape(iff(is_call and direction > 0 , 1, na), "long", shape_style.triangleup, shape_size.large, 'green', shape_location.belowbar,0,'BUY', 'green') 64 | plot_shape(iff(is_put and direction < 0, 1, na) , "short", shape_style.triangledown, shape_size.large, 'red', shape_location.abovebar,0,'SELL', 'red') 65 | plot (hma (src0, period), "HMA", '#FF00FF', 2) 66 | 67 | Factor=3 68 | Pd=1 69 | atr1= rma(tr, Pd) 70 | Up=hl2-(Factor*atr1) 71 | Dn=hl2+(Factor*atr1) 72 | TrendUp = iff( close[1] > TrendUp[1], max(Up,TrendUp[1]) , Up) 73 | TrendDown=iff( close[1] < TrendDown[1], min(Dn,TrendDown[1]) , Dn) 74 | Trend = iff(close>TrendDown[1] , 1 , iff(close< TrendUp[1],-1,nz(Trend[1],0))) 75 | long1 = (Trend == 1 and Trend[1] == -1) 76 | //plot_shape(long1, "long", shape_style.triangleup, shape_size.large, 'yellow', shape_location.belowbar,0,'BUY', 'yellow') 77 | // 78 | --plot_shape(iff(Trend == -1 and Trend[1] == 1 , Trend , na), "short", shape_style.triangledown, shape_size.large, 'blue', shape_location.abovebar,0,'SELL', 'red') 79 | 80 | 81 | 82 | --Up= hl2 - (Factor * atr(Pd)) --------------------------------------------------------------------------------