OPEN-SOURCE SCRIPT

Advanced Buy/Sell Signals with Sessions 2025 Kravchenko

Güncellendi
Наданий вами скрипт — це торгова стратегія, реалізована в Pine Script, яка використовується для створення сигналів купівлі та продажу на основі комбінації різних технічних індикаторів. Ось розбивка компонентів: ### Ключові компоненти: 1. **RSI (індекс відносної сили)**: використовується для визначення умов перекупленості або перепроданості на ринку. - **Умова**: стратегія шукає RSI нижче 30 (перепроданість) для сигналів купівлі та RSI вище 70 (перекупленість) для сигналів продажу. 2.

Sürüm Notları
//version=5
indicator("Advanced Buy/Sell Signals with Sessions", overlay=true)

// Input parameters
lengthRSI = input.int(14, title="RSI Length")
lengthBB = input.int(20, title="Bollinger Bands Length")
multBB = input.float(2.0, title="Bollinger Bands Multiplier")
volMultiplier = input.float(1.5, title="Volume Multiplier")
lengthEMA = input.int(50, title="EMA Length")
lengthEMA72 = input.int(72, title="EMA 72 Length")
lengthEMA89 = input.int(89, title="EMA 89 Length")
lengthATR = input.int(14, title="ATR Length")
upperTF = input.timeframe("D", title="Higher Timeframe")
sensitivity = input.float(1.0, title="Signal Sensitivity (Higher = Stricter)", minval=0.5, maxval=2.0)
arrowSize = input.string("Normal", title="Arrow Size", options=["Small", "Normal", "Large"])

// Calculate RSI
rsi = ta.rsi(close, lengthRSI)

// Calculate Bollinger Bands
basis = ta.sma(close, lengthBB)
upperBB = basis + multBB * ta.stdev(close, lengthBB)
lowerBB = basis - multBB * ta.stdev(close, lengthBB)

// Calculate volume threshold
volAvg = ta.sma(volume, lengthBB)
volHigh = volAvg * volMultiplier

// Calculate EMA and ATR
ema = ta.ema(close, lengthEMA)
ema72 = ta.ema(close, lengthEMA72)
ema89 = ta.ema(close, lengthEMA89)
atr = ta.atr(lengthATR)

// Higher timeframe EMA
htfEma = request.security(syminfo.tickerid, upperTF, ta.ema(close, lengthEMA))

// Smart Money Concepts: Order Blocks
isBullishOrderBlock = (high == ta.highest(high, lengthBB)) and close > open
isBearishOrderBlock = (low == ta.lowest(low, lengthBB)) and close < open

bullishOrderBlockLevel = ta.valuewhen(isBullishOrderBlock, close, 0)
bearishOrderBlockLevel = ta.valuewhen(isBearishOrderBlock, close, 0)
orderBlockLevel = isBearishOrderBlock ? bearishOrderBlockLevel : bullishOrderBlockLevel

// Session filters
var bool inSession = na
inSession := time("0200-1000:1234567") or time("0800-1000:1234567") or time("1000-1500:1234567") or time("1430-2300:1234567")

// Additional Filters: MACD
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)

// Entry conditions with all filters and sensitivity adjustments
longCondition = (rsi < 30 * sensitivity and close < lowerBB and volume > volHigh and close > ema and close > htfEma and close > ema72 and close > ema89 and macdLine > signalLine and inSession and close > orderBlockLevel)
shortCondition = (rsi > 70 / sensitivity and close > upperBB and volume > volHigh and close < ema and close < htfEma and close < ema72 and close < ema89 and macdLine < signalLine and inSession and close < orderBlockLevel)

// Map arrow size
arrowSizeMap = arrowSize == "Small" ? size.small : arrowSize == "Normal" ? size.normal : size.large

// Plot entry signals
if (longCondition)
label.new(bar_index, low, "▲", style=label.style_label_up, color=color.green, textcolor=color.white, size=arrowSizeMap)
if (shortCondition)
label.new(bar_index, high, "▼", style=label.style_label_down, color=color.red, textcolor=color.white, size=arrowSizeMap)
Breadth IndicatorsCentered OscillatorsMoving Averages

Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının yazarı komut dosyasını açık kaynak olarak yayınlamıştır, böylece yatırımcılar betiği anlayabilir ve doğrulayabilir. Yazar çok yaşa! Ücretsiz olarak kullanabilirsiniz, ancak bu kodun yayında yeniden kullanımı Ev kurallarına tabidir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?

Feragatname