HM2 - 5 Math Pillars Strategy by tiddug_singh

By version

Performance Metrics

Description

# 🏛️ HM2 - Pro Math Pillars Strategy & DocumentationThis document contains the complete technical logic, user manual, and the TradingView Pine Script v5 code for the **HM2 - 5 Math Pillars Strategy**.---## 📖 User Manual: The 5 Pillars of Market PhysicsThis system operates on the laws of market physics, using fractal geometry and information theory to identify high-probability "Kill Zones."### 1. Hurst Exponent ($H$)**The Regime Filter.** * **Logic:** $H > 0.53$ indicates a trending market (persistence). $H s = ta.stdev(close, len) p = s / ta.sma(s, len * 2) e = -p * math.log(math.max(p, 1e-9)) math.min(math.abs(e), 1.0)ent_val = calc_ent(e_len)e_limit = input.float(0.85, "Chaos Threshold", group="Regime")// ==========================================// 3. EHLERS FISHER (Momentum & Exhaustion)// ==========================================f_len = input.int(10, "Fisher Period", group="Execution")f_hh = ta.highest(high, f_len), f_ll = ta.lowest(low, f_len)var float loc_v = 0.0raw_v = ((close - f_ll) / math.max(f_hh - f_ll, 0.001)) - 0.5loc_v := 0.66 * raw_v + 0.67 * nz(loc_v[1])loc_v := math.max(math.min(loc_v, 0.99), -0.99)fisher = 0.5 * math.log((1 + loc_v) / (1 - loc_v)) + 0.5 * nz(loc_v[1])// ==========================================// 4. GANN & VORTEX CONFLUENCE// ==========================================g_root = math.sqrt(close)g_90_up = math.pow(g_root + 0.5, 2)g_90_dn = math.pow(math.max(0, g_root - 0.5), 2)g_180_up = math.pow(g_root + 1.0, 2)g_180_dn = math.pow(math.max(0, g_root - 1.0), 2)v_hi = ta.valuewhen(ta.pivothigh(high, 5, 5), high, 0)v_lo = ta.valuewhen(ta.pivotlow(low, 5, 5), low, 0)fib_v = v_hi - (v_hi - v_lo) * 0.618// Kill Zone Check: Is price near a structural level?near_level = math.abs(close - g_90_up) / close 0.53 or near_level)short_sig = ent_val 0.53 or near_level)if long_sig and strategy.position_size == 0 strategy.entry("Pro L", strategy.long) t_stop := math.pow(math.sqrt(close) - 0.35, 2) t_target := g_180_up break_even_hit := falseif short_sig and strategy.position_size == 0 strategy.entry("Pro S", strategy.short) t_stop := math.pow(math.sqrt(close) + 0.35, 2) t_target := g_180_dn break_even_hit := false// Break-Even Logic at 90 Degreesif strategy.position_size > 0 if high >= g_90_up break_even_hit := true current_stop = break_even_hit ? strategy.position_avg_price : t_stop if low = t_target strategy.close("Pro L", comment="Gann 180")if strategy.position_size = current_stop or ta.crossover(fisher, -2.5) strategy.close("Pro S", comment=high >= current_stop ? "SL" : "Exhaust") if low <= t_target strategy.close("Pro S", comment="Gann 180")// Visualsplot(strategy.position_size != 0 ? t_target : na, "Target", color=#00FF00, style=plot.style_linebr)plot(strategy.position_size != 0 ? (break_even_hit ? strategy.position_avg_price : t_stop) : na, "Stop", color=#FF0000, style=plot.style_linebr)bgcolor(ent_val < e_limit ? color.new(#0000FF, 95) : color.new(#FF0000, 95))

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView