Converter estrategia do tradingView para metatrader

MQL5 Converting

Specification

Olá, vi esse código no tradingView e gostaria de converter para o metatrader

Esse código eh baseado no cruzamento de medias moveis, porem o a referencia delas eh outro tempo gráfico.

exemplo, to no grafico de 1m, mas nele ta plotado a media de 5 periodos referente ao timeframe de 30m

Espero que tenha conseguido ser claro

ema5=ema(close, 5)
ema2=ema(close, 2)
 
demaFast =  security(tickerid, "30", 2 * ema5 - ema(ema5, 5)  )

plotchar((2 * ema5 - ema(ema5, 5)), "d", "", location = location.top)
plotchar(demaFast, "fast", "", location = location.top)

demaSlow  = security(tickerid,"30", 2 * ema2 - ema(ema2, 2)  )
plotchar(demaSlow, "slow", "", location = location.top)

buy = crossover(demaSlow, demaFast)
sell = crossunder(demaSlow, demaFast)
strategy.entry("BUY", strategy.long, 1, when = buy)
strategy.entry("SELL", strategy.short, 1, when = sell )


atte Lucas Andrey

Responded

1
Developer 1
Rating
(83)
Projects
143
52%
Arbitration
8
13% / 75%
Overdue
22
15%
Free
2
Developer 2
Rating
(24)
Projects
34
9%
Arbitration
3
33% / 0%
Overdue
8
24%
Free
3
Developer 3
Rating
(11)
Projects
17
59%
Arbitration
2
0% / 100%
Overdue
2
12%
Free
5
Developer 5
Rating
(574)
Projects
945
47%
Arbitration
309
58% / 27%
Overdue
125
13%
Free
6
Developer 6
Rating
(296)
Projects
475
40%
Arbitration
105
40% / 24%
Overdue
80
17%
Busy
Published: 2 codes

Project information

Budget
50+ USD