SMC Engine (FVG, POI, Breakaway)
Сообщите нам, если считаете, что материал размещён без разрешения.
Сообщить о материале
Обращение по товару «indicator smc engine (fvg, poi, breakaway) for tradingview.pine» отправится на рассмотрение. Укажите контакт для ответа и опишите причину.
О программе
Индикатор «SMC Engine (FVG, POI, Breakaway)» — это инструмент визуального анализа для TradingView, реализующий концепции Smart Money Concepts на основе Pine Script v6. Он отображает на графике зоны справедливой стоимости (FVG), ордер блоки, точки интереса (POI), а также обнаруживает прорывы структуры (BOS/CHoCH) и индукмент-прохождения (IDMT Sweep).
Индикатор поддерживает настройку отображения каждого типа зон отдельно, позволяет выбрать цвета и размеры подписей. Встроенный дашборд показывает количество активных FVG, Breakaway Gap, ордер блоков и зон POI, а также текущее рыночное направление.
Для работы используются стандартные средства Pine Script: расчёт pivot'ов через ta.pivothigh/ta.pivotlow, отрисовка графических объектов (box, line, label) и система оповещений alertcondition. Доступны оповещения на формирование бычьих и медвежьих FVG/Breakaway, а также на пересечение ценой ордер блоков.
Настройки программы
| Настройка | Описание |
|---|---|
| swing_length | Длина периода для определения swing pivot'ов, используемых при построении структуры и ордер блоков |
| onlyIntraday | Отображение SMC-структур (структура и IDMT) только на внутридневных таймфреймах |
| show_bull_obs | Отображение бычьих ордер блоков на графике |
| show_bear_obs | Отображение медвежьих ордер блоков на графике |
| ob_text_size | Размер подписей ордер блоков |
| idmt_text_size | Размер подписей индукмент-прохождения (IDMT Sweep) |
| show_poi | Отображение зон совпадения (POI) на графике |
| color_poi_bull | Цвет бычьих зон совпадения (POI) |
| color_poi_bear | Цвет медвежьих зон совпадения (POI) |
| show_fvg_ce | Отображение средней линии FVG на уровне 50% |
| color_fvg_bull | Цвет бычьих зон справедливой стоимости (FVG) |
| color_fvg_bear | Цвет медвежьих зон справедливой стоимости (FVG) |
| fvg_text_size | Размер подписей зон справедливой стоимости (FVG) и Breakaway Gap |
| show_breakaway_fvg | Отображение Breakaway Gap (дислокации) на графике |
| color_ba_bull | Цвет бычьих Breakaway Gap (дислокации) |
| color_ba_bear | Цвет медвежьих Breakaway Gap (дислокации) |
| color_idmt_text | Цвет текста меток индукмент-прохождения (IDMT Sweep) |
| color_idmt_line | Цвет линий индукмент-прохождения (IDMT Sweep) |
| show_dashboard | Отображение панели SMC-метрик на графике |
| dash_position | Позиция панели SMC-метрик на графике |
Поиск по коду файла
indicator ("SMC Engine (FVG, POI, Breakaway)", overlay=true, max_bars_back=1000, max_boxes_count=400, max_lines_count=500)
swing_length = input.int(7, title="Swing Pivot Length", minval=2)
onlyIntraday = input.bool(true, title="Show SMC Only on Intraday Charts (Applies to Structure/IDMT)", group="Display Settings")
show_bull_obs = input.bool(true, title="Show Bullish Order Blocks", group="Order Block Settings")
show_bear_obs = input.bool(true, title="Show Bearish Order Blocks", group="Order Block Settings")
ob_text_size = input.string("Normal", title="Order Block Label Size", options=["Small", "Normal", "Large", "Huge"], group="Order Block Settings")
idmt_text_size = input.string("Normal", title="IDMT Label Size", options=["Small", "Normal", "Large", "Huge"], group="IDMT Settings")
show_poi = input.bool(true, title="Show Master Confluent POI Zones?", group="POI Settings")
color_poi_bull = input.color(color.new(color.blue, 82), title="Bullish Master POI Color", group="POI Settings")
color_poi_bear = input.color(color.new(color.purple, 82), title="Bearish Master POI Color", group="POI Settings")
show_fvg_ce = input.bool(true, title="Show 50% FVG Midline (CE)?", group="FVG Settings")
color_fvg_bull = input.color(color.new(color.green, 85), title="FVG Bullish Color", group="FVG Settings")
color_fvg_bear = input.color(color.new(color.red, 85), title="FVG Bearish Color", group="FVG Settings")
fvg_text_size = input.string("Small", title="FVG & Breakaway Label Size", options=["Tiny", "Small", "Normal", "Large"], group="FVG Settings")
show_breakaway_fvg = input.bool(true, title="Show Breakaway Gaps (Displacement)?", group="Breakaway Gap Settings")
color_ba_bull = input.color(color.new(color.teal, 75), title="Bullish Breakaway Gap Color", group="Breakaway Gap Settings")
color_ba_bear = input.color(color.new(color.fuchsia, 75), title="Bearish Breakaway Gap Color", group="Breakaway Gap Settings")
color_idmt_text = input.color(color.rgb(255, 255, 255), title="IDMT Label Text Color", group="IDMT Settings")
color_idmt_line = input.color(color.rgb(255, 0, 128), title="IDMT Line Color", group="IDMT Settings")
show_dashboard = input.bool(true, title="Show SMC Dashboard?", group="Dashboard Settings")
dash_position = input.string("Top Right", title="Dashboard Position", options=["Top Right", "Bottom Right", "Top Left", "Bottom Left"], group="Dashboard Settings")
color_bull_structure = color.rgb(0, 200, 5)
color_bear_structure = color.rgb(255, 15, 15)
color_bull_ob = color.new(color.green, 90)
color_bear_ob = color.new(color.red, 90)
selected_ob_size = switch ob_text_size
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
"Huge" => size.huge
=> size.normal
selected_idmt_size = switch idmt_text_size
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
"Huge" => size.huge
=> size.normal
selected_fvg_size = switch fvg_text_size
"Tiny" => size.tiny
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
=> size.small
isIntradayTf = timeframe.isintraday
runStructure = not onlyIntraday or isIntradayTf
ph = ta.pivothigh(high, swing_length, swing_length)
pl = ta.pivotlow(low, swing_length, swing_length)
var float top_target = na
var float btm_target = na
var bool is_bullish = true
var label last_idmt_label = na
var line last_idmt_line = na
var bool idmt_already_printed = false
var float last_minor_low = na
var float last_minor_high = na
var bool look_for_bull_fvg = false
var bool look_for_bear_fvg = false
var bool look_for_bull_ba = false
var bool look_for_bear_ba = false
var box[] active_bull_fvgs = array.new_box()
var line[] active_bull_lines = array.new_line()
var box[] active_bear_fvgs = array.new_box()
var line[] active_bear_lines = array.new_line()
var box[] active_ba_bull_fvgs = array.new_box()
var line[] active_ba_bull_lines= array.new_line()
var box[] active_ba_bear_fvgs = array.new_box()
var line[] active_ba_bear_lines= array.new_line()
var box[] active_bull_obs = array.new_box()
var box[] active_bear_obs = array.new_box()
var box[] active_bull_pois = array.new_box()
var box[] active_bear_pois = array.new_box()
var box[] all_today_fvgs = array.new_box()
var line[] all_today_lines = array.new_line()
if timeframe.change("D")
if array.size(all_today_fvgs) > 0
for i = array.size(all_today_fvgs) - 1 to 0
box.delete(array.get(all_today_fvgs, i))
array.clear(all_today_fvgs)
if array.size(all_today_lines) > 0
for i = array.size(all_today_lines) - 1 to 0
line.delete(array.get(all_today_lines, i))
array.clear(all_today_lines)
array.clear(active_bull_fvgs)
array.clear(active_bull_lines)
array.clear(active_bear_fvgs)
array.clear(active_bear_lines)
array.clear(active_ba_bull_fvgs)
array.clear(active_ba_bull_lines)
array.clear(active_ba_bear_fvgs)
array.clear(active_ba_bear_lines)
if not na(ph)
top_target := ph
last_minor_high := ph
if not na(pl)
btm_target := pl
last_minor_low := pl
bool bull_ob_formed = false
bool bear_ob_formed = false
if runStructure
if not idmt_already_printed and not na(last_minor_low)
if ta.crossunder(low, last_minor_low) and close > last_minor_low
if not na(last_idmt_label)
label.delete(last_idmt_label)
line.delete(last_idmt_line)
last_idmt_label := label.new(bar_index, low, "IDMT Sweep", color=color.new(color.white, 100), textcolor=color_idmt_text, style=label.style_label_up, size=selected_idmt_size)
last_idmt_line := line.new(math.max(bar_index[swing_length], bar_index - 950), last_minor_low, bar_index, last_minor_low, color=color_idmt_line, style=line.style_dashed)
last_minor_low := na
idmt_already_printed := true
if not idmt_already_printed and not na(last_minor_high)
if ta.crossover(high, last_minor_high) and close < last_minor_high
if not na(last_idmt_label)
label.delete(last_idmt_label)
line.delete(last_idmt_line)
last_idmt_label := label.new(bar_index, high, "IDMT Sweep", color=color.new(color.white, 100), textcolor=color_idmt_text, style=label.style_label_down, size=selected_idmt_size)
last_idmt_line := line.new(math.max(bar_index[swing_length], bar_index - 950), last_minor_high, bar_index, last_minor_high, color=color_idmt_line, style=line.style_dashed)
last_minor_high := na
idmt_already_printed := true
if not na(top_target) and ta.crossover(close, top_target)
if runStructure
label.new(bar_index, high, is_bullish ? "BOS" : "CHoCH", color=color.new(color.white, 100), textcolor=color_bull_structure, style=label.style_label_down, size=size.small)
line.new(math.max(bar_index[swing_length], bar_index - 950), top_target, bar_index, top_target, color=color_bull_structure, style=line.style_dashed)
ob_top = high[swing_length]
ob_btm = math.min(open[swing_length], close[swing_length])
if show_bull_obs
box ob_box = box.new(left=bar_index[swing_length], top=ob_top, right=bar_index, bottom=ob_btm,
bgcolor=color_bull_ob, border_color=color.green, border_style=line.style_solid,
text="BULL OB", text_color=color.green, text_size=selected_ob_size, text_valign="top", text_halign="left")
array.push(active_bull_obs, ob_box)
if show_poi and show_bull_obs
box poi_box = box.new(left=bar_index[swing_length], top=ob_top, right=bar_index, bottom=ob_btm,
bgcolor=color_poi_bull, border_color=color.blue, border_style=line.style_dashed,
text="MASTER BULL POI", text_color=color.blue, text_size=size.small, text_valign="bottom", text_halign="left")
array.push(active_bull_pois, poi_box)
bull_ob_formed := true
is_bullish := true
top_target := na
idmt_already_printed := false
last_idmt_label := na
last_idmt_line := na
look_for_bull_fvg := true
look_for_bear_fvg := false
look_for_bull_ba := true
look_for_bear_ba := false
if not na(btm_target) and ta.crossunder(close, btm_target)
if runStructure
label.new(bar_index, low, is_bullish ? "CHoCH" : "BOS", color=color.new(color.white, 100), textcolor=color_bear_structure, style=label.style_label_up, size=size.small)
line.new(math.max(bar_index[swing_length], bar_index - 950), btm_target, bar_index, btm_target, color=color_bear_structure, style=line.style_dashed)
ob_top = math.max(open[swing_length], close[swing_length])
ob_btm = low[swing_length]
if show_bear_obs
box ob_box = box.new(left=bar_index[swing_length], top=ob_top, right=bar_index, bottom=ob_btm,
bgcolor=color_bear_ob, border_color=color.red, border_style=line.style_solid,
text="BEAR OB", text_color=color.red, text_size=selected_ob_size, text_valign="top", text_halign="left")
array.push(active_bear_obs, ob_box)
if show_poi and show_bear_obs
box poi_box = box.new(left=bar_index[swing_length], top=ob_top, right=bar_index, bottom=ob_btm,
bgcolor=color_poi_bear, border_color=color.purple, border_style=line.style_dashed,
text="MASTER BEAR POI", text_color=color.purple, text_size=size.small, text_valign="bottom", text_halign="left")
array.push(active_bear_pois, poi_box)
bear_ob_formed := true
is_bullish := false
btm_target := na
idmt_already_printed := false
last_idmt_label := na
last_idmt_line := na
look_for_bear_fvg := true
look_for_bull_fvg := false
look_for_bear_ba := true
look_for_bull_ba := false
var table wm = table.new(position.bottom_right, 1, 1)
if barstate.isfirst
table.cell(wm, 0, 0, "Telegram @SimpleForexTools", text_color = color.new(color.gray, 70), text_size = size.large)
bool bull_fvg_formed = false
bool bear_fvg_formed = false
bool ba_bull_formed = false
bool ba_bear_formed = false
if bar_index > 2
if look_for_bull_ba and show_breakaway_fvg and (low > high[2]) and (close[1] > high[2])
float ce_level = (low + high[2]) / 2.0
box_bx = box.new(left=bar_index[2], top=low, right=bar_index, bottom=high[2],
bgcolor=color_ba_bull, border_color=color.new(color.white, 60),
text="BREAKAWAY GAP", text_color=color.white, text_size=selected_fvg_size, text_valign="top", text_halign="right")
line_ce = show_fvg_ce ? line.new(x1=bar_index[2], y1=ce_level, xПоказано первые 50% кода (символов: 17361)