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 エキスパート 相談

指定

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


応答済み

1
開発者 1
評価
(152)
プロジェクト
212
22%
仲裁
14
57% / 21%
期限切れ
1
0%
多忙
2
開発者 2
評価
(563)
プロジェクト
931
47%
仲裁
301
59% / 25%
期限切れ
123
13%
仕事中
3
開発者 3
評価
(7)
プロジェクト
5
20%
仲裁
3
0% / 33%
期限切れ
1
20%
仕事中
4
開発者 4
評価
(35)
プロジェクト
56
34%
仲裁
4
25% / 50%
期限切れ
6
11%
取り込み中

プロジェクト情報

予算
30+ USD

依頼者

出された注文1
裁定取引数0