Translate this Pine Script (Tradingview) indicator to MQL4

Trabalho concluído

Tempo de execução 4 horas
Comentário do cliente
Fast and good
Comentário do desenvolvedor
Everything is fine. Thanks!

Termos de Referência

Hello. Simple job, just translate this Pine Script code to MQL4. It is a 200EMA special indicator, that does not appear in the chart when the market is in a range, filtering bad entries for my trend following Expert Advisor. It does that when the price crosses it a certain number of times in a certain time. The red color means a downtrend and the green an uptrend.


The purpose of the indicator is when not showing on the chart, new entries should not be made. I want to use this indicator on my Expert Advisor. It need to be translated exactly in its essence. 


tudy(title="Trading Rush Moving Average", shorttitle="TR EMA", overlay=true, resolution="")

len = 200

src = close

ema1 = ema(src, len)

maColor = if(close[5] > ema1[5] and close[10] > ema1[10] and close[15] > ema1[15] and close[20] > ema1[20] and close[30] > ema1[30] and close[40] > ema1[40] and close[50] > ema1[50] and close > ema1)


    [URL='http://color.green/']color.green[/URL]

else if(close[5] < ema1[5] and close[10] < ema1[10] and close[15] < ema1[15] and close[20] < ema1[20] and close[30] < ema1[30] and close[40] < ema1[40] and close[50] < ema1[50] and close < ema1)


    [URL='http://color.red/']color.red[/URL]

else


    [URL='https://color.new/']color.new[/URL](color.white, 100)

plot(ema1, title="TR EMA", color=maColor, linewidth=4)


Arquivos anexados:

Respondido

1
Desenvolvedor 1
Classificação
(230)
Projetos
431
27%
Arbitragem
123
21% / 55%
Expirado
96
22%
Trabalhando
2
Desenvolvedor 2
Classificação
(782)
Projetos
1346
72%
Arbitragem
109
28% / 49%
Expirado
340
25%
Ocupado
3
Desenvolvedor 3
Classificação
(555)
Projetos
922
48%
Arbitragem
300
59% / 25%
Expirado
123
13%
Trabalhando
4
Desenvolvedor 4
Classificação
(249)
Projetos
398
38%
Arbitragem
82
41% / 20%
Expirado
69
17%
Carregado

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD