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精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明