Trend line code fixed and fucnting right

Termos de Referência


void 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 begin = trendlinePeriod + 1;
  int end = rates_total - 1;
  
  for (int i = begin; i <= end; i++) {
    if (Close[i - 1] <= Close[i - trendlinePeriod]) {
      if (IsPriceOnTrendline(i - 1, 0.0) && IsPriceOnTrendline(i, -1.0) && Close[i] < prevClose - minPriceDiff) {
        trendline[i] = (Close[i - trendlinePeriod] - Close[i]) / trendlinePeriod;
        trendline_start_bar = i - trendlinePeriod;
        ColorSetIndex(trendline_start_bar + 4, downtrendColor);
      } else {
        trendline[i] = 0.0;
      }
    } else if (Close[i - 1] >= Close[i - trendlinePeriod]) {
      if (IsPriceOnTrendline(i - 1, 0.0) && IsPriceOnTrendline(i, 1.0) && Close[i] > prevClose + minPriceDiff) {
        trendline[i] = (Close[i] - Close[i - trendlinePeriod]) / trendlinePeriod;
        trendline_start_bar = i - trendlinePeriod;
        ColorSetIndex(trendline_start_bar + 4, uptrendColor);
      } else {
        trendline[i] = 0.0;
      }
    } else {
      trendline[i] = 0.0;
    }

    if (trendline[i] != 0.0) 
      int count = 1;
      for (int j = i + 1; j <= end && count < minPointsForExtendedTrendline; j++) {
        if (IsPriceOnTrendline(j, trendline[i])) {
          count++;
        }
      }
      if (count >= minPointsForExtendedTrendline)
        // Extend trendline logic goes here
      

      

Respondido

1
Desenvolvedor 1
Classificação
(143)
Projetos
168
23%
Arbitragem
7
29% / 43%
Expirado
4
2%
Trabalhando
2
Desenvolvedor 2
Classificação
(73)
Projetos
122
52%
Arbitragem
4
25% / 75%
Expirado
19
16%
Trabalhando
3
Desenvolvedor 3
Classificação
(38)
Projetos
40
25%
Arbitragem
23
13% / 70%
Expirado
8
20%
Carregado
4
Desenvolvedor 4
Classificação
(13)
Projetos
16
19%
Arbitragem
0
Expirado
2
13%
Livre
5
Desenvolvedor 5
Classificação
(1)
Projetos
5
0%
Arbitragem
1
100% / 0%
Expirado
2
40%
Livre
6
Desenvolvedor 6
Classificação
(255)
Projetos
413
38%
Arbitragem
86
44% / 19%
Expirado
70
17%
Ocupado
7
Desenvolvedor 7
Classificação
(66)
Projetos
143
34%
Arbitragem
10
10% / 60%
Expirado
26
18%
Livre
Pedidos semelhantes
hello i want a library to include into meta4 code and I just need to copy and paste it into meta5 editor **It should run without any error or warning** I just need the code after selecting a developer, just tell me what kind of library do you have
I'm looking to automate a strategy using MT4 Renko charts with three indicators: 1. Simple moving average (MA) 2. RSB bands (custom indicator) 3. PV2 (custom indicator) To open a buy, we need the following at the close of an up brick: 1. MA has to have crossed over or come within "x" pips (variable input) of the bottom RSB band before turning up. 2. PV white line is above the red line. Closing the trade is by any of
I am looking for an EA that give above a 50% winrate using a 1:1.5 RR preferably trading in london to new york session, nothing complicated just something profitable. I would love to see a sample of the project before I purchase well thank you
Hello I need a MT4 EA which open trade according to the provided indicator 1 Master/Main indicator 1 Filter Find attached for details EA settings will send via chat or email because unable to send PDF
I want to make something automatic which EMA will automatically trade in my account. For this I want to make a simple robot I want to get this made automatically on a simple EMA
**Project Title:** Development of a Complex High-Performance EA for Step Index **Project Overview:** I need an advanced Expert Advisor (EA) for trading the Step Index on MetaTrader 5. The EA should use multiple indicators and advanced risk management techniques to enhance profitability and manage risks effectively. **Trading Strategy Details:** Indicators: - 50-period EMA - 200-period EMA - RSI with 14 periods - MACD
Dear All, I need to design and implement an EA with the involvement of a possible AI. I would like the entries to be realized with all MACD, RSI, Stoch parameters but also Ai. I mainly want the system to immediately close the transaction itself at the time of trend reversal even before reaching the TP position. It should work for intervals M15, H1, H4 and maybe long-term on D1 Platform for MT5 and exclusive only
Hello, I want a Telegram trade copier converted to metatrader 5. I have 2 samples with. This are samples of what I needed, inbox to let discuss if you can get this done with ease. Thanks
Below follows specifications and the pictures of how the indicator should be. I believe that during the development it is necessary some adjustments that I may have forgotten while writing the descriptions, please take this into account. If necessary I have the pdf file that may be easier to understand. Doubts I am at your disposal
Saya memerlukan Expert Advisor berdasarkan sinyal AOX. Itu harus memiliki pemeriksaan dan penanganan kesalahan operasi perdagangan. Kriteria utama pembukaan dan posisi penutupan: ■ arah rata-rata bergerak ■ harga lebih tinggi dari bar sebelumnya. Lot perdagangan adalah parameter masukan

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD
Prazo
para 1 dias