Convert my tradingview indicator to xm mt4 (mq4)

MQL4 Conversão

Trabalho concluído

Tempo de execução 5 dias

Termos de Referência

I would like to convert my tradingview indicator to the xm metatrader 4 (remembering that there is this mt4 from xm that has some details).

I tried the conversion via AI but it was not possible, since the indicator is not similar and useful as it was in tradingview.


//@version=5

indicator(title="JR INDEX", shorttitle="JR INDEX", overlay=false)


// Input

fastLength = input.int(12, title="Fast Length", minval=1)

slowLength = input.int(26, title="Slow Length", minval=1)

src = input(close, title="Source")

cciLength = input.int(14, title="CCI Length", minval=1)

overSold = input.int(-100, title="Over Sold")

overBought = input.int(100, title="Over Bought")


// Calculation

fastMA = ta.ema(src, fastLength)

slowMA = ta.ema(src, slowLength)

macdLine = fastMA - slowMA

signalLine = ta.ema(macdLine, 9)

macdHistogram = macdLine - signalLine

cci = ta.cci(src, cciLength)


// Plotting

plot(macdHistogram, title="MACD", color=macdHistogram > 0 ? color.green : color.red, style=plot.style_columns, transp=0)

plot(cci, title="CCI", color=color.purple)

plot(overSold, title="Over Sold", color=color.green, transp=0)

plot(overBought, title="Over Bought", color=color.red, transp=0)


// Entry and Exit conditions

longCondition = ta.cross(macdHistogram, 0) and cci > overSold

shortCondition = ta.cross(0, macdHistogram) and cci < overBought

bgcolor(longCondition ? color.green : shortCondition ? color.red : na, transp=70)


Respondido

1
Desenvolvedor 1
Classificação
(337)
Projetos
624
38%
Arbitragem
40
23% / 65%
Expirado
93
15%
Livre
Publicou: 4 artigos, 19 códigos
2
Desenvolvedor 2
Classificação
(268)
Projetos
603
34%
Arbitragem
65
22% / 57%
Expirado
147
24%
Trabalhando
Publicou: 1 artigo, 22 códigos
3
Desenvolvedor 3
Classificação
(132)
Projetos
178
39%
Arbitragem
4
25% / 50%
Expirado
14
8%
Livre
4
Desenvolvedor 4
Classificação
(574)
Projetos
945
47%
Arbitragem
309
58% / 27%
Expirado
125
13%
Livre
5
Desenvolvedor 5
Classificação
(171)
Projetos
195
42%
Arbitragem
13
8% / 54%
Expirado
9
5%
Livre
Publicou: 3 códigos
6
Desenvolvedor 6
Classificação
(2)
Projetos
2
0%
Arbitragem
1
0% / 0%
Expirado
2
100%
Livre

Informações sobre o projeto

Orçamento
50+ USD
Prazo
para 2 dias