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

Tarea técnica

//@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)


Han respondido

1
Desarrollador 1
Evaluación
(158)
Proyectos
226
22%
Arbitraje
15
60% / 20%
Caducado
1
0%
Trabajando
2
Desarrollador 2
Evaluación
(563)
Proyectos
932
47%
Arbitraje
302
59% / 25%
Caducado
124
13%
Ocupado
3
Desarrollador 3
Evaluación
(7)
Proyectos
5
20%
Arbitraje
3
0% / 33%
Caducado
1
20%
Trabaja
4
Desarrollador 4
Evaluación
(36)
Proyectos
59
34%
Arbitraje
4
25% / 50%
Caducado
6
10%
Trabajando

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD