OPEN-SOURCE SCRIPT

Optimized Order Flow Strategy

//version=5
indicator("Optimized Order Flow Strategy", overlay=true)

// تنظیمات ورودی
lookback = input(5, title="Lookback Period for Highs/Lows")
fvgLength = input(20, title="FVG Zone Length")
showOrderBlocks = input(true, title="Show Order Blocks")
showFVG = input(true, title="Show FVG Zones")

// شناسایی بالاترین و پایین‌ترین قیمت
highs = high >= ta.highest(high, lookback) ? high : na
lows = low <= ta.lowest(low, lookback) ? low : na

// شناسایی اوردر بلاک‌ها
orderBlockLow = ta.valuewhen(lows, low, 0)
orderBlockHigh = ta.valuewhen(highs, high, 0)
validOrderBlockLow = not na(orderBlockLow)
validOrderBlockHigh = not na(orderBlockHigh)

// فیلتر حجم
volumeFilter = volume > ta.sma(volume, 10)

// سیگنال خرید و فروش
buySignal = validOrderBlockLow and close < orderBlockLow and ta.crossover(close, orderBlockLow) and volumeFilter
sellSignal = validOrderBlockHigh and close > orderBlockHigh and ta.crossunder(close, orderBlockHigh) and volumeFilter

// نمایش سیگنال‌ها
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")

// هشدارها
alertcondition(buySignal, title="Buy Alert", message="Buy Signal Detected!")
alertcondition(sellSignal, title="Sell Alert", message="Sell Signal Detected!")
Cycles

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明