
IDM, BOS, CHOCH, ATR, RSI, MACD, EMA, HTF
ریٹرننگ ڈیٹا روایتی تکنیکی تجزیہ کا براہ راست مقابلہ کرتا ہے: 8 فیکٹر اکٹھا ماڈل + مارکیٹ ڈھانچے کی شناخت + IDM کی حوصلہ افزائی کا پتہ لگانا ، کم از کم 6⁄8 پوزیشن کھولنے کے لئے۔ کسی بھی اشارے کو “ادارہ کی سوچ” نہیں کہا جاتا ہے ، یہ نظام خاص طور پر BOS ((بنیادی توڑ) اور CHoCH ((خاصیت میں تبدیلی) کی شناخت کرتا ہے ، جو صرف سپورٹ مزاحمت کو دیکھنے کے مقابلے میں 300٪ زیادہ موثر ہے۔
بنیادی منطق سخت اور براہ راست ہے: اداروں نے خوردہ فروشوں کے اسٹاپ نقصانات کو صاف کرنے کے بعد ریورس اسٹاک بنایا۔ جب قیمتیں مختصر عرصے تک گرنے سے پہلے کم ہوتی ہیں اور پھر تیزی سے واپس آجاتی ہیں ، تو یہ ایک عام لیکویڈیٹی صفائی ہے ((IDM) ، اور جب خوردہ فروشوں کو دھویا جاتا ہے تو یہ ہمارے داخلے کا وقت ہے۔
یومیہ رسک کی حد 6٪ ، ہفتہ وار رسک کی حد 12٪ ، اور انفرادی رسک 1.5٪ ہے۔ ریاضی آسان ہے: مسلسل 4 مکمل پوزیشن نقصانات یومیہ اجارہ داری کو متحرک کرتے ہیں ، اور مسلسل 8 ہفتہ وار اجارہ داری ہیں۔ مسئلہ یہ ہے کہ کریپٹوکرنسی مارکیٹ میں اتار چڑھاؤ عام طور پر روایتی اثاثوں سے 3-5 گنا زیادہ ہوتا ہے ، اور یہ رسک انخلاء ہنگامی صورتحال میں تیزی سے ختم ہوجاتا ہے۔
اے ٹی آر کی ضرب 2.0 گنا اسٹاپ لوس + 2.0 گنا رسک ریٹ تھیوری میں معقول ہے ، لیکن عملی عمل میں سلائڈ پوائنٹ لاگت کو مدنظر رکھنا ضروری ہے۔ 0.05٪ ٹرانسمیشن فیس کی ترتیب فوری تجارت کے لئے موزوں ہے ، اگر یہ معاہدہ کی تجارت ہے تو اسے 0.1٪ سے زیادہ ایڈجسٹ کرنے کی سفارش کی جاتی ہے۔
RSI ((14)) + MACD ((12,26,9) + EMA ((200) + حجم تبادلہ + مارکیٹ کی ساخت + ٹائم ونڈو + اتار چڑھاؤ + اعلی ٹائم فریم کی تصدیق کریں۔ ہر عنصر کا وزن برابر ہے ((ہر 1 پوائنٹ) ، کم از کم 6 پوائنٹس کی پوزیشن کھولنے کا مطلب ہے کہ 75٪ عنصر کو ایک ساتھ پورا کرنا ہوگا۔
یہ ڈیزائن رجحان کے حالات میں عمدہ کارکردگی کا مظاہرہ کرتا ہے ، لیکن افقی اتار چڑھاؤ کے دوران سگنل کم ہوتے ہیں۔ تاریخی جائزے سے پتہ چلتا ہے کہ یہ حکمت عملی زیادہ اتار چڑھاؤ والی کریپٹو مارکیٹ کے لئے موزوں ہے ، جہاں روایتی اسٹاک مارکیٹ میں سگنل کی تعدد نمایاں طور پر کم ہوگی۔
BOS اور CHoCH کی شناخت 5 دورانیہ کے محور پوائنٹس پر مبنی ہے ، یہ پیرامیٹر 1 گھنٹے کے چارٹ سے زیادہ ٹائم فریم پر مستحکم ہے۔ لیکن IDM ((حوصلہ افزائی) کا پتہ لگانے میں صرف 3 K لائنوں کا فیصلہ کیا جاتا ہے ، جو ہائی فریکوئنسی شور کے ماحول میں غلط سگنل پیدا کرنے کے لئے آسان ہے۔
آئی ڈی ایم کا پتہ لگانے کا دورانیہ 5-7K لائنوں پر ایڈجسٹ کرنے کی سفارش کی گئی ہے ، اور ٹرانزٹ کی تصدیق کی شرائط میں اضافہ کیا گیا ہے۔ موجودہ ورژن کو 15 منٹ کے چارٹ سے نیچے کے ٹائم فریم میں استعمال کرنے کی سفارش نہیں کی گئی ہے ، پیغام رسانی کا تناسب بہت کم ہے۔
اس حکمت عملی میں ایک ہی وقت میں متعدد اعلی وابستگی والی اقسام کی اجازت دی گئی ہے ، جس سے سسٹم کے خطرے کے واقعات میں خطرے کے سوراخ کو کئی گنا بڑھایا جاسکتا ہے۔ 3 K لائنوں کی وابستگی ٹھنڈک کی مدت بالکل ناکافی ہے ، 20-50 K لائنوں میں ایڈجسٹ کرنے کی تجویز ہے۔
زیادہ سے زیادہ واپسی کی اجارہ داری 10٪ کی ترتیب معقول ہے ، لیکن اس میں متحرک ایڈجسٹمنٹ میکانزم کی کمی ہے۔ بیل مارکیٹ میں 15٪ تک مناسب نرمی کی جاسکتی ہے ، اور گائے کی مارکیٹ میں 5-7٪ تک سختی کی جاسکتی ہے۔ موجودہ فکسڈ پیرامیٹر ڈیزائن مختلف مارکیٹ کے حالات کے مطابق نہیں ہوسکتا ہے۔
بہترین استعمال کا ماحول: کریپٹوکرنسی مینڈین کرنسی ((بی ٹی سی / ای ٹی ایچ) ، 1-4 گھنٹے کا ٹائم فریم ، واضح رجحانات کے ساتھ۔ توقع ہے کہ بیل مارکیٹ میں 30-50٪ کی سالانہ واپسی ہوسکتی ہے ، لیکن بیر مارکیٹ میں 15-25٪ کی واپسی کا سامنا کرنا پڑ سکتا ہے۔
اسکرینوں کے لئے موزوں نہیں: ہلچل والی مارکیٹ ، کم اتار چڑھاؤ کا ماحول ، 15 منٹ سے کم اعلی تعدد کا کاروبار۔ روایتی اسٹاک مارکیٹ میں کم اتار چڑھاؤ کی وجہ سے ، سگنل کی تعدد نمایاں طور پر کم ہوجائے گی ، براہ راست پیرامیٹرز کا استعمال کرنے کی سفارش نہیں کی جاتی ہے۔
یاد رکھیں: تاریخی ریٹرننگ مستقبل کی آمدنی کی نمائندگی نہیں کرتی ہے۔ یہ حکمت عملی مارکیٹ کے مختلف حالات میں نمایاں طور پر مختلف ہوتی ہے ، جس میں سخت رسک مینجمنٹ اور بار بار پیرامیٹرز کی اصلاح کی ضرورت ہوتی ہے۔
/*backtest
start: 2024-12-21 00:00:00
end: 2025-12-20 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
//@version=6
strategy("Liquidity Maxing: Institutional Liquidity Matrix", shorttitle="LIQMAX", overlay=true)
// =============================================================================
// 1. TYPE DEFINITIONS
// =============================================================================
type Pivot
float price
int index
bool isHigh
type Structure
float strongHigh
float strongLow
int strongHighIdx
int strongLowIdx
string trend
bool bos
bool choch
bool idm
// =============================================================================
// 2. INPUTS
// =============================================================================
// --- Market Structure ---
grp_struct = "Market Structure"
int pivotLen = input.int(5, "Pivot Length", minval=1, group=grp_struct)
bool useIdm = input.bool(true, "Filter by Inducement (IDM)", group=grp_struct)
// --- Risk Management ---
grp_risk = "Risk Management"
float riskReward = input.float(2.0, "Risk:Reward Ratio", step=0.1, group=grp_risk)
int atrPeriod = input.int(14, "ATR Period", group=grp_risk)
float atrMult = input.float(2.0, "ATR Multiplier (Stop)", step=0.1, group=grp_risk)
float maxDrawdown = input.float(10.0, "Max Drawdown (%)", group=grp_risk)
float riskPerTrade = input.float(1.5, "Risk per Trade (%)", minval=0.1, maxval=10, step=0.1, group=grp_risk)
float dailyRiskLimit = input.float(6.0, "Daily Risk Limit (%)", minval=1.0, step=0.5, group=grp_risk)
float weeklyRiskLimit = input.float(12.0, "Weekly Risk Limit (%)", minval=2.0, step=0.5, group=grp_risk)
float minPositionPercent = input.float(0.25, "Min Position Size (%)", minval=0.1, step=0.05, group=grp_risk)
float maxPositionPercent = input.float(5.0, "Max Position Size (%)", minval=0.5, step=0.5, group=grp_risk)
int correlationBars = input.int(3, "Correlation Cooldown (bars)", minval=0, group=grp_risk)
bool killSwitch = input.bool(false, "Emergency Kill Switch", group=grp_risk)
// --- Confluence Filters ---
grp_filter = "Confluence Filters"
int rsiLen = input.int(14, "RSI Length", group=grp_filter)
float rsiOb = input.float(70.0, "RSI Overbought", group=grp_filter)
float rsiOs = input.float(30.0, "RSI Oversold", group=grp_filter)
int emaLen = input.int(50, "Trend EMA", group=grp_filter)
string htfTf = input.timeframe("D", "HTF Timeframe", group=grp_filter)
float volMult = input.float(1.2, "Volume Multiplier", step=0.1, group=grp_filter)
bool allowWeekends = input.bool(true, "Allow Weekend Trading", group=grp_filter)
int confThreshold = input.int(6, "Min Confluence Score (0-8)", minval=1, maxval=8, group=grp_filter)
// =============================================================================
// 3. HELPER FUNCTIONS
// =============================================================================
calcATRLevels(float price, float atr, float mult, bool isLong) =>
float sl = isLong ? price - (atr * mult) : price + (atr * mult)
float tp = isLong ? price + (atr * mult * riskReward) : price - (atr * mult * riskReward)
[sl, tp]
calcPositionSize(float atr, float price, float minPct, float maxPct, float baseRisk) =>
float scalar = price > 0 and atr > 0 ? atr / price : 0.0
float adjustedRiskPct = scalar > 0 ? baseRisk / (scalar * 10) : baseRisk
float finalRiskPct = math.max(minPct, math.min(maxPct, adjustedRiskPct))
float equity = strategy.equity
float dollarAmount = equity * (finalRiskPct / 100.0)
float qty = price > 0 ? dollarAmount / price : 0.0
qty
isSessionAllowed(bool allowWknd) =>
bool weekend = dayofweek == dayofweek.saturday or dayofweek == dayofweek.sunday
allowWknd ? true : not weekend
// =============================================================================
// 4. STATE VARIABLES
// =============================================================================
var Structure mStruct = Structure.new(na, na, 0, 0, "neutral", false, false, false)
var Pivot lastHigh = Pivot.new(na, na, true)
var Pivot lastLow = Pivot.new(na, na, false)
var float dailyStartEquity = na
var float weeklyStartEquity = na
var float dailyRiskUsed = 0.0
var float weeklyRiskUsed = 0.0
var int lastLongBar = na
var int lastShortBar = na
var float equityPeak = na
// Initialize
if bar_index == 0
dailyStartEquity := strategy.equity
weeklyStartEquity := strategy.equity
equityPeak := strategy.equity
// Reset tracking
if ta.change(time("D")) != 0
dailyStartEquity := strategy.equity
dailyRiskUsed := 0.0
if ta.change(time("W")) != 0
weeklyStartEquity := strategy.equity
weeklyRiskUsed := 0.0
if na(equityPeak) or strategy.equity > equityPeak
equityPeak := strategy.equity
// =============================================================================
// 5. MARKET STRUCTURE DETECTION(1)
// =============================================================================
// Pivot Detection
float ph = ta.pivothigh(high, pivotLen, pivotLen)
float pl = ta.pivotlow(low, pivotLen, pivotLen)
if not na(ph)
lastHigh.price := ph
lastHigh.index := bar_index - pivotLen
if not na(pl)
lastLow.price := pl
lastLow.index := bar_index - pivotLen
// Structure Breaks
bool bullCross = ta.crossover(close, lastHigh.price)
bool bearCross = ta.crossunder(close, lastLow.price)
bool isBullishBreak = not na(lastHigh.price) and bullCross
bool isBearishBreak = not na(lastLow.price) and bearCross
mStruct.bos := false
mStruct.choch := false
// =============================================================================
// 6. MARKET STRUCTURE DETECTION(2)
// =============================================================================
// Bullish Break
if isBullishBreak
if mStruct.trend == "bearish"
mStruct.choch := true
mStruct.trend := "bullish"
else
mStruct.bos := true
mStruct.trend := "bullish"
mStruct.strongLow := lastLow.price
mStruct.strongLowIdx := lastLow.index
// Bearish Break
if isBearishBreak
if mStruct.trend == "bullish"
mStruct.choch := true
mStruct.trend := "bearish"
else
mStruct.bos := true
mStruct.trend := "bearish"
mStruct.strongHigh := lastHigh.price
mStruct.strongHighIdx := lastHigh.index
// IDM (Inducement) Detection
float swingLowPrev = ta.lowest(low, 3)[1]
float swingHighPrev = ta.highest(high, 3)[1]
bool idmBullish = mStruct.trend == "bullish" and not na(swingLowPrev) and low < swingLowPrev and close > swingLowPrev
bool idmBearish = mStruct.trend == "bearish" and not na(swingHighPrev) and high > swingHighPrev and close < swingHighPrev
mStruct.idm := idmBullish or idmBearish
// =============================================================================
// 7. CONFLUENCE ENGINE (8 Factors)
// =============================================================================
// Technical Indicators
float rsi = ta.rsi(close, rsiLen)
float ema = ta.ema(close, emaLen)
[macdLine, sigLine, _] = ta.macd(close, 12, 26, 9)
float volAvg = ta.sma(volume, 20)
float baseAtr = ta.atr(atrPeriod)
float atr = baseAtr
float htfEma = request.security(syminfo.tickerid, htfTf, ta.ema(close, emaLen), gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_off)
bool sessionOk = isSessionAllowed(allowWeekends)
// Confluence Checks (8 Factors)
bool c1_trend = (mStruct.trend == "bullish" and close > ema) or (mStruct.trend == "bearish" and close < ema)
bool c2_rsi = (mStruct.trend == "bullish" and rsi > 40 and rsi < rsiOb) or (mStruct.trend == "bearish" and rsi < 60 and rsi > rsiOs)
bool c3_macd = (mStruct.trend == "bullish" and macdLine > sigLine) or (mStruct.trend == "bearish" and macdLine < sigLine)
bool c4_volume = volume > (volAvg * volMult)
bool c5_htf = (mStruct.trend == "bullish" and close >= htfEma) or (mStruct.trend == "bearish" and close <= htfEma)
bool c6_session = sessionOk
bool c7_volatility = baseAtr > baseAtr[1]
bool c8_structure = mStruct.bos or mStruct.choch
// Calculate Score
int score = (c1_trend ? 1 : 0) + (c2_rsi ? 1 : 0) + (c3_macd ? 1 : 0) + (c4_volume ? 1 : 0) + (c5_htf ? 1 : 0) + (c6_session ? 1 : 0) + (c7_volatility ? 1 : 0) + (c8_structure ? 1 : 0)
// =============================================================================
// 8. RISK MANAGEMENT
// =============================================================================
// Calculate Levels
[longSL, longTP] = calcATRLevels(close, atr, atrMult, true)
[shortSL, shortTP] = calcATRLevels(close, atr, atrMult, false)
// Drawdown Tracking
float globalDD = equityPeak > 0 ? (equityPeak - strategy.equity) / equityPeak * 100 : 0.0
float dailyDD = dailyStartEquity > 0 ? (dailyStartEquity - strategy.equity) / dailyStartEquity * 100 : 0.0
float weeklyDD = weeklyStartEquity > 0 ? (weeklyStartEquity - strategy.equity) / weeklyStartEquity * 100 : 0.0
// Position Sizing
float orderQty = calcPositionSize(atr, close, minPositionPercent, maxPositionPercent, riskPerTrade)
// Risk Checks
bool withinLimits = dailyDD < dailyRiskLimit and weeklyDD < weeklyRiskLimit and globalDD < maxDrawdown
bool safeToTrade = withinLimits and not killSwitch
bool correlationBlockLong = not na(lastLongBar) and (bar_index - lastLongBar) <= correlationBars
bool correlationBlockShort = not na(lastShortBar) and (bar_index - lastShortBar) <= correlationBars
bool dailyLimitOk = (dailyRiskUsed + riskPerTrade) <= dailyRiskLimit
bool weeklyLimitOk = (weeklyRiskUsed + riskPerTrade) <= weeklyRiskLimit
bool riskBudgetOk = dailyLimitOk and weeklyLimitOk
// =============================================================================
// 9. ENTRY SIGNALS
// =============================================================================
// Signal Logic: Trend + (BOS/CHoCH/IDM) + Confluence + HTF
bool signalLong = mStruct.trend == "bullish" and (mStruct.bos or mStruct.choch or (useIdm and idmBullish)) and score >= confThreshold and c5_htf
bool signalShort = mStruct.trend == "bearish" and (mStruct.bos or mStruct.choch or (useIdm and idmBearish)) and score >= confThreshold and c5_htf
// Final Entry Conditions
bool allowLong = signalLong and strategy.position_size == 0 and safeToTrade and not correlationBlockLong and riskBudgetOk and orderQty > 0
bool allowShort = signalShort and strategy.position_size == 0 and safeToTrade and not correlationBlockShort and riskBudgetOk and orderQty > 0
if allowLong
strategy.entry("Long", strategy.long, qty=orderQty, comment="LIQMAX LONG")
strategy.exit("Exit L", "Long", stop=longSL, limit=longTP, comment_loss="SL", comment_profit="TP")
dailyRiskUsed += riskPerTrade
weeklyRiskUsed += riskPerTrade
lastLongBar := bar_index
if allowShort
strategy.entry("Short", strategy.short, qty=orderQty, comment="LIQMAX SHORT")
strategy.exit("Exit S", "Short", stop=shortSL, limit=shortTP, comment_loss="SL", comment_profit="TP")
dailyRiskUsed += riskPerTrade
weeklyRiskUsed += riskPerTrade
lastShortBar := bar_index
// =============================================================================
// 10. VISUALIZATION (Optional - 可选启用)
// =============================================================================
// 绘制市场结构水平线
plot(mStruct.strongHigh, "Strong High", color=color.red, linewidth=1, style=plot.style_linebr)
plot(mStruct.strongLow, "Strong Low", color=color.green, linewidth=1, style=plot.style_linebr)
// 绘制趋势 EMA
plot(ema, "Trend EMA", color=color.new(color.blue, 50), linewidth=2)
// 背景颜色标记风险状态
bgcolor(not safeToTrade ? color.new(color.red, 90) : na, title="Risk Alert")
bgcolor(score >= confThreshold ? color.new(color.green, 95) : na, title="High Confluence")
// 标记入场信号
plotshape(allowLong, "Long Signal", shape.triangleup, location.belowbar, color.green, size=size.small)
plotshape(allowShort, "Short Signal", shape.triangledown, location.abovebar, color.red, size=size.small)