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

Volumatic Fair Value Gaps [BigBeluga]

indicator_volumatic_fair_value_gaps_bigbeluga_for_tradingview_5927081411377895911.pine
Вы автор или правообладатель?

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

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

О программе

Индикатор для TradingView на Pine Script v6, который визуализирует зоны Fair Value Gaps (FVG) — ценовые разрывы между свечами, где отсутствовала ликвидность. Он определяет бычьи и медвежьи FVG на основе соотношения high и low предыдущих баров и отображает их цветными блоками на графике. Также индикатор учитывает объёмные данные: рассчитывает долю бычьего и медвежьего объёма внутри каждой зоны и отображает её в виде пропорциональных полосок. В правом верхнем углу графика выводится панель с количеством активных FVG каждого типа и суммарным объёмом.

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

НастройкаОписание
mitigationSrc Источник митигации FVG — Определяет, по какой цене (close или high/low) проверяется, закрыта ли зона FVG ценой текущей свечи.
bullGaps Бычьи FVG — Включает или выключает отображение бычьих зон Fair Value Gap на графике.
bearGaps Медвежьи FVG — Включает или выключает отображение медвежьих зон Fair Value Gap на графике.
volumeBars Полосы объёма — Включает или выключает отображение пропорциональных полосок объёма внутри каждой зоны FVG.
bullColor Цвет бычьих FVG — Задаёт цвет заливки для бычьих зон Fair Value Gap.
bearColor Цвет медвежьих FVG — Задаёт цвет заливки для медвежьих зон Fair Value Gap.
Получить полный код

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

indicator("Volumatic Fair Value Gaps [BigBeluga]", overlay = true, max_boxes_count = 500, max_bars_back = 5000)

string mitigationSrc = input.string("close", "FVGs Mitigation Source", ["close", "high/low"])

bool bullGaps   = input.bool(true, "Bullish FVG")
bool bearGaps   = input.bool(true, "Bearish FVG")
bool volumeBars = input.bool(true, "Volume Bars")

color bullColor = input.color(color.rgb(26, 194, 216, 50), "Bullish", inline = "colors")
color bearColor = input.color(color.rgb(216, 118, 26, 50), "Bearish", inline = "colors")

type VolumaticFVG
    box  body 
    int  bull 
    int  bear 
    bool isBull
    box  bullBar
    box  bearBar
    float totalVol

var fvgs  = array.new<VolumaticFVG>()
var boxes = array.new<box>()

float diff      =  close[1] > open[1] ? (low - high[2]) / low * 100 : (low[2] - high) / high *100
float sizeFVG   = diff / ta.percentile_nearest_rank(diff, 1000, 100) * 100
bool  filterFVG = sizeFVG > 10

bool isBull_gap = high[2] < low and high[2] < high[1] and low[2] < low and filterFVG
bool isBear_gap = low[2] > high and low[2] > low[1] and high[2] > high  and filterFVG

time_ = timeframe.in_seconds("")/60
time_s = timeframe.in_seconds("")
div   = 10

tf = time_ <= 1 ? "5S" : str.tostring(math.ceil(time_/div))

array<float> BullVolume = request.security_lower_tf('', tf, (close > open ? volume : 0))
array<float> BearVolume = request.security_lower_tf('', tf, (close < open ? volume : 0))

sumBull = BullVolume.sum()
sumBear = BearVolume.sum()
float totalVolume       = sumBull + sumBear

var dash = table.new(position.top_right, 100, 100, chart.bg_color)

if bar_index > 100

    if isBull_gap and bullGaps
        body    = box.new(bar_index-1, low, bar_index+5, high[2], bgcolor = color.new(bullColor, 70), border_color = na)
        mid     = math.avg(low, high[2])
        bullVol = (sumBull[1] / totalVolume[1]) * 100
        bearVol = (sumBear[1] / totalVolume[1]) * 100
        bearBar = box.new(body.get_left(), body.get_top(), body.get_left(), mid, bgcolor = bearColor, border_color = chart.bg_color)
        bullBar = box.new(body.get_left(), mid, body.get_left(), body.get_bottom(), bgcolor = bullColor, border_color = chart.bg_color)

        fvgs.push(VolumaticFVG.new(body, int(bullVol), int(bearVol), true, bullBar, bearBar, totalVolume[1]))

    if isBear_gap and bearGaps
        body    = box.new(bar_index-1, low[2], bar_index+5, high, bgcolor = color.new(bearColor, 70), border_color = na)
        mid     = math.avg(low[2], high)
        bullVol = (sumBull[1] / totalVolume[1]) * 100
        bearVol = (sumBear[1] / totalVolume[1]) * 100
        bearBar = box.new(body.get_left(), body.get_top(), body.get_left(), mid, bgcolor = bearColor, border_color = chart.bg_color)
        bullBar = box.new(body.get_left(), mid, body.get_left(), body.get_bottom(), bgcolor = bullColor, border_color = chart.bg_color)

        fvgs.push(VolumaticFVG.new(body, int(bullVol), int(bearVol), false, bullBar, bearBar, totalVolume[1]))

    if fvgs.size() > 0 

        for fvg in fvgs

            src1 = mitigationSrc == "close" ? close : low
            src2 = mitigationSrc == "close" ? close : high

            left  = fvg.body.get_left()
            right = fvg.body.get_right()

            if fvg.isBull
                if src1 < fvg.body.get_bottom() 
                    fvg.body.delete()
                    fvg.bullBar.delete()
                    fvg.bearBar.delete()
                 

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

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

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

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

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

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

Стоимость полного кода
491,30₽ ≈ $6.00