//@version=6
// Bitcoin (BTC) Strategy — 24/7 Crypto
// github.com/trugurpala/pinescriptv6 — Author: Ugur Pala
//
// TR: Semboller: BINANCE:BTCUSDT / COINBASE:BTCUSD / CME:BTC1!
// EN: Symbols: BINANCE:BTCUSDT / COINBASE:BTCUSD / CME:BTC1!
//
// 24/7 işlem — seans filtresi yok
// 24/7 trading — no session filter
strategy("Bitcoin BTC Strategy [trugurpala]",
overlay = true,
initial_capital = 10000,
default_qty_type = strategy.percent_of_equity,
default_qty_value = 5,
commission_type = strategy.commission.percent,
commission_value = 0.1, // Binance Spot taker fee
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 rsiOb = input.float(65, "RSI Long Min", minval=50, maxval=80)
float rsiOs = input.float(35, "RSI Short Max",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(true, "Long Only (crypto bull bias)")
// ── Hesaplamalar ──────────────────────────────────────────────────────────────
float fastEma = ta.ema(close, fastLen)
float slowEma = ta.ema(close, slowLen)
float rsi = ta.rsi(close, rsiLen)
float atrVal = ta.atr(atrLen)
float trendEma = ta.ema(close, 200)
bool bullCross = ta.crossover(fastEma, slowEma) and rsi > rsiOb and close > trendEma
bool bearCross = ta.crossunder(fastEma, slowEma) and rsi < rsiOs and close < trendEma
// ── Entries ──────────────────────────────────────────────────────────────────
if bullCross
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", "Long",
stop=close - slMult*atrVal, limit=close + tpMult*atrVal)
if bearCross and not longOnly
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", "Short",
stop=close + slMult*atrVal, limit=close - tpMult*atrVal)
// ── Visuals ──────────────────────────────────────────────────────────────────
plot(fastEma, "Fast", fastEma > slowEma ? color.green : color.red, linewidth=2)
plot(slowEma, "Slow", fastEma > slowEma ? color.lime : color.orange,linewidth=2)
plot(trendEma, "Trend 200",color.new(color.gray,40), linewidth=1)
plotshape(bullCross, "Long", shape.triangleup, location.belowbar, color.green)
plotshape(bearCross, "Short", shape.triangledown, location.abovebar, color.red)