ورود

ثبت نام

خانه >

تحلیل ها >

ورود 7b

ورود 7b

Abri502

analysis_chart
مشخصات معامله

قیمت در زمان انتشار:

۸۹,۳۹۲.۳۹

توضیحات
//@version=5
indicator("AI-Style ICT/SMC Helper — TP/Entry/SL & Zones", overlay=true, max_labels_count=500, max_boxes_count=10)

// ----------------- Inputs -----------------
left = input.int(5, "Pivot Left (sensitivity)", minval=1)
right = input.int(3, "Pivot Right", minval=1)

useATRforSL = input.bool(true, "Use ATR for Stop Loss")
atrLen = input.int(14, "ATR Length")
atrMult = input.float(1.5, "ATR Multiplier for SL", step=0.1)

tp_method = input.string(title="TP method", defval="Fibonacci from range", options= )
fib1 = input.float(0.382, "Fibonacci TP1")
fib2 = input.float(0.618, "Fibonacci TP2")
fib3 = input.float(1.0, "Fibonacci TP3")

atrTP_mults = input.string("1.5,3,5", "ATR TP multiples (comma-separated)")

showZones = input.bool(true, "Show interest zone (order-block style)")
showLabels = input.bool(true, "Show live labels on last candle")

// Visual
colorUp = input.color(color.new(color.green, 0), "Up color")
colorDown = input.color(color.new(color.red, 0), "Down color")
zoneOpacity = input.int(85, "Zone opacity (0-255)", minval=0, maxval=255)

// ----------------- Calculations -----------------
atr = ta.atr(atrLen)

// pivots
ph = ta.pivothigh(high, left, right)
pl = ta.pivotlow(low, left, right)

// get last pivot values and their bar index
var float lastPH_val = na
var int lastPH_idx = na
var float lastPL_val = na
var int lastPL_idx = na

if not na(ph)
lastPH_val := ph
lastPH_idx := bar_index - right // pivot reported at bar_index-right
if not na(pl)
lastPL_val := pl
lastPL_idx := bar_index - right

// find two most recent pivots to determine structure
// We'll scan recent N bars to pick last high/low pivots (simple approach)
scanBars = math.max(100, left + right + 20)
var float recentPH = na
var int recentPH_idx = na
var float recentPL = na
var int recentPL_idx = na

// update recent pivots from stored lastPH/lastPL (they update when pivot found)
recentPH := lastPH_val
recentPH_idx := lastPH_idx
recentPL := lastPL_val
recentPL_idx := lastPL_idx

// Determine trend: compare most recent swing sequence
// if last significant swing low is after last swing high => price making higher lows -> bullish bias
trend = "Neutral"
if not na(recentPH) and not na(recentPL)
if recentPL_idx > recentPH_idx and recentPL > recentPH // unusual, fallback
trend := "Bullish"
else
// Compare last two pivots by time order: check which came later and relative price
if recentPH_idx > recentPL_idx
// last pivot was PH -> price made a local high most recently => maybe bearish
trend := (close < recentPH) ? "Bearish" : "Neutral"
else
// last pivot was PL -> local low most recently => maybe bullish
trend := (close > recentPL) ? "Bullish" : "Neutral"

// Alternative: simple moving average slope as confirmation (optional)
ma_len = input.int(50, "MA length for trend confirmation (0 to disable)")
ma = ma_len>0 ? ta.sma(close, ma_len) : na
maConfirm = na
if ma_len>0
maSlope = ma - ma
maConfirm := maSlope > 0 ? 1 : (maSlope < 0 ? -1 : 0)

// Build trade plan
var float entry = na
var float stopLoss = na
var float tp1 = na
var float tp2 = na
var float tp3 = na
var int box_id = na
var label idLabel = na

// compute based on last pivots
if not na(recentPH) and not na(recentPL)
// define base range as distance between last PH and last PL (absolute)
baseRange = math.abs(recentPH - recentPL)
// choose an entry level and stop depending on trend
if trend == "Bullish"
// Entry: breakout above recentPH (user can interpret as manual), indicator suggests entry = recentPH
entry := recentPH
// Stop: use recentPL or ATR buffer below
stop_by_pivot = recentPL
stop_by_atr = entry - atr * atrMult
stopLoss := useATRforSL ? math.min(stop_by_pivot, stop_by_atr) : stop_by_pivot
// TPs
if tp_method == "Fibonacci from range"
tp1 := entry + baseRange * fib1
tp2 := entry + baseRange * fib2
tp3 := entry + baseRange * fib3
else
// ATR multiples
mults = str.split(atrTP_mults, ",")
// safe parse
m1 = float(str.tonumber(array.get(mults, 0)))
m2 = array.size(mults) > 1 ? float(str.tonumber(array.get(mults, 1))) : m1*2.0
m3 = array.size(mults) > 2 ? float(str.tonumber(array.get(mults, 2))) : m1*3.0
tp1 := entry + atr * m1
tp2 := entry + atr * m2
tp3 := entry + atr * m3

else if trend == "Bearish"
entry := recentPL
stop_by_pivot = recentPH
stop_by_atr = entry + atr * atrMult
stopLoss := useATRforSL ? math.max(stop_by_pivot, stop_by_atr) : stop_by_pivot
if tp_method == "Fibonacci from range"
tp1 := entry - baseRange * fib1
tp2 := entry - baseRange * fib2
tp3 := entry - baseRange * fib3
else
mults = str.split(atrTP_mults, ",")
m1 = float(str.tonumber(array.get(mults, 0)))
m2 = array.size(mults) > 1 ? float(str.tonumber(array.get(mults, 1))) : m1*2.0
m3 = array.size(mults) > 2 ? float(str.tonumber(array.get(mults, 2))) : m1*3.0
tp1 := entry - atr * m1
tp2 := entry - atr * m2
tp3 := entry - atr * m3
else
// neutral: clear levels
entry := na
stopLoss := na
tp1 := na
tp2 := na
tp3 := na

// ----------------- Drawing -----------------

// Plot pivot points
plotshape(not na(recentPH) ? recentPH : na, title="Last PH", style=shape.triangledown, location=location.absolute, color=color.red, size=size.tiny, offset=0)
plotshape(not na(recentPL) ? recentPL : na, title="Last PL", style=shape.triangleup, location=location.absolute, color=color.green, size=size.tiny, offset=0)

// Plot entry/SL/TP lines
plot(entry, title="Entry", color=color.orange, linewidth=2, style=plot.style_linebr)
plot(stopLoss, title="Stop Loss", color=color.red, linewidth=2, style=plot.style_linebr)
plot(tp1, title="TP1", color=color.new(color.green, 0), linewidth=1, style=plot.style_linebr)
plot(tp2, title="TP2", color=color.new(color.green, 40), linewidth=1, style=plot.style_linebr)
plot(tp3, title="TP3", color=color.new(color.green, 80), linewidth=1, style=plot.style_linebr)

// Draw zone box (between pivot candle high/low) - simple order block idea
if showZones and not na(recentPH) and not na(recentPL)
// zone top/bottom depending on trend
zoneTop = math.max(recentPH, recentPL)
zoneBot = math.min(recentPH, recentPL)
// create one box and update it
if na(box_id)
box_id := box.new(left=recentPL_idx, top=zoneTop, right=bar_index, bottom=zoneBot, border_color=color.gray, bgcolor=trend=="Bullish" ? color.new(color.green, zoneOpacity) : color.new(color.red, zoneOpacity))
else
// move existing box (note: box.set_* not available in older builds; use new creation per pivot change)
box.delete(box_id)
box_id := box.new(left=recentPL_idx, top=zoneTop, right=bar_index, bottom=zoneBot, border_color=color.gray, bgcolor=trend=="Bullish" ? color.new(color.green, zoneOpacity) : color.new(color.red, zoneOpacity))

// live label on last candle
if showLabels
// delete previous label to avoid crowding
if not na(idLabel)
label.delete(idLabel)
txt = ""
if trend == "Bullish"
txt := "Trend: ↑ Bullish\nEntry: " + (entry==na ? "—" : str.tostring(entry, format.percent ? format.percent : format.price)) + "\nSL: " + (stopLoss==na ? "—" : str.tostring(stopLoss)) + "\nTP1: " + (tp1==na ? "—" : str.tostring(tp1)) + "\nTP2: " + (tp2==na ? "—" : str.tostring(tp2)) + "\nTP3: " + (tp3==na ? "—" : str.tostring(tp3))
else if trend == "Bearish"
txt := "Trend: ↓ Bearish\nEntry: " + (entry==na ? "—" : str.tostring(entry)) + "\nSL: " + (stopLoss==na ? "—" : str.tostring(stopLoss)) + "\nTP1: " + (tp1==na ? "—" : str.tostring(tp1)) + "\nTP2: " + (tp2==na ? "—" : str.tostring(tp2)) + "\nTP3: " + (tp3==na ? "—" : str.tostring(tp3))
else
txt := "Trend: Neutral\nNo clear entry"

idLabel := label.new(bar_index, high, txt, xloc=xloc.bar_index, yloc=yloc.abovebar, style=label.style_label_left, color=trend=="Bullish" ? color.new(color.green, 0) : (trend=="Bearish" ? color.new(color.red, 0) : color.new(color.gray, 60)), textcolor=color.white)

// Optional: show MA confirmation color on background
var bgcolor_id = na
if ma_len>0
if maConfirm == 1
// up
bgcolor(color.new(color.green, 90))
else if maConfirm == -1
bgcolor(color.new(color.red, 90))
else
na

// End of script

آخرین تحلیل‌های undefined

خلاصه تحلیل ها
مشاهده بیشتر
BTC/USD – رد باند + بازی فشردگی گپ (اجرای کتاب درسی)

BTC/USD – رد باند + بازی فشردگی گپ (اجرای کتاب درسی)

یک رد باند صعودی تمیز 30 دقیقه‌ای در BTC/USD را ثبت کردم که با یک الگوی فشردگی گپ صعودی هم‌راستا بود. قیمت پس از یک روند نزولی واضح، بالای باند پایین ...

Ethical_Bear-image

Ethical_Bear

حدود 2 ساعت قبل

منتخب سردبیر

مشاهده بیشتر

دستیار هوشمند ارز دیجیتال

ترمینال ترید بایتیکل نرم‌افزار جامع ترید و سرمایه‌گذاری در بازار ارز دیجیتال است و امکاناتی مانند دوره‌های آموزشی ترید و سرمایه‌گذاری، تریدینگ ویو بدون محدودیت، هوش مصنوعی استراتژی ساز ترید، کلیه داده‌‌های بازارهای مالی شامل داده‌های اقتصاد کلان، تحلیل احساسات بازار، تکنیکال و آنچین، اتصال و مدیریت حساب صرافی‌ها و تحلیل‌های لحظه‌ای را برای کاربران فراهم می‌کند.

دستیار هوشمند ارز دیجیتال
دستیار هوشمند ارز دیجیتال