Pine Script (TradingView)
هذا مثال استراتيجية Pine Script على TradingView لمفهوم هذه الصفحة. الصقه في Pine Editor داخل TradingView، اضفه الى الرسم البياني، ثم شغله في Strategy Tester.
//@version=6
strategy("Trend Following Strategy", overlay=true)
adxLen = input.int(14, "ADX Length")
emaLen = input.int(100, "Trend EMA")
adx = ta.adx(adxLen)
ema = ta.ema(close, emaLen)
longSignal = close > ema and adx > 25
exitSignal = close < ema
if longSignal
strategy.entry("Long", strategy.long)
if exitSignal
strategy.close("Long")
plot(ema, "EMA", color=color.orange)