ASR EzAlgo Fomo
Похожие материалы по тегам
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «indicator asr ezalgo fomo for tradingview.pine» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
О программе
ASR EzAlgo Fomo — это индикатор для TradingView, написанный на Pine Script v5 и отображаемый поверх графика цены. Он объединяет несколько технических инструментов анализа в одном индикаторе.
Индикатор отрисовывает на графике центральную линию с верхними и нижними зонами, линии тренда, уровни поддержки и сопротивления, а также графические отметки потенциальных разворотов и перекупленности/перепроданности. Включены инструменты рыночной структуры, такие как изменение характера рынка и прорывы структуры.
Поддерживается получение данных с других таймфреймов для отображения мультитаймфреймовых уровней. Пользователь может настраивать отображение каждого компонента и его цветовую схему через параметры настройки.
Индикатор предоставляет таблицу-дашборд с информацией о направлении и силе тренда по нескольким таймфреймам, а также условия для оповещений TradingView по ключевым сигналам.
Настройки программы
| Настройка | Описание |
|---|---|
| Tv | Tv — Числовой параметр со значением по умолчанию 200, минимальное значение 1. |
| showReversal | Отображение сигналов разворота — Включает или отключает отображение сигналов разворота Buy/Sell. |
| colorBuy | Цвет покупки — Цвет метки сигнала покупки. |
| colorSell | Цвет продажи — Цвет метки сигнала продажи. |
| obos | Отображение O.S/O.B — Включает или отключает отображение маркеров перекупленности и перепроданности. |
| colorOs | Цвет перепроданности — Цвет маркера перепроданности. |
| colorOb | Цвет перекупленности — Цвет маркера перекупленности. |
| showRibbon | Отображение ленты тренда — Включает или отключает отображение ленты тренда с изменением цвета. |
| uptrend | Цвет восходящей ленты — Центральный цвет ленты тренда для восходящего направления. |
| downtrend | Цвет нисходящей ленты — Центральный цвет ленты тренда для нисходящего направления. |
| showRevBands | Отображение полос разворота — Включает или отключает отображение полос разворота. |
| colorupperband | Цвет верхних полос — Цвет верхних полос разворота. |
| colorlowerband | Цвет нижних полос — Цвет нижних полос разворота. |
| showEmas | Отображение скользящих средних S/R — Включает или отключает отображение трёх скользящих средних как уровней поддержки и сопротивления. |
| colorEma1 | Цвет скользящей средней 1 — Цвет первой скользящей средней. |
| colorEma2 | Цвет скользящей средней 2 — Цвет второй скользящей средней. |
| colorEma3 | Цвет скользящей средней 3 — Цвет третьей скользящей средней. |
| currentTF | Уровни ликвидности текущего ТФ — Включает или отключает отображение уровней ликвидности на текущем таймфрейме. |
| lowLineColorHTF | Цвет бычьей ликвидности HTF — Цвет линии уровня ликвидности для бычьего направления на высшем таймфрейме. |
| highLineColorHTF | Цвет медвежьей ликвидности HTF — Цвет линии уровня ликвидности для медвежьего направления на высшем таймфрейме. |
| htfTF | Таймфрейм ликвидности HTF — Таймфрейм для уровней ликвидности на высшем таймфрейме. |
| show_fvg | Отображение FVG — Включает или отключает отображение зон справедливой стоимости (Fair Value Gaps). |
| i_mtfbearishfvgcolor | Цвет медвежьего FVG HTF — Цвет медвежьей зоны справедливой стоимости (FVG) на высшем таймфрейме. |
| i_mtfbullishfvgcolor | Цвет бычьего FVG HTF — Цвет бычьей зоны справедливой стоимости (FVG) на высшем таймфрейме. |
| i_tf | Таймфрейм FVG — Таймфрейм для расчёта зон справедливой стоимости. |
| autofib | Auto Golden Pocket — Включает или отключает автоматическое отображение уровней Золотого кармана (Fibonacci). |
| colorAll | Цвет Fibonacci — Общий цвет для автоматических Fibonacci-уровней. |
| timeframe | Таймфрейм — Таймфрейм для профиля объёма и смежных расчётов. |
| showVP | Отображение профиля объёма — Включает или отключает отображение профиля объёма. |
| vp_bar_color | Цвет полос объёма — Цвет полос профиля объёма, кроме точки контроля. |
| vp_poc_color | Цвет точки контроля — Цвет линии точки контроля (Point of Control) в профиле объёма. |
| showms | Отображение ChoCH и BOS — Включает или отключает отображение сигналов ChoCH и BOS (изменение характера рынка и прорыв структуры). |
| bosColor1 | Бычий цвет BOS/ChoCH — Цвет для бычьих сигналов ChoCH и BOS. |
| bosColor2 | Медвежий цвет BOS/ChoCH — Цвет для медвежьих сигналов ChoCH и BOS. |
| showGann | Отображение Gann Swing — Включает или отключает отображение линий Gann Swing (ключевые точки разворота за один бар). |
| colorGann | Цвет линий Gann Swing — Цвет линий Gann Swing. |
| showDashboard | Включение дашборда — Включает или отключает таблицу-дашборд в правом верхнем углу графика. |
| tableTextColor | Цвет текста дашборда — Цвет текста в таблице дашборда. |
| tableBgColor | Цвет фона дашборда — Цвет фона таблицы дашборда. |
| showSR | Отображение мультитаймфреймовых S/R — Включает или отключает отображение мультитаймфреймовых уровней поддержки и сопротивления. |
| timef | Таймфрейм S/R — Таймфрейм для мультитаймфреймовых уровней поддержки и сопротивления. |
| levels | Количество уровней S/R — Количество отображаемых уровней поддержки и сопротивления. |
| linewidth | Толщина линий S/R — Толщина линий уровней поддержки и сопротивления. |
| supportcolor | Цвет поддержки — Цвет линий поддержки на графике. |
| resistancecolor | Цвет сопротивления — Цвет линий сопротивления на графике. |
| labelon | Отображение меток S/R — Включает или отключает отображение текстовых меток на уровнях S/R. |
| labelsize | Размер меток S/R — Размер текста меток уровней поддержки и сопротивления. |
| labelcol | Цвет текста меток S/R — Цвет текста меток уровней поддержки и сопротивления. |
| labelloc | Смещение меток S/R — Смещение меток уровней поддержки и сопротивления по горизонтали. |
| showtimef | Отображение таймфрейма на метках S/R — Включает или отключает отображение названия таймфрейма на метках S/R. |
| showtprice | Отображение цены на метках S/R — Включает или отключает отображение цены на метках S/R. |
Поиск по коду файла
indicator(title='ASR EzAlgo Fomo', shorttitle='ASR EzAlgo Fomo', overlay=true, max_labels_count=500, max_lines_count=500, max_boxes_count=500, max_bars_back=5000)
Tv = input.int(200, minval=1)
float currentMidOrHlc3 = na
float ma = na
float tc = na
float trueRange = na
float PI = math.pi
float XC = 2.415,
float nc = 0.5
float PICoeff2415 = PI * XC
float Sv = math.exp(-math.sqrt(2) * PI / Tv)
float _f = -math.pow(Sv, 2)
float vf = 2 * Sv * math.cos(math.sqrt(2) * PI / Tv),
float fg = 1 - vf - _f
float mid = na
float dollarS = na
int JC = 12
int ZC = 4
int previousTimestamp = na
float upperHigh = na
float upperMid = na
float upperLow = na
float lowerHigh = na
float lowerMid = na
float lowerLow = na
currentTimestamp = time
trueRange := ta.tr(true)
if na(mid[1])
currentMidOrHlc3 := hlc3
else
currentMidOrHlc3 := nz(mid[1])
mid := fg * hlc3 + vf * currentMidOrHlc3 + _f * currentMidOrHlc3[1]
if na(dollarS[1])
ma := trueRange
else
ma := dollarS[1]
if na(tc[1])
tc := ma
else
tc := tc[1]
ma := nz(dollarS[1])
tc := tc[1]
dollarS := fg * trueRange + vf * ma + _f * tc
tc := ma
ma := dollarS
upperMid := mid + dollarS * PICoeff2415,
lowerMid := mid - dollarS * PICoeff2415
upperHigh := upperMid + dollarS * nc * 4
upperLow := upperMid - dollarS * nc * 4
lowerLow := lowerMid + dollarS * nc * -4
lowerHigh := lowerMid - dollarS * nc * -4
p1 = plot(upperHigh, "Upper high", color=color.new(color.rgb(250,0,0), 69), linewidth=12)
p2 = plot(upperMid, "Upper mid", color=color.new(color.rgb(243,77,95), 47),linewidth=4)
p3 = plot(upperLow, "Upper low", color=color.new(color.rgb(248, 193, 59), 73), linewidth=12)
p7 = plot(mid, color=color.rgb(82,37,165), title="Basis", linewidth=3)
p4 = plot(lowerHigh, "Lower high", color=color.new(color.rgb(132, 201, 135), 73), linewidth=12)
p5 = plot(lowerMid, "Lower mid", color=color.new(color.rgb(61,144,65), 47),linewidth=4)
p6 = plot(lowerLow, "Lower low", color=color.new(color.rgb(20, 103, 87), 69), linewidth=12)
showReversal = input(true, "Buy/Sell", group="REVERSAL INDICATORS", inline = 'rev1', tooltip = "use ONLY in confluence with any of the price action tools listed below")
colorBuy = input.color(#00dbff99, '', group="REVERSAL INDICATORS", inline= 'rev1')
colorSell = input.color(#e91e6399, '', group="REVERSAL INDICATORS", inline= 'rev1')
obos = input(true, "O.S/O.B", group="REVERSAL INDICATORS", inline = 'rev2', tooltip = "Oversold/Overbought Conditions. Bigger Reversals usually happen after these conditions, however a market can stay in these conditions for a long time. Oversold & Overbought is not a reversal signal in itself however when used in confluence with S/R and other momentum signals can be powerful")
colorOs = input.color(#00dbff48, '', group="REVERSAL INDICATORS", inline= 'rev2')
colorOb = input.color(#e91e6348, '', group="REVERSAL INDICATORS", inline= 'rev2')
showRibbon = input(true, "Trend Ribbon", group="REVERSAL INDICATORS", tooltip = "Change in Ribbon Color signals a shift in trend. Best used in trending markets to spot early signs of reversals")
uptrend = input(#00dbff66, "Uptrend", group="REVERSAL INDICATORS")
downtrend = input(#e91e6366, "Downtrend", group="REVERSAL INDICATORS")
showRevBands = input(false, "Reversal Bands", group="REVERSAL INDICATORS", tooltip = "Plots the average upper and lower bounds of price movement. Price could see a reversal when it approaches these boundaries. Use in confluence with other Support & Resistance")
colorupperband = input(#e91e6333, "Upper Bands", group="REVERSAL INDICATORS")
colorlowerband = input(#00dbff33, "Lower Bands", group="REVERSAL INDICATORS")
showEmas = input(false, "Moving Average S/R", group="SUPPORT & RESISTANCE", tooltip = "Three powerful Moving Averages. Price tends to respect these MAs making them invaluable as they act as S/R & help in identifying trend shifts")
colorEma1 = input(#eaeaea40, "Moving Average 1", group="SUPPORT & RESISTANCE")
colorEma2 = input(#00dbff40, "Moving Average 2", group="SUPPORT & RESISTANCE")
colorEma3 = input(#e91e6340, "Moving Average 3", group="SUPPORT & RESISTANCE")
currentTF = input.bool(false, title = "Liquidity Levels", group="SUPPORT & RESISTANCE", tooltip = "Zones of high volume activity before price moves in one direction. Price usually comes back to these levels to 'sweep' the liquidity by triggering stop losses to gather the fuel to propel itself back into the opposite direction. If price is approaching down to a liquidity zone, it tends to go slightly below the zone before quickly reversing back to the upside and vice versa for a bearish move. A common zone where swing failure pattern occurs. However it is highly risky to place limit orders at these zones as the price may not respect it at all and pass through with no resistance. Use ONLY in confluence with other S/R tools")
lowLineColorHTF = input.color(#efd09e50, "Bullish", group="SUPPORT & RESISTANCE")
highLineColorHTF = input.color(#ff7f5050, "Bearish", group="SUPPORT & RESISTANCE")
htfTF = input.timeframe("240", title = "Timeframe", group="SUPPORT & RESISTANCE")
show_fvg = input(false, 'Fair Value Gaps', group="SUPPORT & RESISTANCE", tooltip = "Fair Value Gaps occur when a Price leaves a specific level where there's less trading activity seen and only has a one-directional price movement. Typically these occur during aggressive trends where the the orders of the market makers do not get filled. Similar to order blocks price tends to re visit these zones at a later time")
i_mtfbearishfvgcolor = input.color(#226f54, "Bullish", group="SUPPORT & RESISTANCE")
i_mtfbullishfvgcolor = input.color(#f1abb9, "Bearish", group="SUPPORT & RESISTANCE")
i_tf = input.timeframe("240", "Timeframe", group="SUPPORT & RESISTANCE")
autofib = input(true, "Auto Golden Pocket", group="SUPPORT & RESISTANCE", tooltip = "The 0.5 and 0.618-65 Fibonacci Ratio often acts as a balancing point in the market. Finding consecutive candle closes above the 0.5-0.65 is a sign of strength, and finding consecutive candle closes under the 0.5-0.65 is a sign of weakness")
colorAll = input.color(#D1B000, "Color", group="SUPPORT & RESISTANCE")
timeframe = input.timeframe(defval = '240', group="SUPPORT & RESISTANCE")
showVP = input(true, "Volume Profile", group="SUPPORT & RESISTANCE", tooltip = "Volume profile scans a range of price action by looking back at previous price action to determine the level at which the highest Volume has been traded. This level is called the Point of Control which acts as a magnet attracting the price. When tested from the underside it can be a strong resistance and when tested from above it can be a strong support")
vp_bar_color = input(defval=color.new(color.gray, 60), title='Volume Bars')
vp_poc_color = input(defval=#eaeaea, title='Point of Control')
showms = input(false,title="ChoCH & BoS", group = "MARKET STRUCTURE", tooltip = "Change of character means, the market has changed its trend or order flow over a period of time. “Break of Structure” is used to describe a significant price movement that surpasses a crucial level of support or resistance on a chart.")
bosColor1 = input.color(#0097a7 , 'Bullish', group = "MARKET STRUCTURE")
bosColor2 = input.color(#c2185b , 'Bearish', group = "MARKET STRUCTURE")
showGann = input(false, 'Gann Swing (One Bar Key Pivot Points)', group = "MARKET STRUCTURE", tooltip = "The core technique used by the legendary trader W.D Gann. A simple yet powerful tool that tracks the 'swing' of the price, clearly showing the key pivot points. An excellent tool to track market structure, breakouts, swing failure patterns & setting stop losses. A close above a key swing high is considered bullish and close below a key swing low is bearish")
colorGann = input(#ff7f50, 'Swing Line', group = "MARKET STRUCTURE")
showDashboard = input(true, "Enable", group = "TREND DASHBOARD")
tableTextColor = input(color.white, "Text", group = "TREND DASHBOARD")
tableBgColor = input(#13172232, "Background", group = "TREND DASHBOARD")
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x[1]), t)
smoothrng = ta.ema(avrng, wper) * m
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r : x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r
percWidth(len, perc) => (ta.highest(len) - ta.lowest(len)) * perc / 100
securityNoRep(sym, res, src) => request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on)
f_chartTfInMinutes() =>
float _resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
f_kc(src, len, sensitivity) =>
basis = ta.sma(src, len)
span = ta.atr(len)
[basis + span * sensitivity, basis - span * sensitivity]
wavetrend(src, chlLen, avgLen) =>
esa = ta.ema(src, chlLen)
d = ta.ema(math.abs(src - esa), chlLen)
ci = (src - esa) / (0.015 * d)
wt1 = ta.ema(ci, avgLen)
wt2 = ta.sma(wt1, 3)
[wt1, wt2]
source = close
smrng1 = smoothrng(source, 27, 1.5)
smrng = (smrng1)
filt = rngfilt(source, smrng)
up = 0.0, up := filt > filt[1] ? nz(up[1]) + 1 : filt < filt[1] ? 0 : nz(up[1])
dn = 0.0, dn := filt < filt[1] ? nz(dn[1]) + 1 : filt > filt[1] ? 0 : nz(dn[1])
bullCond = bool(na), bullCond := source > filt and source > source[1] and up > 0 or source > filt and source < source[1] and up > 0
bearCond = bool(na), bearCond := source < filt and source < source[1] and dn > 0 or source < filt and source > source[1] and dn > 0
lastCond = 0, lastCond := bullCond ? 1 : bearCond ? -1 : lastCond[1]
bull = bullCond and lastCond[1] == -1
bear = bearCond and lastCond[1] == 1
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
ribbon1 = ta.ema(hlc3, 8)
ribbon2 = ta.ema(hlc3, 13)
rsi = ta.rsi(hlc3, 21)
rsiOb = rsi > 70 and rsi > ta.ema(rsi, 13)
rsiOs = rsi < 30 and rsi < ta.ema(rsi, 13)
ema1 = ta.ema(hlc3, 21)
ema2 = ta.ema(hlc3, 34)
ema3 = ta.ema(hlc3, 55)
ema = ta.ema(hlc3, 21)
emaBull = close > ema
[diplus, diminus, adx] = ta.dmi(21, 13)
adxstrong= adx > 21
equal_tf(res) => str.tonumber(res) == f_chartTfInMinutes() and not timeframe.isseconds
higher_tf(res) => str.tonumber(res) > f_chartTfInMinutes() or timeframe.isseconds
too_small_tf(res) => (timeframe.isweekly and res=="1") or (timeframe.ismonthly and str.tonumber(res) < 10)
securityNoRep1(sym, res, src) =>
bool bull_ = na
bull_ := equal_tf(res) ? src : bull_
bull_ := higher_tf(res) ? request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on) : bull_
bull_array = request.security_lower_tf(syminfo.tickerid, higher_tf(res) ? str.tostring(f_chartTfInMinutes()) + (timeframe.isseconds ? "S" : "") : too_small_tf(res) ? (timeframe.isweekly ? "3" : "10") : res, src)
if array.size(bull_array) > 1 and not equal_tf(res) and not higher_tf(res)
bull_ := array.pop(bull_array)
array.clear(bull_array)
bull_
TF5Bull = securityNoRep1(syminfo.tickerid, "5" , emaBull)
TF15Bull = securityNoRep1(syminfo.tickerid, "15" , emaBull)
TF30Bull = securityNoRep1(syminfo.tickerid, "30" , emaBull)
TF60Bull = securityNoRep1(syminfo.tickerid, "60" , emaBull)
TF240Bull = securityNoRep1(syminfo.tickerid, "240" , emaBull)
TFDBull = securityNoRep1(syminfo.tickerid, "1440", emaBull)
TF5Strong = securityNoRep1(syminfo.tickerid, "5" , adxstrong)
TF15Strong = securityNoRep1(syminfo.tickerid, "15" , adxstrong)
TF30Strong = securityNoRep1(syminfo.tickerid, "30" , adxstrong)
TF60Strong = securityNoRep1(syminfo.tickerid, "60" , adxstrong)
TF240Strong = securityNoRep1(syminfo.tickerid, "240" , adxstrong)
TFDStrong = securityNoRep1(syminfo.tickerid, "1440", adxstrong)
[upperKC1, lowerKC1] = f_kc(close, 55, 3)
[upperKC2, lowerKC2] = f_kc(close, 55, 4)
[upperKC3, lowerKC3] = f_kc(close, 55, 5)
[upperKC4, lowerKC4] = f_kc(close, 55, 6)
[wt1, wt2] = wavetrend(hlc3, 13, 21)
cyan = #00dbff, cyan30 = color.new(cyan, 70)
pink = #e91e63, pink30 = color.new(pink, 70)
plotshape(showReversal and ta.crossover(wt1, wt2) and wt2 <= -55, "Reversal Buy" , shape.labelup, location.belowbar, color = colorBuy, size=size.small)
plotshape(showReversal and ta.crossunder(wt1, wt2) and wt2 >= 55, "Reversal Sell", shape.labeldown, location.abovebar, color = colorSell, size=size.small)
plotshape(showReversal and rsiOs, "Oversold" , shape.diamond, location.belowbar, color = colorOs, size=size.tiny)
plotshape(showReversal and rsiOb, "Overbought", shape.diamond, location.abovebar, color = colorOb, size=size.tiny)
plot(showEmas ? ema1 : na, "Moving Average 1", colorEma1, 2)
plot(showEmas ? ema2 : na, "Moving Average 2", colorEma2, 2)
plot(showEmas ? ema3 : na, "Moving Average 3", colorEma3, 2)
var dashboard_loc = position.top_right
var dashboard_size = size.small
var dashboard = showDashboard ? table.new(dashboard_loc, 3, 15, tableBgColor, #000000, 2, tableBgColor, 1) : na
dashboard_cell(column, row, txt, signal=false) => table.cell(dashboard, column, row, txt, 0, 0, signal ? #000000 : tableTextColor, text_size=dashboard_size)
dashboard_cell_bg(column, row, col) => table.cell_set_bgcolor(dashboard, column, row)
if barstate.islast and showDashboard
dashboard_cell(0, 0, "Timeframe")
dashboard_cell(0, 1, "Chart")
dashboard_cell(0, 2, "5 min")
dashboard_cell(0, 3, "15 min")
dashboard_cell(0, 4, "30 min")
dashboard_cell(0, 5, "1H")
dashboard_cell(0, 6, "4H")
dashboard_cell(0, 7, "Daily")
dashboard_cell(1, 0, "Bias")
dashboard_cell(1, 1, emaBull ? "🟢" : "🔴", true), dashboard_cell_bg(1, 1, emaBull)
dashboard_cell(1, 2, TF5Bull ? "🟢" : "🔴", true), dashboard_cell_bg(1, 2, TF5Bull)
dashboard_cell(1, 3, TF15Bull ? "🟢" : "🔴", true), dashboard_cell_bg(1, 3, TF15Bull)
dashboard_cell(1, 4, TF30Bull ? "🟢" : "🔴", true), dashboard_cell_bg(1, 4, TF30Bull)
dashboard_cell(1, 5, TF60Bull ? "🟢" : "🔴", true), dashboard_cell_bg(1, 5, TF60Bull)
dashboard_cell(1, 6, TF240Bull ? "🟢" : "🔴", true), dashboard_cell_bg(1, 6, TF240Bull)
dashboard_cell(1, 7, TFDBull ? "🟢" : "🔴", true), dashboard_cell_bg(1, 7, TFDBull)
dashboard_cell(2, 0, "Strength")
dashboard_cell(2, 1, adxstrong ? "🚀🚀" : "🚀", true), dashboard_cell_bg(2, 1, adxstrong)
dashboard_cell(2, 2, TF5Strong ? "🚀🚀" : "🚀", true), dashboard_cell_bg(2, 2, TF5Strong)
dashboard_cell(2, 3, TF15Strong ? "🚀🚀" : "🚀", true), dashboard_cell_bg(2, 3, TF15Strong)
dashboard_cell(2, 4, TF30Strong ? "🚀🚀" : "🚀", true), dashboard_cell_bg(2, 4, TF30Strong)
dashboard_cell(2, 5, TF60Strong ? "🚀🚀" : "🚀", true), dashboard_cell_bg(2, 5, TF60Strong)
dashboard_cell(2, 6, TF240Strong ? "🚀🚀" : "🚀", true), dashboard_cell_bg(2, 6, TF240Strong)
dashboard_cell(2, 7, TFDStrong ? "🚀🚀" : "🚀", true), dashboard_cell_bg(2, 7, TFDStrong)
plot(showRevBands ? upperKC1 : na, "Upper Reversal Band 1", colorupperband)
plot(showRevBands ? upperKC2 : na, "Upper Reversal Band 2", colorupperband)
plot(showRevBands ? upperKC3 : na, "Upper Reversal Band 3", colorupperband)
plot(showRevBands ? upperKC4 : na, "Upper Reversal Band 4", colorupperband)
plot(showRevBands ? lowerKC1 : na, "Lower Reversal Band 1", colorlowerband)
plot(showRevBands ? lowerKC2 : na, "Lower Reversal Band 2", colorlowerband)
plot(showRevBands ? lowerKC3 : na, "Lower Reversal Band 3", colorlowerband)
plot(showRevBands ? lowerKC4 : na, "Lower Reversal Band 4", colorlowerband)
fill(plot(showRibbon ? ribbon1 : na, "", na, editable=false), plot(showRibbon ? ribbon2 : na, "", na, editable=false), ribbon1 > ribbon2 ? uptrend : downtrend)
alert01 = ta.crossover(wt1, wt2) and wt2 <= -55
alert02 = ta.crossunder(wt1, wt2) and wt2 >= 55
alerts(sym) =>
if alert01 or alert02
alert_text = alert01 ? "Buy Signal" : alert02 ? "Sell Signal" : "Buy Signal , Sell Signal"
alert(alert_text, alert.freq_once_per_bar_close)
alerts(syminfo.tickerid)
alertcondition(alert01, "Buy Alert", "Buy Signal, TimeFrame={{interval}}")
alertcondition(alert02, "Sell Alert", "Sell Signal, TimeFrame={{interval}}")
group = "MULTI-TIMEFRAME S/R"
showSR = input.bool(true, title = "", inline = "01", group=group)
timef = input.timeframe("", "", inline = "01", group=group)
levels = input.int(7 , "Levels", inline = "01", group = group)
linewidth = input.int(1, "Width", inline = "02", group = group) * 20
supportcolor = input.color(color.new(#00ddff, 75), "", inline = "02", group = group)
resistancecolor = input.color(color.new(#e91e62, 75), "", inline = "02", group = group)
labelon = input.string("On", "Label", ["On", "Off"], inline = "03", group = group)
labelsize = input.string("Default", "Size", ["Small", "Default", "Large"], inline = "03", group = group)
labelcol = input.color(#787b86, "", inline = "03", group = group)
labelloc = input.int(10, "Offset", inline = "04", group = group) + 30
showtimef = input.bool(true, "Show Timeframe", inline = "04", group = group)
showtprice = input.bool(true, "Show Price", inline = "04", group = group)
src_c = request.security(syminfo.tickerid,timef,close, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_off)
src_o = request.security(syminfo.tickerid,timef,open, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_off)
f_resInMinutes() =>
_resInMinutes = timeframe.multiplier * (timeframe.isseconds ? 1. / 60 : timeframe.isminutes ? 1. : timeframe.isdaily ? 60. * 24 : timeframe.isweekly ? 60. * 24 * 7 : timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
_resInMinutes
f_timefResInMinutes(_res) =>
request.security(syminfo.tickerid, _res, f_resInMinutes())
f_timefIsIntraday(_res) =>
[intraday, daily, weekly, monthly] = request.security(syminfo.tickerid, _res, [timeframe.isintraday, timeframe.isdaily, timeframe.isweekly, timeframe.ismonthly])
check = intraday ? "Intraday" : daily ? "Daily" : weekly ? "Weekly" : monthly ? "Monthly" : "Error"
check
mtimef_multiplier = int (f_timefResInMinutes(timef) / f_resInMinutes())
prd = 10
maxnumpp = 284
ChannelW = 10
min_strength = 2
prd := prd * mtimef_multiplier
float src1 = math.max(src_c, src_o)
float src2 = math.min(src_c, src_o)
float src3 = math.max(close, open)
float src4 = math.min(close, open)
float ph = ta.pivothigh(src1, prd, prd)
float pl = ta.pivotlow(src2, prd, prd)
Lstyle = line.style_solid
timef_res = f_timefIsIntraday(timef)
timef_text = str.tostring(timef)
if str.tostring(timef) == ""
timef_text := na(timeframe.multiplier / 60) ? timeframe.period : timeframe.multiplier < 60 ? timeframe.period + " M |" : str.tostring(timeframe.multiplier / 60) + " H |"
else if timef_res == "Intraday"
timef_text := na(str.tonumber(timef) / 60) ? str.tostring(timef) : str.tonumber(timef) < 60 ? str.tostring(timef) + " M |" : str.tostring(str.tonumber(timef) / 60) + " H |"
else
timef_text := str.tostring(timef)
prdhighest = request.security(syminfo.tickerid, timef, ta.highest(300))
prdlowest = request.security(syminfo.tickerid, timef, ta.lowest(300))
cwidth = (prdhighest - prdlowest) * ChannelW / 100
var pivotvals = array.new_float(0)
if ph or pl
array.unshift(pivotvals, ph ? ph : pl)
if array.size(pivotvals) > maxnumpp // limit the array size
array.pop(pivotvals)
get_sr_vals(ind) =>
float lo = array.get(pivotvals, ind)
float hi = lo
int numpp = 0
for y = 0 to array.size(pivotvals) - 1 by 1
float cpp = array.get(pivotvals, y)
float wdth = cpp <= lo ? hi - cpp : cpp - lo
if wdth <= cwidth // fits the max channel width?
lo := cpp <= lo ? cpp : lo
hi := cpp > lo ? cpp : hi
numpp += 1
numpp
[hi, lo, numpp]
var sr_up_level = array.new_float(0)
var sr_dn_level = array.new_float(0)
sr_strength = array.new_float(0)
find_loc(strength) =>
ret = array.size(sr_strength)
for i = ret > 0 ? array.size(sr_strength) - 1 : na to 0 by 1
if strength <= array.get(sr_strength, i)
break
ret := i
ret
ret
check_sr(hi, lo, strength) =>
ret = true
for i = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
if array.get(sr_up_level, i) >= lo and array.get(sr_up_level, i) <= hi or array.get(sr_dn_level, i) >= lo and array.get(sr_dn_level, i) <= hi
if strength >= array.get(sr_strength, i)
array.remove(sr_strength, i)
array.remove(sr_up_level, i)
array.remove(sr_dn_level, i)
ret
else
ret := false
ret
break
ret
var sr_lines = array.new_line(11, na)
var sr_labels = array.new_label(11, na)
var timef_labels = array.new_label(11, na)
if ph or pl
array.clear(sr_up_level)
array.clear(sr_dn_level)
array.clear(sr_strength)
for x = 0 to array.size(pivotvals) - 1 by 1
[hi, lo, strength] = get_sr_vals(x)
if check_sr(hi, lo, strength)
loc = find_loc(strength)
if loc < levels and strength >= min_strength
array.insert(sr_strength, loc, strength)
array.insert(sr_up_level, loc, hi)
array.insert(sr_dn_level, loc, lo)
if array.size(sr_strength) > levels
array.pop(sr_strength)
array.pop(sr_up_level)
array.pop(sr_dn_level)
for x = 1 to 10 by 1
line.delete(array.get(sr_lines, x))
label.delete(array.get(sr_labels, x))
label.delete(array.get(timef_labels, x))
for x = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
float mid = math.round_to_mintick((array.get(sr_up_level, x) + array.get(sr_dn_level, x)) / 2)
if showSR
array.set(sr_lines, x + 1, line.new(x1=bar_index, y1=mid, x2=bar_index - 1, y2=mid, extend=extend.both, color=mid >= close ? resistancecolor : supportcolor, style=Lstyle, width=linewidth))
if labelon == "On"
size = labelsize == "Small" ? size.small : labelsize == "Default" ? size.normal : size.large
array.set(sr_labels, x + 1, label.new(x=bar_index + labelloc, y=mid, text=(showtimef ? timef_text : na) + (showtprice ? (" " + str.tostring(mid)) : na), color=mid >= close ? #ff525200 : #00e67700, textcolor=labelcol,
size = size, style=label.style_label_left))
f_crossed_over() =>
ret = false
for x = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
float mid = math.round_to_mintick((array.get(sr_up_level, x) + array.get(sr_dn_level, x)) / 2)
if close[1] <= mid and close > mid
ret := true
ret
ret
f_crossed_under() =>
ret = false
for x = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
float mid = math.round_to_mintick((array.get(sr_up_level, x) + array.get(sr_dn_level, x)) / 2)
if close[1] >= mid and close < mid
ret := true
ret
ret
alertcondition(f_crossed_over(), title= "Price Breaks Resistance", message = "Price Breaks Resistance, TimeFrame={{interval}}")
alertcondition(f_crossed_under(), title="Price Loses Support", message="Price Loses Support, TimeFrame={{interval}}")
styleGann = line.style_solid
var arrayXGann = array.new_int(5,time)
var arrayYGann = array.new_float(5,close)
var arrayLineGann = array.new_line()
int drawLineGann = 0
_high = request.security(syminfo.tickerid,"",high,lookahead=barmerge.lookahead_on)
_low = request.security(syminfo.tickerid,"",low,lookahead=barmerge.lookahead_on)
_close = request.security(syminfo.tickerid,"",close,lookahead=barmerge.lookahead_on)
_open = request.security(syminfo.tickerid,"",open,lookahead=barmerge.lookahead_on)
highPrev = _high
lowPrev = _low
drawLineGann := 0
if(_high[0] > highPrev[1] and _low[0] > lowPrev[1])
if(array.get(arrayYGann,0) > array.get(arrayYGann,1))
if(_high[0] > array.get(arrayYGann,0))
if(_high[0] <= high)
array.set(arrayXGann, 0, time)
array.set(arrayYGann, 0, _high[0])
drawLineGann := 2
else
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_high[0])
drawLineGann := 1
else if(_high[0] < highPrev[1] and _low[0] < lowPrev[1])
if(array.get(arrayYGann,0) > array.get(arrayYGann,1))
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_low[0])
drawLineGann := 1
else
if(_low[0] < array.get(arrayYGann,0))
if(_low[0] >= low)
array.set(arrayXGann, 0, time)
array.set(arrayYGann, 0, _low[0])
drawLineGann := 2
else if((_high[0] >= highPrev[1] and _low[0] < lowPrev[1]) or (_high[0] > highPrev[1] and _low[0] <= lowPrev[1]))
if(array.get(arrayYGann,0) > array.get(arrayYGann,1))
if(_high[0] >= array.get(arrayYGann,0) and array.get(arrayYGann,1) <= _low[0])
if(_high[0] <= high)
array.set(arrayXGann, 0, time)
array.set(arrayYGann, 0, _high[0])
drawLineGann := 2
else if(_high[0] >= array.get(arrayYGann,0) and array.get(arrayYGann,1) >= _low[0])
if(_close < _open)
if(_high[0] <= high)
array.set(arrayXGann, 0, time)
array.set(arrayYGann, 0, _high[0])
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_low[0])
drawLineGann := 3
else
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_low[0])
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_high[0])
drawLineGann := 4
else if(array.get(arrayYGann,0) < array.get(arrayYGann,1))
if(_low[0] <= array.get(arrayYGann,0) and _high[0] <= array.get(arrayYGann,1))
if(_low[0] >= low)
array.set(arrayXGann, 0, time)
array.set(arrayYGann, 0, _low[0])
drawLineGann := 2
else if(_low[0] <= array.get(arrayYGann,0) and _high[0] >= array.get(arrayYGann,1))
if(_close > _open)
if(_low[0] >= low)
array.set(arrayXGann, 0, time)
array.set(arrayYGann, 0, _low[0])
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_high[0])
drawLineGann := 3
else
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_high[0])
array.unshift(arrayXGann,time)
array.unshift(arrayYGann,_low[0])
drawLineGann := 4
else
if(array.get(arrayYGann,0) >= low)
array.set(arrayXGann, 0, time)
drawLineGann := 2
if(showGann and timeframe.in_seconds())
if(drawLineGann == 2)
if(array.size(arrayLineGann) >0)
line.set_xy2(array.get(arrayLineGann,0),array.get(arrayXGann,0),array.get(arrayYGann,0))
else
array.unshift(arrayLineGann,line.new(array.get(arrayXGann,1),array.get(arrayYGann,1),array.get(arrayXGann,0),array.get(arrayYGann,0), color = colorGann,xloc = xloc.bar_time,width = 1,style=line.style_solid))
else if(drawLineGann == 1)
array.unshift(arrayLineGann,line.new(array.get(arrayXGann,1),array.get(arrayYGann,1),array.get(arrayXGann,0),array.get(arrayYGann,0), color = colorGann,xloc = xloc.bar_time,width = 1,style=line.style_solid))
else if(drawLineGann == 3)
Показано первые 50% кода (символов: 44481)
Открыть по тарифу
Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.
Разовая покупка файла
На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.
Зачем нужен email? После подтверждения оплаты файл сохранится в кабинете на этот email. Если аккаунта ещё нет, мы создадим его и пришлём ссылку для задания пароля. Если аккаунт уже есть, покупка добавится в него. Укажите адрес, к которому у вас есть доступ.
Чтобы оформить заказ, введите email и перейдите к оплате.