BTC $64,776.00 ▲ 0.04% ETH $1,908.48 ▼ 0.37% USDT $0.9994 ▲ 0.01% BNB $592.23 ▼ 0.08% XRP $1.02 ▼ 2.95% SOL $73.51 ▲ 0.06% DOGE $0.0696 ▲ 0.41% SHIB $0.00000458 ▼ 2.05% PEPE $0.00000281 ▼ 0.14% BTC $64,776.00 ▲ 0.04% ETH $1,908.48 ▼ 0.37% USDT $0.9994 ▲ 0.01% BNB $592.23 ▼ 0.08% XRP $1.02 ▼ 2.95% SOL $73.51 ▲ 0.06% DOGE $0.0696 ▲ 0.41% SHIB $0.00000458 ▼ 2.05% PEPE $0.00000281 ▼ 0.14%
İçerik Alanı728x90
Piyasa

PDIM

PDIM

Bitcoin / TetherUS BINANCE:BTCUSDT

//==============================
// PDIM SMART TRADER PRO
// PART 2A - MARKET STRUCTURE
// BOS + CHoCH
//==============================

// Pivot Length
pivotLen = input.int(5, "Swing Length", minval = 2)

// Swing Detection
pivotHigh = ta.pivothigh(high, pivotLen, pivotLen)
pivotLow = ta.pivotlow(low, pivotLen, pivotLen)

// Store previous swing levels
var float lastHigh = na
var float lastLow = na

if not na(pivotHigh)
lastHigh := pivotHigh

if not na(pivotLow)
lastLow := pivotLow

// Break of Structure
bullBOS = not na(lastHigh) and ta.crossover(close, lastHigh)
bearBOS = not na(lastLow) and ta.crossunder(close, lastLow)

// Change of Character
bullCHoCH = bearTrend and bullBOS
bearCHoCH = bullTrend and bearBOS

// Labels
if bullBOS
label.new(bar_index, high,
"BOS",
style = label.style_label_up,
color = color.green,
textcolor = color.white)

if bearBOS
label.new(bar_index, low,
"BOS",
style = label.style_label_down,
color = color.red,
textcolor = color.white)

if bullCHoCH
label.new(bar_index, high,
"CHoCH",
style = label.style_label_up,
color = color.blue,
textcolor = color.white)

if bearCHoCH
label.new(bar_index, low,
"CHoCH",
style = label.style_label_down,
color = color.orange,
textcolor = color.white)

// Updated Buy/Sell Logic
buySignal :=
bullTrend and
bullBOS and
rsi > rsiBull

sellSignal :=
bearTrend and
bearBOS and
rsi < rsiBearish

İlgili Haberler

Yorumlar (0)

Yorum yapmak için giriş yapın.

Henüz yorum yapılmamış. İlk yorumu siz yapın.

İçerik Alanı728x90