← К каталогу
Исходный код · ID 4333

simplealgo v3

trader-criptom4n fixed eror.txt

Похожие материалы по тегам

range breakout @meowforex1.pineTradingView · 1 общих тегов#1.mtf_collider_h4_close_13_v18bar.mq4MQL4 / MetaTrader 4 · 1 общих тегов!mth_fasttmaline_edit3.mq4MQL4 / MetaTrader 4 · 1 общих тегов!mth_fasttmaline_edit2.mq4MQL4 / MetaTrader 4 · 1 общих тегов!mth_fasttmaline_edit.mq4MQL4 / MetaTrader 4 · 1 общих теговsmcj, fix.mq5MQL5 / MetaTrader 5 · 1 общих тегов
Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Краткий обзор

О программе

Индикатор для TradingView на Pine Script версии 5, предназначенный для технического анализа графиков цен. Совмещает несколько модулей анализа: трендовый индикатор SuperTrend, скользящие средние, определение бокового движения по ADX и расчёт уровней риск-менеджмента.

Включает элементы концепции Smart Money Concepts: отображение внутренней и свинговой рыночной структуры (BOS/CHoCH), ордер-блоки, равные highs/lows, разрывы справедливой стоимости (FVG), зоны премии, дисконта и равновесия, а также предыдущие дневные, недельные и месячные максимумы и минимумы.

Поддерживает визуализацию через облако тренда, окраску свечей, линии и метки уровней, графические объекты (линии, прямоугольники, подписи). Предусмотрены условия для оповещений TradingView и настраиваемые параметры отображения каждого элемента.

Настройки программы

НастройкаОписание
nbuysell Сигналы покупки/продажи — Включает или выключает отображение сигналов Buy/Sell на графике
levels2 Показать уровни TP/SL — Отображает уровни Take Profit и Stop Loss в виде меток и линий
lvlLines Показать линии уровней — Включает отрисовку линий для уровней входа, стоп-лосса и тейк-профита
linesStyle Стиль линий — Задаёт стиль линий уровней: сплошной, пунктирный или точечный
lvlDistance Расстояние — Определяет расстояние для построения линий уровней
lvlDecimals Десятичные знаки — Количество знаков после запятой при отображении ценовых уровней
atrRisk Процент риска — Процент риска, используемый для расчёта полос стоп-лосса на основе ATR
atrLen Длина ATR — Период усреднённого истинного диапазона для расчёта волатильности
CirrusCloud Облачко Cirrus — Отображение облачного трендового индикатора на графике
sidewaysThreshold Порог бокового движения ADX — Значение ADX, ниже которого рынок считается находящимся в боковом движении
percentStop Процент стоп-лосса — Процент стоп-лосса от цены входа; 0 отключает функцию
mode Режим — Режим отображения рыночной структуры: историческая или только текущая
style Стиль — Цветовая тема индикатора: цветная или монохромная
show_trend Окраска свечей — Окрашивает свечи в цвет, отражающий текущий определённый тренд
show_internals Показать внутреннюю структуру — Отображает внутреннюю рыночную структуру (BOS/CHoCH) на графике
show_ibull Бычья внутренняя структура — Условие отображения бычьей внутренней структуры: все, BOS или CHoCH
swing_ibull_css Цвет бычьей внутренней структуры — Цвет линий и подписей бычьей внутренней структуры
show_ibear Медвежья внутренняя структура — Условие отображения медвежьей внутренней структуры: все, BOS или CHoCH
swing_ibear_css Цвет медвежьей внутренней структуры — Цвет линий и подписей медвежьей внутренней структуры
ifilter_confluence Фильтр совпадений — Отфильтровывает незначительные пробои внутренней структуры
internal_structure_size Размер подписей внутренней структуры — Размер подписей для элементов внутренней рыночной структуры
show_Structure Показать свинговую структуру — Отображает свинговую рыночную структуру (BOS/CHoCH) на графике
show_bull Бычья свинговая структура — Условие отображения бычьей свинговой структуры: все, BOS или CHoCH
swing_bull_css Цвет бычьей свинговой структуры — Цвет линий и подписей бычьей свинговой структуры
show_bear Медвежья свинговая структура — Условие отображения медвежьей свинговой структуры: все, BOS или CHoCH
swing_bear_css Цвет медвежьей свинговой структуры — Цвет линий и подписей медвежьей свинговой структуры
swing_structure_size Размер подписей свинговой структуры — Размер подписей для элементов свинговой рыночной структуры
show_swings Показать точки свингов — Отображает точки свингов в виде меток на графике
length Длина свинга — Период для определения свинговых максимумов и минимумов
show_hl_swings Показать сильные/слабые максимумы и минимумы — Выделяет наиболее recent сильные и слабые highs и lows на графике
show_iob Внутренние ордер-блоки — Отображает внутренние ордер-блоки на графике
iob_showlast Количество внутренних ордер-блоков — Определяет, сколько последних внутренних ордер-блоков отображать
show_ob Свинговые ордер-блоки — Отображает свинговые ордер-блоки на графике
ob_showlast Количество свинговых ордер-блоков — Определяет, сколько последних свинговых ордер-блоков отображать
ob_filter Фильтр ордер-блоков — Метод фильтрации волатильных ордер-блоков
ibull_ob_css Цвет внутренних бычьих ордер-блоков — Цвет внутренних бычьих ордер-блоков
ibear_ob_css Цвет внутренних медвежьих ордер-блоков — Цвет внутренних медвежьих ордер-блоков
bull_ob_css Цвет свинговых бычьих ордер-блоков — Цвет свинговых бычьих ордер-блоков
bear_ob_css Цвет свинговых медвежьих ордер-блоков — Цвет свинговых медвежьих ордер-блоков
show_eq Равные highs и lows — Отображает равные максимумы и минимумы на графике
eq_len Бары подтверждения — Количество баров для подтверждения равных highs и lows
eq_threshold Порог — Порог чувствительности для определения равных уровней
eq_size Размер подписей EQH/EQL — Размер подписей для равных highs и lows
show_fvg Разрывы справедливой стоимости — Отображает разрывы справедливой стоимости (FVG) на графике
fvg_auto Авто-порог FVG — Автоматически определяет порог значимости для разрывов справедливой стоимости
fvg_tf Таймфрейм FVG — Таймфрейм для расчёта разрывов справедливой стоимости
bull_fvg_css Цвет бычьих FVG — Цвет бычьих разрывов справедливой стоимости
bear_fvg_css Цвет медвежьих FVG — Цвет медвежьих разрывов справедливой стоимости
fvg_extend Продление FVG — Определяет, на сколько баров продлевать прямоугольники FVG на графике
show_pdhl Дневные уровни — Отображает предыдущие дневные максимумы и минимумы на графике
pdhl_style Стиль дневных линий — Стиль линий для дневных максимумов и минимумов
pdhl_css Цвет дневных уровней — Цвет линий дневных максимумов и минимумов
show_pwhl Недельные уровни — Отображает предыдущие недельные максимумы и минимумы на графике
pwhl_style Стиль недельных линий — Стиль линий для недельных максимумов и минимумов
pwhl_css Цвет недельных уровней — Цвет линий недельных максимумов и минимумов
show_pmhl Месячные уровни — Отображает предыдущие месячные максимумы и минимумы на графике
pmhl_style Стиль месячных линий — Стиль линий для месячных максимумов и минимумов
pmhl_css Цвет месячных уровней — Цвет линий месячных максимумов и минимумов
show_sd Зоны премии/дисконта — Отображает зоны премии, дисконта и равновесия на графике
premium_css Цвет зоны премии — Цвет заливки зоны премии
eq_css Цвет зоны равновесия — Цвет заливки зоны равновесия
discount_css Цвет зоны дисконта — Цвет заливки зоны дисконта
Получить полный код

Поиск по коду файла

indicator("simplealgo v3", "🐳Criptom4N(r)🐳"

  , overlay = true
  , max_labels_count = 500
  , max_lines_count = 500
  , max_boxes_count = 500
  , max_bars_back = 500)

var float nsensitivity = 1

nbuysell   = input.bool(true, 'Buy/Sell Signal', inline = "BSNM",group='BUY/SELL SIGNAL')

sma4_strong        = ta.sma(close, 8)
sma5_strong          = ta.sma(close, 9)

supertrend(_close, factor, atrLen) =>
    atr = ta.atr(atrLen)
    upperBand = _close + factor * atr
    lowerBand = _close - factor * atr
    prevLowerBand = nz(lowerBand[1])
    prevUpperBand = nz(upperBand[1])
    lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
    upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
    int direction = na
    float superTrend = na
    prevSuperTrend = superTrend[1]
    if na(atr[1])
        direction := 1
    else if prevSuperTrend == prevUpperBand
        direction := close > upperBand ? -1 : 1
    else
        direction := close < lowerBand ? 1 : -1
    superTrend := direction == -1 ? lowerBand : upperBand
    [superTrend, direction]

sma4 = ta.sma(close, 8)
sma5 = ta.sma(close, 9)
sma9 = ta.sma(close, 13)

[supertrend, direction] = supertrend(close, nsensitivity * 7, 10)

bull = ta.crossover(close, supertrend) 
bear = ta.crossunder(close, supertrend) 

levels2      = input.bool(true, "Show TP/SL Levels2" , group = "Risk Management" , inline = "MMDB2")

lvlLines    = input.bool(true, "Show Lines ", inline="levels2", group = "Risk Management")
linesStyle  = input.string("SOLID", "", ["SOLID", "DASHED", "DOTTED"], inline="levels2", group = "Risk Management")
lvlDistance = input.int(40, "Distance", 1, inline="levels2", group = "Risk Management")
lvlDecimals = input.int(4, "   Decimals", 1, 8, inline="levels2", group = "Risk Management")
atrRisk     = input.int(3, "Risk % ", 1, group = "Risk Management" , inline="levels3")
atrLen      = input.int(14, "  ATR Length", 1, group = "Risk Management" , inline="levels3")
decimals  = lvlDecimals == 1 ? "#.#" : lvlDecimals == 2 ? "#.##" : lvlDecimals == 3 ? "#.###" : lvlDecimals == 4 ? "#.####" : lvlDecimals == 5 ? "#.#####" : lvlDecimals == 6 ? "#.######" : lvlDecimals == 7 ? "#.#######" : "#.########"
CirrusCloud       = input(true, 'Cirrus Cloud', group='TREND FEATURES')

windowsize = 100
offset = 0.9
sigma = 6

windowsize2 = 310 
offset2 = 0.85
sigma2 = 32

smoothrng(x, t, m) =>
    wper  = t * 2 - 1
    avrng = ta.ema(math.abs(x - x[1]), t)
    smoothrng = ta.ema(avrng, wper) * m
    smoothrng
smrng     = smoothrng(close, 22, 6)

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
    rngfilt
filt = rngfilt(close, smrng)

upward = 0.0
upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
downward = 0.0
downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])

filtcolor = upward > 0 ? color.new(#00e2ff, 50) : downward > 0 ? color.new(#fe0100, 50) : color.new(#56328f, 0)

tclength = 600
hullma = ta.wma(2*ta.wma(close, tclength/2)-ta.wma(close, tclength), math.floor(math.sqrt(tclength)))

x1 = 22
x2 = 9

x3 = 15
x4 = 5

smoothrngX1(x, t, m) =>
    wper  = t * 2 - 1
    avrng = ta.ema(math.abs(x - x[1]), t)
    smoothrngX1 = ta.ema(avrng, wper) * m
    smoothrngX1
smrngx1x     = smoothrngX1(close, x1, x2)
smrngx1x2     = smoothrngX1(close, x3, x4)

rngfiltx1x1(x, r) =>
    rngfiltx1x1 = x
    rngfiltx1x1 := x > nz(rngfiltx1x1[1]) ? x - r < nz(rngfiltx1x1[1]) ? nz(rngfiltx1x1[1]) : x - r : x + r > nz(rngfiltx1x1[1]) ? nz(rngfiltx1x1[1]) : x + r
    rngfiltx1x1
filtx1 = rngfiltx1x1(close, smrngx1x)
filtx12 = rngfiltx1x1(close, smrngx1x2)

upwardx1 = 0.0
upwardx1 := filtx1 > filtx1[1] ? nz(upwardx1[1]) + 1 : filtx1 < filtx1[1] ? 0 : nz(upwardx1[1])
downwardx1 = 0.0
downwardx1 := filtx1 < filtx1[1] ? nz(downwardx1[1]) + 1 : filtx1 > filtx1[1] ? 0 : nz(downwardx1[1])

filtx1colorx1 = color.rgb(0, 187, 212, 100)
xxx1 = plot(CirrusCloud ? filtx1 : na, color=filtx1colorx1, linewidth=1, title='Trend Tracer', editable = false)
xxx2 = plot(CirrusCloud ? filtx12 : na, color=filtx1colorx1, linewidth=1, title='Trend Tracer', editable = false)

fill(xxx1, xxx2, color= filtx1 > filtx12 ? color.rgb(254, 0, 0, 86) : color.rgb(21, 255, 0, 86))

trigger2 = bull ? 1 : 0
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger   = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
atrBand = ta.atr(atrLen) * atrRisk
atrStop = trigger == 1 ? low - atrBand : high + atrBand

green       = #2BBC4D, green2   = color.rgb(0, 221, 0, 27)
red         = #C51D0B, red2     = #c51d0b

adxlen = 15
dilen = 15
dirmov(len) =>
    up = ta.change(high)
    down = -ta.change(low)
    plusDM = na(up) ? na : up > down and up > 0 ? up : 0
    minusDM = na(down) ? na : down > up and down > 0 ? down : 0
    truerange = ta.rma(ta.tr, len)
    plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
    minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
    [plus, minus]
adx(dilen, adxlen) =>
    [plus, minus] = dirmov(dilen)
    sum = plus + minus
    adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
    adx
sig = adx(dilen, adxlen)

sidewaysThreshold = input.int(title='ADX Sideways Threshold (10-30)', minval=2, defval=15)

bool isSideways = sig < sidewaysThreshold

useBarColor = true
bColor = isSideways ? #b102fc : na
barcolor(useBarColor ? bColor : na)

barcolor(close > supertrend ? #3cff00 : #fe0100)

percentStop = input.float(1, "Stop Loss % (0 to Disable)", 0, group="BUY & SELL SIGNALS")

srcStop = close

lastTrade(src) => ta.valuewhen(bull or bear, src, 0)
entry_y = lastTrade(srcStop)
stop_y = lastTrade(atrStop)
tp1_y = (entry_y - lastTrade(atrStop)) * 1 + entry_y
tp2_y = (entry_y - lastTrade(atrStop)) * 2 + entry_y    
tp3_y = (entry_y - lastTrade(atrStop)) * 3 + entry_y

labelTpSl(y, txt, color) =>
    label labelTpSl = percentStop != 0 ? label.new(bar_index + 1, y, txt, xloc.bar_index, yloc.price, color, label.style_label_left, #000000, size.normal) : na
    label.delete(labelTpSl[1])

if (levels2)
    labelTpSl(entry_y, " Entry --  " + str.tostring(entry_y, decimals), color.gray)
    labelTpSl(stop_y , " Stop Loss --  " + str.tostring(stop_y, decimals), #f90808)
    labelTpSl(tp1_y, " TP 1 --  " + str.tostring(tp1_y, decimals), #00ff08)
    labelTpSl(tp2_y, " TP 2 --  " + str.tostring(tp2_y, decimals), #00ff08)
    labelTpSl(tp3_y, " TP 3 --  " + str.tostring(tp3_y, decimals), #00ff08)

style2 = linesStyle == "SOLID" ? line.style_solid : linesStyle == "DASHED" ? line.style_dashed : line.style_dotted

lineTpSl(y, color) =>
    line lineTpSl = percentStop != 0 ? line.new(bar_index - (trigger ? countBull : countBear) + 4, y, bar_index + 1, y, xloc.bar_index, extend.none, color, style2) : na
    line.delete(lineTpSl[1])

if (lvlLines)
    lineTpSl(entry_y, color.green)
    lineTpSl(stop_y, color.red)
    lineTpSl(tp1_y, color.green)
    lineTpSl(tp2_y, color.green)
    lineTpSl(tp3_y, color.green)

y1 = low - (ta.atr(30) * 2), y1B = low - ta.atr(30)
y2 = high + (ta.atr(30) * 2), y2B = high + ta.atr(30)

buy  =  bull and nbuysell  ? label.new(bar_index, y1, sma4_strong   >= sma5_strong   ? "🚀" : "🚀", xloc.bar_index, yloc.price, color.rgb(10, 247, 18, 60), label.style_label_up, #000000, size.normal) : na
sell =  bear and nbuysell  ? label.new(bar_index, y2, sma4_strong   <= sma5_strong   ? "🐻" : "🐻", xloc.bar_index, yloc.price, color.rgb(239, 12, 12, 66), label.style_label_down, #000000, size.normal) : na

int volSen = 3

plotchar(volSen, "volSen", "", location.top)

ema1        = ta.ema(ohlc4, 5*volSen)
ema2        = ta.ema(ohlc4, 9*volSen)
ema3        = ta.ema(ohlc4, 13*volSen)
ema4        = ta.ema(ohlc4, 34*volSen)
ema5        = ta.ema(ohlc4, 50*volSen)

alertcondition(bull, title='Buy Signal', message = "BUY")
alertcondition(bear, title='sell Signal', message = "BUY") 

color TRANSP_CSS = #ffffff00

string MODE_TOOLTIP          = 'Allows to display historical Structure or only the recent ones'
string STYLE_TOOLTIP         = 'Indicator color theme'
string COLOR_CANDLES_TOOLTIP = 'Display additional candles with a color reflecting the current trend detected by structure'
string SHOW_INTERNAL         = 'Display internal market structure'
string CONFLUENCE_FILTER     = 'Filter non significant internal structure breakouts'
string SHOW_SWING            = 'Display swing market Structure'
string SHOW_SWING_POINTS     = 'Display swing point as labels on the chart'
string SHOW_SWHL_POINTS      = 'Highlight most recent strong and weak high/low points on the chart'
string INTERNAL_OB           = 'Display internal order blocks on the chart\n\nNumber of internal order blocks to display on the chart'
string SWING_OB              = 'Display swing order blocks on the chart\n\nNumber of internal swing blocks to display on the chart'
string FILTER_OB             = 'Method used to filter out volatile order blocks \n\nIt is recommended to use the cumulative mean range method when a low amount of data is available'
string SHOW_EQHL             = 'Display equal highs and equal lows on the chart'
string EQHL_BARS             = 'Number of bars used to confirm equal highs and equal lows'
string EQHL_THRESHOLD        = 'Sensitivity threshold in a range (0, 1) used for the detection of equal highs & lows\n\nLower values will return fewer but more pertinent results'
string SHOW_FVG              = 'Display fair values gaps on the chart'
string AUTO_FVG              = 'Filter out non significant fair value gaps'
string FVG_TF                = 'Fair value gaps timeframe'
string EXTEND_FVG            = 'Determine how many bars to extend the Fair Value Gap boxes on chart'
string PED_ZONES             = 'Display premium, discount, and equilibrium zones on chart'

mode = input.string('Historical'
  , options = ['Historical', 'Present']
  , group = 'Smart Money Concepts'
  , tooltip = MODE_TOOLTIP)

style = input.string('Colored'
  , options = ['Colored', 'Monochrome']
  , group = 'Smart Money Concepts'
  , tooltip = STYLE_TOOLTIP)

show_trend = input(false, 'Color Candles'
  , group = 'Smart Money Concepts'
  , tooltip = COLOR_CANDLES_TOOLTIP)

show_internals = input(false, 'Show Internal Structure'
  , group = 'Real Time Internal Structure'
  , tooltip = SHOW_INTERNAL)

show_ibull = input.string('All', 'Bullish Structure'
  , options = ['All', 'BOS', 'CHoCH']
  , inline = 'ibull'
  , group = 'Real Time Internal Structure')

swing_ibull_css = input(#089981, ''
  , inline = 'ibull'
  , group = 'Real Time Internal Structure')

show_ibear = input.string('All', 'Bearish Structure'
  , options = ['All', 'BOS', 'CHoCH']
  , inline = 'ibear'
  , group = 'Real Time Internal Structure')

swing_ibear_css = input(#f23645, ''
  , inline = 'ibear'
  , group = 'Real Time Internal Structure')

ifilter_confluence = input(false, 'Confluence Filter'
  , group = 'Real Time Internal Structure'
  , tooltip = CONFLUENCE_FILTER)

internal_structure_size = input.string('Tiny', 'Internal Label Size'
  , options = ['Tiny', 'Small', 'Normal']
  , group = 'Real Time Internal Structure')

show_Structure = input(true, 'Show Swing Structure'
  , group = 'Real Time Swing Structure'
  , tooltip = SHOW_SWING)

show_bull = input.string('All', 'Bullish Structure'
  , options = ['All', 'BOS', 'CHoCH']
  , inline = 'bull'
  , group = 'Real Time Swing Structure')

swing_bull_css = input(color.rgb(0, 0, 0), ''
  , inline = 'bull'
  , group = 'Real Time Swing Structure')

show_bear = input.string('All', 'Bearish Structure'
  , options = ['All', 'BOS', 'CHoCH']
  , inline = 'bear'
  , group = 'Real Time Swing Structure')

swing_bear_css = input(#000000, ''
  , inline = 'bear'
  , group = 'Real Time Swing Structure')

swing_structure_size = input.string('Small', 'Swing Label Size'
  , options = ['Tiny', 'Small', 'Normal']
  , group = 'Real Time Swing Structure')

show_swings = input(false, 'Show Swings Points'
  , inline = 'swings'
  , group = 'Real Time Swing Structure'
  , tooltip = SHOW_SWING_POINTS)

length = input.int(50, ''
  , minval = 10
  , inline = 'swings'
  , group = 'Real Time Swing Structure')

show_hl_swings = input(true, 'Show Strong/Weak High/Low'
  , group = 'Real Time Swing Structure'
  , tooltip = SHOW_SWHL_POINTS)

show_iob = input(false, 'Internal Order Blocks'
  , inline = 'iob'
  , group = 'Order Blocks'
  , tooltip = INTERNAL_OB)

iob_showlast = input.int(5, ''
  , minval = 1
  , inline = 'iob'
  , group = 'Order Blocks')

show_ob = input(true, 'Swing Order Blocks'
  , inline = 'ob'
  , group = 'Order Blocks'
  , tooltip = SWING_OB)

ob_showlast = input.int(5, ''
  , minval = 1
  , inline = 'ob'
  , group = 'Order Blocks')

ob_filter = input.string('Atr', 'Order Block Filter'
  , options = ['Atr', 'Cumulative Mean Range']
  , group = 'Order Blocks'
  , tooltip = FILTER_OB)

ibull_ob_css = input.color(#ffdd0033, 'Internal Bullish OB'
  , group = 'Order Blocks')

ibear_ob_css = input.color(#ffdd0033, 'Internal Bearish OB'
  , group = 'Order Blocks')

bull_ob_css = input.color(color.rgb(255, 255, 255, 80), 'Bullish OB'
  , group = 'Order Blocks')

bear_ob_css = input.color(color.rgb(255, 255, 255, 80), 'Bearish OB'
  , group = 'Order Blocks')

show_eq = input(false, 'Equal High/Low'
  , group = 'EQH/EQL'
  , tooltip = SHOW_EQHL)

eq_len = input.int(3, 'Bars Confirmation'
  , minval = 1
  , group = 'EQH/EQL'
  , tooltip = EQHL_BARS)

eq_threshold = input.float(0.1, 'Threshold'
  , minval = 0
  , maxval = 0.5
  , step = 0.1
  , group = 'EQH/EQL'
  , tooltip = EQHL_THRESHOLD)

eq_size = input.string('Tiny', 'Label Size'
  , options = ['Tiny', 'Small', 'Normal']
  , group = 'EQH/EQL')

show_fvg = input(true, 'Fair Value Gaps'
  , group = 'Fair Value Gaps'
  , tooltip = SHOW_FVG)

fvg_auto = input(true, "Auto Threshold"
  , group = 'Fair Value Gaps'
  , tooltip = AUTO_FVG)

fvg_tf = input.timeframe('', "Timeframe"
  , group = 'Fair Value Gaps'
  , tooltip = FVG_TF)

bull_fvg_css = input.color(#ddff006f, 'Bullish FVG'
  , group = 'Fair Value Gaps')

bear_fvg_css = input.color(#f2ff0060, 'Bearish FVG'
  , group = 'Fair Value Gaps')

fvg_extend = input.int(10, "Extend FVG"
  , minval = 0
  , group = 'Fair Value Gaps'
  , tooltip = EXTEND_FVG)

show_pdhl = input(false, 'Daily'
  , inline = 'daily'
  , group = 'Highs & Lows MTF')

pdhl_style = input.string('⎯⎯⎯', ''
  , options = ['⎯⎯⎯', '----', '····']
  , inline = 'daily'
  , group = 'Highs & Lows MTF')

pdhl_css = input(#2157f3, ''
  , inline = 'daily'
  , group = 'Highs & Lows MTF')

show_pwhl = input(false, 'Weekly'
  , inline = 'weekly'
  , group = 'Highs & Lows MTF')

pwhl_style = input.string('⎯⎯⎯', ''
  , options = ['⎯⎯⎯', '----', '····']
  , inline = 'weekly'
  , group = 'Highs & Lows MTF')

pwhl_css = input(#2157f3, ''
  , inline = 'weekly'
  , group = 'Highs & Lows MTF')

show_pmhl = input(false, 'Monthly'
  , inline = 'monthly'
  , group = 'Highs & Lows MTF')

pmhl_style = input.string('⎯⎯⎯', ''
  , options = ['⎯⎯⎯', '----', '····']
  , inline = 'monthly'
  , group = 'Highs & Lows MTF')

pmhl_css = input(#2157f3, ''
  , inline = 'monthly'
  , group = 'Highs & Lows MTF')

show_sd = input(false, 'Premium/Discount Zones'
  , group = 'Premium & Discount Zones'
  , tooltip = PED_ZONES)

premium_css = input.color(#f23645, 'Premium Zone'
  , group = 'Premium & Discount Zones')

eq_css = input.color(#b2b5be, 'Equilibrium Zone'
  , group = 'Premium & Discount Zones')

discount_css = input.color(#089981, 'Discount Zone'
  , group = 'Premium & Discount Zones')

n = bar_index

atr = ta.atr(200)
cmean_range = ta.cum(high - low) / n

hl() => [high, low]

get_ohlc()=> [close[1], open[1], high, low, high[2], low[2]]

display_Structure(x, y, txt, css, dashed, down, lbl_size)=>
    structure_line = line.new(x, y, n, y
      , color = css
      , style = dashed ? line.style_dashed : line.style_solid)

    structure_lbl = label.new(int(math.avg(x, n)), y, txt
      , color = TRANSP_CSS
      , textcolor = css
      , style = down ? label.style_label_down : label.style_label_up
      , size = lbl_size)

    if mode == 'Present'
        line.delete(structure_line[1])
        label.delete(structure_lbl[1])

swings(len)=>
    var os = 0

    upper = ta.highest(len)
    lower = ta.lowest(len)

    os := high[len] > upper ? 0 : low[len] < lower ? 1 : os[1]

    top = os == 0 and os[1] != 0 ? high[len] : 0
    btm = os == 1 and os[1] != 1 ? low[len] : 0

    [top, btm]

ob_coord(use_max, loc, target_top, target_btm, target_left, target_type)=>
    min = 99999999.
    max = 0.
    idx = 1

    ob_threshold = ob_filter == 'Atr' ? atr : cmean_range 

    if use_max
        for i = 1 to (n - loc)-1
            if (high[i] - low[i]) < ob_threshold[i] * 2
                max := math.max(high[i], max)
                min := max == high[i] ? low[i] : min
                idx := max == high[i] ? i : idx
    else
        for i = 1 to (n - loc)-1
            if (high[i] - low[i]) < ob_threshold[i] * 2
                min := math.min(low[i], min)
                max := min == low[i] ? high[i] : max
                idx := min == low[i] ? i : idx

    array.unshift(target_top, max)
    array.unshift(target_btm, min)
    array.unshift(target_left, time[idx])
    array.unshift(target_type, use_max ? -1 : 1)

display_ob(boxes, target_top, target_btm, target_left, target_type, show_last, swing, size)=>
    for i = 0 to math.min(show_last-1, size-1)
        get_box = array.get(boxes, i)

        box.set_lefttop(get_box, array.get(target_left, i), array.get(target_top, i))
        box.set_rightbottom(get_box, array.get(target_left, i), array.get(target_btm, i))
        box.set_extend(get_box, extend.right)

        color css = na

        if swing 
            if style == 'Monoch

Показано первые 50% кода (символов: 27452)

Открыть по тарифу

Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.

Разовая покупка файла

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
2 745,20₽ ≈ $33.56