SelScriptFonksiyonlar
strategy.entry
Çalışma ayarlarıyla sonraki mum açılışına long/short giriş emri verir.
Çalışma ayarlarıyla sonraki mum açılışına long/short giriş emri verir.
| Parametre | Tür | Varsayılan |
|---|---|---|
id | string | Zorunlu |
direction | string | Zorunlu |
Dönüş: void. Koşul içinde çağrılabilir.
//@selscript=1
strategy("EMA Simulation", overlay=true)
fast = ta.ema(close, 12)
slow = ta.ema(close, 26)
buy = ta.crossover(fast, slow)
sell = ta.crossunder(fast, slow)
plot.fill(fast, slow, color=fast >= slow ? "#22c55e40" : "#ef444440")
if buy:
strategy.entry("L", strategy.long)
if sell:
strategy.close("L")
if strategy.position_size > 0:
strategy.exit("Protection", "L", stop=strategy.position_avg_price * 0.97, limit=strategy.position_avg_price * 1.06)