Strategy · Pine Script v6 · On the chart

VİOP BIST30 Alert Strategy [trugurpala]

by trugurpala

This strategy generates trading signals using a dual exponential moving average cross confirmed by the Relative Strength Index.

View on GitHub

GitHub stars4on the repository
Pine versionv6current
Lines of code69
Settings9inputs
LicenceMIT
Last update2 months ago3 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

69 lines of Pine Script v6 from webhook-templates/06_viop_bist30_alerts.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

06_viop_bist30_alerts.pine
//@version=6
// VİOP / BIST30 Alert Strategy — Webhook Ready
// github.com/trugurpala/pinescriptv6 — Author: Ugur Pala
//
// TR: Bu strateji VİOP F_XU030 futures için optimize edilmiştir.
//     TradingView Alert kurulumu için webhook-templates/05_json_payload_templates.md
// EN: Optimized for VIOP F_XU030 futures.
//     For webhook alert setup see webhook-templates/05_json_payload_templates.md
strategy("VİOP BIST30 Alert Strategy [trugurpala]",
    overlay           = true,
    initial_capital   = 10000,
    default_qty_type  = strategy.percent_of_equity,
    default_qty_value = 10,
    commission_type   = strategy.commission.percent,
    commission_value  = 0.03,   // VİOP komisyon oranı
    slippage          = 2)

// ── Inputs ───────────────────────────────────────────────────────────────────
int   fastLen  = input.int(9,    "Fast EMA",    minval=1)
int   slowLen  = input.int(21,   "Slow EMA",    minval=1)
int   rsiLen   = input.int(14,   "RSI",         minval=1)
float rsiMin   = input.float(55, "RSI Min Long", minval=50, maxval=80)
float rsiMax   = input.float(45, "RSI Max Short",minval=20, maxval=50)
int   atrLen   = input.int(14,   "ATR",         minval=1)
float slMult   = input.float(2.0, "SL Mult",    step=0.1)
float tpMult   = input.float(3.0, "TP Mult",    step=0.1)
bool  longOnly = input.bool(false, "Sadece Long / Long Only")

// ── Session Filtresi — VİOP saatleri 09:30-18:15 ─────────────────────────────
bool inSession = not na(time(timeframe.period, "0930-1815", "UTC+3"))

// ── Calculations ─────────────────────────────────────────────────────────────
float fastEma = ta.ema(close, fastLen)
float slowEma = ta.ema(close, slowLen)
float rsi     = ta.rsi(close, rsiLen)
float atrVal  = ta.atr(atrLen)

bool bullCross = ta.crossover(fastEma, slowEma)  and rsi > rsiMin and inSession
bool bearCross = ta.crossunder(fastEma, slowEma) and rsi < rsiMax and inSession

// ── Entries ──────────────────────────────────────────────────────────────────
if bullCross
    strategy.entry("Long", strategy.long)
    strategy.exit("Long Exit", "Long",
        stop  = close - slMult * atrVal,
        limit = close + tpMult * atrVal)
    // Alert mesajı (TradingView Alert → Message kutusuna yapıştır):
    // {"market":"VIOP","symbol":"F_XU030","action":"buy","price":{{close}},"lot":{{strategy.order.contracts}},"time":"{{timenow}}"}

if bearCross and not longOnly
    strategy.entry("Short", strategy.short)
    strategy.exit("Short Exit", "Short",
        stop  = close + slMult * atrVal,
        limit = close - tpMult * atrVal)
    // Alert mesajı:
    // {"market":"VIOP","symbol":"F_XU030","action":"sell","price":{{close}},"lot":{{strategy.order.contracts}},"time":"{{timenow}}"}

// ── Alerts (alert() — strategy içinde çalışır, alertcondition() değil) ───────
if bullCross
    alert("🟢 VIOP LONG | " + syminfo.ticker + " | " + str.tostring(close, "#.##") + " | " + str.tostring(time), alert.freq_once_per_bar)
if bearCross
    alert("🔴 VIOP SHORT | " + syminfo.ticker + " | " + str.tostring(close, "#.##") + " | " + str.tostring(time), alert.freq_once_per_bar)

// ── Visuals ──────────────────────────────────────────────────────────────────
bgcolor(inSession ? na : color.new(color.gray, 95), title="Session")
plot(fastEma, "Fast", fastEma > slowEma ? color.green : color.red,    linewidth=2)
plot(slowEma, "Slow", fastEma > slowEma ? color.lime  : color.orange, linewidth=2)
plotshape(bullCross, "Long",  shape.triangleup,   location.belowbar, color.green, size=size.normal)
plotshape(bearCross, "Short", shape.triangledown, location.abovebar, color.red,   size=size.normal)

Overview

VİOP BIST30 Alert Strategy [trugurpala] restricts entries to specific market session hours (09:30-18:15 UTC+3) designed for Turkish VIOP index futures. Long positions enter on bullish EMA crossovers with RSI above a threshold, while short positions enter on bearish crossunders with RSI below a threshold. Exits rely on Average True Range multipliers for take-profit and stop-loss targets, with options to restrict trading to long-only mode. It overlays directly on the price chart.

Details

Published by

trugurpala on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Oscillators & momentum, Moving averages, Sessions & time

Markets

Indices

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

aialgorithmic-tradingclaude-codecodexcoding-agentsgithub-copilotopen-sourcepine-scriptpine-script-v6technical-analysis

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast EMAint9fastLen
Slow EMAint21slowLen
RSIint14rsiLen
RSI Min Longfloat55rsiMin
RSI Max Shortfloat45rsiMax
ATRint14atrLen
SL Multfloat2.0slMult
TP Multfloat3.0tpMult
Sadece Long / Long OnlyboolfalselongOnly
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

106 stars

This intraday strategy enters positions based on an alignment of trend, momentum, and oscillator indicators. It triggers long entries when the Commodity Channel Index is above a positive threshold, a fast Relative Strength Index crosses above a slow RSI, price

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of CCI + EMA with RSI Cross Strategy

Session Wicks

by g-moe
3 stars

This strategy calculates smoothed Heikin-Ashi candles alongside a moving average of the Relative Strength Index to enter trend reversals. It triggers long entries when smoothed Heikin-Ashi turns bullish while RSI trades above its moving average, and short entr

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Session Wicks
1 stars

This session-based strategy triggers long entries at the start of the New York trading session when trend and momentum conditions align. It calculates a 38-period Exponential Moving Average and a 14-period RSI. A long position is taken at session open if the c

Strategy v6 Sessions & timeTrend
Updated 5 days ago · Apache-2.0 GitHub repository of PineForge — Borough New York Session
1 stars

This intraday trading strategy combines fast, slow, and trend exponential moving averages with MACD, RSI, and ADX filters to generate trade signals during active trading sessions. It enters long positions when the fast EMA crosses above the slow EMA above the

Strategy v6 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Señales Intradía EMA + MACD v3
330 stars

2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers