Preciso automatizar minha estrategia - I need to automate my media strategy

İş Gereklilikleri

Codigo encontra-se em Pine v5, mas quero trazer um EA para o meta trader 5 

segue codigo:

//@version=5
strategy("Estratégia de Médias Móveis", overlay = true)

// Períodos das médias móveis definidos nas configurações
ma_periodo = input(24, title = "Período das Médias Móveis")
filtro_periodo = input(500, title = "Período do Filtro de Tendência")

// Opção para habilitar/desabilitar o filtro de entrada
habilitar_filtro = input(true, title = "Habilitar Filtro de Entrada")

// Horário de início e fim da sessão de Londres
hora_inicio_londres = input.int(8, title = "Hora de Início (Londres)")
hora_fim_londres = input.int(16, title = "Hora de Fim (Londres)")

// Horário de início e fim da sessão de Nova York
hora_inicio_ny = input.int(13, title = "Hora de Início (Nova York)")
hora_fim_ny = input.int(21, title = "Hora de Fim (Nova York)")

// Médias de 24 períodos
ma_minimas = ta.sma(low, ma_periodo)
ma_maximas = ta.sma(high, ma_periodo)

// Média de 500 períodos (filtro de tendência)
ma_500 = ta.sma(close, filtro_periodo)

// Verifica se o horário atual está dentro da sessão de Londres ou Nova York
dentro_sessao_londres = time >= timestamp(year, month, dayofmonth, hora_inicio_londres) and time <= timestamp(year, month, dayofmonth, hora_fim_londres)
dentro_sessao_ny = time >= timestamp(year, month, dayofmonth, hora_inicio_ny) and time <= timestamp(year, month, dayofmonth, hora_fim_ny)

// Condições de entrada de compra
condicao_compra = close > ma_maximas and close > ma_minimas and close[1] < ma_maximas and close[1] < ma_minimas and (not habilitar_filtro or (close > ma_500 and (dentro_sessao_londres or dentro_sessao_ny)))

// Condições de entrada de venda
condicao_venda = close < ma_maximas and close < ma_minimas and close[1] > ma_maximas and close[1] > ma_minimas and (not habilitar_filtro or (close < ma_500 and (dentro_sessao_londres or dentro_sessao_ny)))

// Condições para fechar trades
fechar_compra = close < ma_maximas and close < ma_minimas
fechar_venda = close > ma_maximas and close > ma_minimas

// Plotar entradas e saídas no gráfico
plotshape(condicao_compra, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(condicao_venda, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)

if (condicao_compra)
    strategy.entry("Compra", strategy.long)

if (condicao_venda)
    strategy.entry("Venda", strategy.short)

// Fechar trades de compra
if (fechar_compra)
    strategy.close("Compra")

// Fechar trades de venda
if (fechar_venda)
    strategy.close("Venda")

plot(ma_minimas, title = "Média de Mínimas", color = color.blue)
plot(ma_maximas, title = "Média de Máximas", color = color.red)
plot(ma_500, title = "Média de 500 períodos", color = color.green)


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(11)
Projeler
17
59%
Arabuluculuk
2
0% / 100%
Süresi dolmuş
2
12%
Serbest
2
Geliştirici 2
Derecelendirme
(539)
Projeler
618
33%
Arabuluculuk
35
37% / 49%
Süresi dolmuş
10
2%
Meşgul
3
Geliştirici 3
Derecelendirme
(48)
Projeler
49
8%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(1)
Projeler
1
100%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Çalışıyor
5
Geliştirici 5
Derecelendirme
(250)
Projeler
460
26%
Arabuluculuk
140
20% / 59%
Süresi dolmuş
100
22%
Çalışıyor
6
Geliştirici 6
Derecelendirme
(6)
Projeler
10
0%
Arabuluculuk
0
Süresi dolmuş
2
20%
Çalışıyor
7
Geliştirici 7
Derecelendirme
(294)
Projeler
469
39%
Arabuluculuk
101
41% / 24%
Süresi dolmuş
77
16%
Yüklendi
Yayınlandı: 2 kod
8
Geliştirici 8
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest

Proje bilgisi

Bütçe
30 - 70 USD
Son teslim tarihi
to 10 gün