I want to create a MQL5 from a pine using ta super stratgy i tested in Tradeview test it show it working and use it for nasdaq 100

MQL5 Esperti Consulenza

Specifiche

//@version=5
strategy("Supertrend Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=15)

// Input parameters
atrPeriod = input(10, "ATR Length")
factor = input.float(3.0, "Factor", step=0.01)
trailATR = input.int(1, "ATR Trail", minval=1)

// Calculate Supertrend
[_, trendUp] = ta.supertrend(factor, atrPeriod)

// Entry conditions
longEntry = ta.change(trendUp) < 0
shortEntry = ta.change(trendUp) > 0

// Exit conditions (trail stop with ATR)
longExit = strategy.position_size > 0 and close < nz(strategy.position_avg_price) - trailATR * ta.atr(atrPeriod)
shortExit = strategy.position_size < 0 and close > nz(strategy.position_avg_price) + trailATR * ta.atr(atrPeriod)

// Manage positions
strategy.entry("Long", strategy.long, when=longEntry)
strategy.entry("Short", strategy.short, when=shortEntry)

strategy.close("Long", when=longExit)
strategy.close("Short", when=shortExit)

// Plot equity curve
plot(strategy.equity, title="Equity", color=color.blue, linewidth=2, style=plot.style_line)


Con risposta

1
Sviluppatore 1
Valutazioni
(273)
Progetti
401
27%
Arbitraggio
40
40% / 50%
In ritardo
1
0%
Gratuito
2
Sviluppatore 2
Valutazioni
(574)
Progetti
945
47%
Arbitraggio
309
58% / 27%
In ritardo
125
13%
Gratuito
3
Sviluppatore 3
Valutazioni
(9)
Progetti
8
50%
Arbitraggio
6
17% / 50%
In ritardo
2
25%
Gratuito
4
Sviluppatore 4
Valutazioni
(39)
Progetti
65
34%
Arbitraggio
4
25% / 50%
In ritardo
9
14%
In elaborazione

Informazioni sul progetto

Budget
30+ USD