Trend line code fixed and fucnting right

명시


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
      

      

응답함

1
개발자 1
등급
(143)
프로젝트
168
23%
중재
7
29% / 43%
기한 초과
4
2%
작업중
2
개발자 2
등급
(73)
프로젝트
122
52%
중재
4
25% / 75%
기한 초과
19
16%
작업중
3
개발자 3
등급
(38)
프로젝트
40
25%
중재
23
13% / 70%
기한 초과
8
20%
로드됨
4
개발자 4
등급
(13)
프로젝트
16
19%
중재
0
기한 초과
2
13%
무료
5
개발자 5
등급
(1)
프로젝트
5
0%
중재
1
100% / 0%
기한 초과
2
40%
무료
6
개발자 6
등급
(255)
프로젝트
413
38%
중재
86
44% / 19%
기한 초과
70
17%
바쁜
7
개발자 7
등급
(66)
프로젝트
143
34%
중재
10
10% / 60%
기한 초과
26
18%
무료
비슷한 주문
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

프로젝트 정보

예산
30+ USD
개발자에게
27 USD
기한
 1 일