Revisar e ajustar um Indicador MT5

İş tamamlandı

Tamamlanma süresi: 23 saat

Şartname

Eu criei um indicador pelo ChatGPT e ele está compilando corretamente mas as linhas que são plotadas na janela separada do indicador MT5 não estão sendo atualizadas corretamente, elas aparecem como linhas retas horizontais e não tem nenhuma variação, e eu não sei programar e não sei como ajustar isso e o chatGPT também não conseguiu resolver.

O código é bem pequeno e básico, acredito ser simples de resolver para quem sabe programar.


Segue o código gerado pelo chatGPT:


//+------------------------------------------------------------------+

//| Custom indicator for MetaTrader 5                                |

//+------------------------------------------------------------------+

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_plots   3

#property indicator_type1   DRAW_LINE

#property indicator_type2   DRAW_LINE

#property indicator_type3   DRAW_LINE

#property indicator_color1  DeepSkyBlue  // Amplitude

#property indicator_color2  Red          // Média da Amplitude

#property indicator_color3  Green        // Linha Limite


//--- input parameters

input int PeriodoAmplitude = 30;

input int PeriodoMediaAmplitude = 17;

input double LinhaLimite = 20.0;


//--- indicator buffers

double amplitudeBuffer[];

double mediaAmplitudeBuffer[];

double linhaLimiteBuffer[];


//+------------------------------------------------------------------+

//| Indicator initialization function                                |

//+------------------------------------------------------------------+

int OnInit()

{

    SetIndexBuffer(0, amplitudeBuffer);

    SetIndexBuffer(1, mediaAmplitudeBuffer);

    SetIndexBuffer(2, linhaLimiteBuffer);


    ArraySetAsSeries(amplitudeBuffer, true);

    ArraySetAsSeries(mediaAmplitudeBuffer, true);

    ArraySetAsSeries(linhaLimiteBuffer, true);


    PlotIndexSetString(0, PLOT_LABEL, "Amplitude");

    PlotIndexSetString(1, PLOT_LABEL, "Média da Amplitude");

    PlotIndexSetString(2, PLOT_LABEL, "Linha Limite");


    IndicatorSetString(INDICATOR_SHORTNAME, "Indicador Customizado de Amplitude");

    return INIT_SUCCEEDED;

}


//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const double &high[],

                const double &low[],

                const double &close[],

                const long &tick_volume[],

                const long &volume[],

                const int &spread[])

{

    int required = MathMax(PeriodoAmplitude, PeriodoMediaAmplitude);

    if (rates_total < required)

        return 0;


    for (int i = prev_calculated > required ? prev_calculated : required; i < rates_total; i++)

    {

        amplitudeBuffer[i] = high[iHighest(NULL, 0, MODE_HIGH, PeriodoAmplitude, i)] - low[iLowest(NULL, 0, MODE_LOW, PeriodoAmplitude, i)];

        mediaAmplitudeBuffer[i] = iMA(NULL, 0, PeriodoMediaAmplitude, 0, MODE_SMA, PRICE_CLOSE);

        linhaLimiteBuffer[i] = LinhaLimite;


        // Debugging information

        Print("Bar ", i, ": Amplitude = ", amplitudeBuffer[i], ", Media = ", mediaAmplitudeBuffer[i], ", LinhaLimite = ", linhaLimiteBuffer[i]);

    }


    return rates_total;

}



---------------------------------------------------------------------




Ele deveria ficar como na imagem anexo...




Yanıtlandı

1
Geliştirici 1
Derecelendirme
(23)
Projeler
29
14%
Arabuluculuk
3
0% / 67%
Süresi dolmuş
3
10%
Çalışıyor
2
Geliştirici 2
Derecelendirme
(35)
Projeler
60
22%
Arabuluculuk
4
25% / 25%
Süresi dolmuş
15
25%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(851)
Projeler
1458
72%
Arabuluculuk
122
29% / 48%
Süresi dolmuş
356
24%
Çalışıyor
Yayınlandı: 3 makale
Benzer siparişler
(Please read carefully to fully understand the job) I am looking for a developer who has real knowledge in HFT strategies and the ability to create an EA that can run on a real account and be profitable. I already have an EA that performs well on a demo account, but not on a real account. This EA can be used as an example to build a new strategy. I repeat: it should only be used as a reference, not to modify or
PROGRAMADORES SIMPLIFICO MEU PEDIDO ANTERIOR : ATENDE PARA O QUE PRECISO , UMA '' I A '' BASICO . ONDE OPERE COM PRA EM UM PONTO DEFINIDO , E VENDA EM OUTRO TAMBEM PRE-DEFINIDO. DOBRANDO DE VALORES SUCESSIVAMENTE ( COMO SURGERE O MARTINGALE ) APENAS QUANDO O PRECO PASSAR NESSES DOIS PONTOS FINAL DE '' GAP'' PORTANTO
Fibonacci 30 USD
Expert Advisor para MetaTrader 5 que identifique movimentos explosivos do preço, trace Fibonacci automaticamente e execute entradas no pullback de 50%, seguindo tendência e regras de risco. veja aqui na imagem : https://prnt.sc/RbvYjhftVh0R comprar nos 50% , stop se o candle fechar abaixo do 0% , só se fechar se tocar e voltar não faz nada .. TP: configuração manual para 1 , 2 ou 3 para 1.. Colocar o 0x0 caso eu
Robô campeão 30+ USD
Martin Gale . janela objetivando : valor de entrada e consequentemente variação de valores sempre dobrando '' variável de '' GAP '' . Janela para replica de ordens iguais a ordem de valores anteriores , ou seja: uma ordem de micro lote em tantas quantas forem necessárias operacionalmente. saída pre determinada . OBS caso seja relevante: PLATAFORMA TRADINGVIEW
Preciso de um Expert Advisor profissional para MetaTrader 5 (MT5) no XAUUSD. Nome do projeto: XAU GOLD IA PRO Características: operação 100% automática timeframe M5 confirmação M15 + H1 início automático às 19:30 (horário Brasil) meta diária de 2% stop diário de 5% lote inicial 0.01 RR 3:1 estratégia com regiões de preço + Fibonacci + Smart Money Concepts (SMC) add position leve (sem martingale agressivo) trailing
Project Description: I am looking for a Senior MQL5 Developer to build a high-precision Expert Advisor (EA) for the US30 (Dow Jones) index, based on Smart Money Concepts (SMC) and ICT methodologies. The EA must handle multi-timeframe analysis and execute trades with mechanical precision. 1. Multi-Timeframe Analysis & Structural Logic • D1 (Confluence): Automatic plotting of Daily Fair Value Gaps (FVG) and Order

Proje bilgisi

Bütçe
34+ USD
Son teslim tarihi
to 1 gün