Trend Line 1M,30M, Daily,Weekly and Monthly

MQL4 지표

작업 종료됨

실행 시간 1 일

명시

I am looking for someone to add the following time intervals into the posted Trend Line indicator. 1Min, 30Min,Daily,Weekly and Monthly. This should be a fairly straight forward code. Please DO NOT ask for the job if you can't code it.


Thanks


//+------------------------------------------------------------------+
//|                                                   Trendlines.mq4 |
//|                                      Copyright © 2006, John Hitt |
//|                                           jhitt@kanji.dyndns.org |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, John Hitt"
#property link      "jhitt@kanji.dyndns.org"

#property indicator_chart_window

extern color H4_R=RoyalBlue;
extern color H4_S=FireBrick;
extern color H1_R=RoyalBlue;
extern color H1_S=FireBrick;
extern color M15_R=RoyalBlue;
extern color M15_S=FireBrick;

#define RESISTANCE 1
#define SUPPORT 2

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete("H4_R");
   ObjectDelete("H4_S");
   ObjectDelete("H1_R");
   ObjectDelete("H1_S");
   ObjectDelete("M15_R");
   ObjectDelete("M15_S");
   ObjectDelete("M5_R");
   ObjectDelete("M5_S");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   datetime currentbar = 0;
  
   if (currentbar != Time[0])
   {
      switch (Period())
      {
         case PERIOD_H4:
            Draw_H4_Trends();
            break;
         case PERIOD_H1:
            Draw_H4_Trends();
            Draw_H1_Trends();
            break;
         case PERIOD_M15:
            Draw_H1_Trends();
            Draw_M15_Trends();
            break;
         case PERIOD_M5:
            Draw_M15_Trends();
            break;
       }
   }  

   return(0);
  }


void Draw_M15_Trends()
{
   int sbar=0;
   int ebar=0;
   int i;
   double rate_array[][6];
  
   ArrayCopyRates(rate_array, Symbol(), PERIOD_M15);
  
   for (i=2; i < Bars; i++)
   {
      if (HigherHigh(i, 1, rate_array) == true)
      {
        //Print("HiherHigh: ", i);
        if (ebar == 0)
          ebar = i;
        else if (sbar == 0 && rate_array[i][3] > rate_array[ebar][3]) // use 3 for high
          sbar = i;
      }
      if (sbar !=0 && ebar !=0)
         break;
   }
   DrawTrendline ("M15_R", ebar, sbar, PERIOD_M15, RESISTANCE, rate_array);
 
   ebar = 0;
   sbar = 0;
  
   for (i=2; i < Bars; i++)
   {
      if (LowerLow(i, 1, rate_array) == true)
      {
        if (ebar == 0)
          ebar = i;
        else if (sbar == 0 && rate_array[i][2] < rate_array[ebar][2]) // use 2 for low
          sbar = i;
      }
      if (sbar !=0 && ebar !=0)
         break;
   }
   DrawTrendline ("M15_S", ebar, sbar, PERIOD_M15, SUPPORT, rate_array);

}

void Draw_H1_Trends()
{
   int sbar=0;
   int ebar=0;
   int i;
   double rate_array[][6];
  
   ArrayCopyRates(rate_array, Symbol(), PERIOD_H1);
  
   for (i=2; i < Bars; i++)
   {
      if (HigherHigh(i, 1, rate_array) == true)
      {
        //Print("HiherHigh: ", i);
        if (ebar == 0)
          ebar = i;
        else if (sbar == 0 && rate_array[i][3] > rate_array[ebar][3]) // use 3 for high
          sbar = i;
      }
      if (sbar !=0 && ebar !=0)
         break;
   }
   DrawTrendline ("H1_R", ebar, sbar, PERIOD_H1, RESISTANCE, rate_array);
 
   ebar = 0;
   sbar = 0;
  
   for (i=2; i < Bars; i++)
   {
      if (LowerLow(i, 1, rate_array) == true)
      {
        if (ebar == 0)
          ebar = i;
        else if (sbar == 0 && rate_array[i][2] < rate_array[ebar][2]) // use 2 for low
          sbar = i;
      }
      if (sbar !=0 && ebar !=0)
         break;
   }
   DrawTrendline ("H1_S", ebar, sbar, PERIOD_H1, SUPPORT, rate_array);

}

void Draw_H4_Trends()
{
   int sbar=0;
   int ebar=0;
   int i;
   double rate_array[][6];
  
   ArrayCopyRates(rate_array, Symbol(), PERIOD_H4);
  
   for (i=2; i < Bars; i++)
   {
      if (HigherHigh(i, 1, rate_array) == true)
      {
        //Print("HiherHigh: ", i);
        if (ebar == 0)
          ebar = i;
        else if (sbar == 0 && rate_array[i][3] > rate_array[ebar][3]) // use 3 for high
          sbar = i;
      }
      if (sbar !=0 && ebar !=0)
         break;
   }
   DrawTrendline ("H4_R", ebar, sbar, PERIOD_H4, RESISTANCE, rate_array);
 
   ebar = 0;
   sbar = 0;
  
   for (i=2; i < Bars; i++)
   {
      if (LowerLow(i, 1, rate_array) == true)
      {
        if (ebar == 0)
          ebar = i;
        else if (sbar == 0 && rate_array[i][2] < rate_array[ebar][2]) // use 2 for low
          sbar = i;
      }
      if (sbar !=0 && ebar !=0)
         break;
   }
   DrawTrendline ("H4_S", ebar, sbar, PERIOD_H4, SUPPORT, rate_array);
}

 bool HigherHigh (int point, int shift, double array[][6])
  {
    if (shift == 0)
     return (true);

    if (array[point][3] >= array[point+shift][3] && array[point][3] >= array[point-shift][3])
    {
      if (array[point][3] == array[point+shift][3] || array[point][3] == array[point-shift][3])
      {
        if ((point - shift - 1) == 0)
          return (false);
        if (array[point][3] > array[point+shift+1][3] && array[point][3] > array[point-shift-1][3])
          return (HigherHigh (point, shift-1, array));
        else
          return (false);
      } else {
        return (HigherHigh (point, shift-1, array));
      }
    }   
    else
      return (false);
  }
 
  bool LowerLow (int point, int shift, double array[][6])
  {
    if (shift == 0)
     return (true);
    
    if (array[point][2] <= array[point+shift][2] && array[point][2] <= array[point-shift][2])
    {
      if (array[point][2] == array[point+shift][2] || array[point][2] == array[point-shift][2])
      {
        if ((point-shift-1) == 0)
         return (false);
        if (array[point][2] < array[point+shift+1][2] && array[point][2] < array[point-shift-1][2])
          return(LowerLow (point, shift-1, array));
        else
          return (false);
      } else {
        return(LowerLow (point, shift-1, array));
      }
    }
    else
      return (false);
  }
 
 int GetRealPosition(int p1, double array[][6], int which, datetime value, double peak)
 {
   int i;
 
   for (i=0; i < Bars; i++)
   {
     if (array[i][0] == value || array[i][0] < value)
     {
        if (which == RESISTANCE)
        {
          if (array[i][3] == peak) return (i);
          if (array[i-1][3] == peak) return (i-1);
          if (array[i-2][3] == peak) return (i-2);
          if (array[i-3][3] == peak) return (i-3);
         } else {
          if (array[i][2] == peak) return (i);
          if (array[i-1][2] == peak) return (i-1);
          if (array[i-2][2] == peak) return (i-2);
          if (array[i-3][2] == peak) return (i-3);
         }
         if (array[i][0] < value) return (i);
     }
   }
   return (-1);
}
 
 int DrawTrendline (string name, int p1, int p2, int timeframe, int which, double r_array[][6])
 {
   color hue;
   int thickness = 1;
   int style = STYLE_DASH;
   double array[][6];
 
   ArrayCopyRates(array, Symbol(), Period());
   
   if (which == RESISTANCE)
   {
     hue = RoyalBlue;
     if (Period() != timeframe)
     {
       p1 = GetRealPosition(p1, array, which, r_array[p1][0], r_array[p1][3]);
       p2 = GetRealPosition(p2, array, which, r_array[p2][0], r_array[p2][3]);
     }
   }
   else
   {
     hue = FireBrick;
     if (Period() != timeframe)
     {
       p1 = GetRealPosition(p1, array, which, r_array[p1][0], r_array[p1][2]);
       p2 = GetRealPosition(p2, array, which, r_array[p2][0], r_array[p2][2]);
     }
   }
     
   switch(timeframe)
   {
      case PERIOD_H4:
         thickness = 2;
         style = STYLE_SOLID;
         if (which == RESISTANCE)
           hue = H4_R;
         else
           hue = H4_S;
         break;
      case PERIOD_H1:
         style = STYLE_SOLID;
         thickness = 1;
         if (which == RESISTANCE)
           hue = H1_R;
         else
           hue = H1_S;
         break;
      case PERIOD_M15:
         style = STYLE_DASHDOTDOT;
         thickness = 1;
         if (which == RESISTANCE)
           hue = M15_R;
         else
           hue = M15_S;
         break;
   }
  
   if (ObjectFind(name) < 0)
   {
     if (which == SUPPORT)
       ObjectCreate(name, OBJ_TREND, 0, array[p2][0], array[p2][2], array[p1][0], array[p1][2]);
     else
       ObjectCreate(name, OBJ_TREND, 0, array[p2][2], array[p2][3], array[p1][0], array[p1][3]);
      
     ObjectSet(name, OBJPROP_COLOR, hue);
     ObjectSet(name, OBJPROP_RAY, true);
     ObjectSet(name, OBJPROP_BACK, true);
     ObjectSet(name, OBJPROP_WIDTH, thickness);
     ObjectSet(name, OBJPROP_STYLE, style);
   }
  
   if (which == SUPPORT)
   { // Lows (0 == Time)
     ObjectMove (name, 0, array[p2][0], array[p2][2]);
     ObjectMove (name, 1, array[p1][0], array[p1][2]); 
   }
   else
   { // Highs
     ObjectMove (name, 0, array[p2][0], array[p2][3]);
     ObjectMove (name, 1, array[p1][0], array[p1][3]);  
   }
  
   ObjectsRedraw();
   return(0);

 }





응답함

1
개발자 1
등급
(187)
프로젝트
367
56%
중재
45
22% / 56%
기한 초과
188
51%
무료
2
개발자 2
등급
(549)
프로젝트
826
73%
중재
15
53% / 13%
기한 초과
193
23%
작업중
3
개발자 3
등급
(467)
프로젝트
701
56%
중재
44
30% / 32%
기한 초과
114
16%
작업중
4
개발자 4
등급
(54)
프로젝트
164
43%
중재
43
47% / 16%
기한 초과
58
35%
무료
5
개발자 5
등급
(90)
프로젝트
159
61%
중재
40
18% / 63%
기한 초과
70
44%
무료
6
개발자 6
등급
(803)
프로젝트
1374
72%
중재
113
28% / 48%
기한 초과
342
25%
작업중
7
개발자 7
등급
(13)
프로젝트
20
30%
중재
5
20% / 80%
기한 초과
5
25%
무료
8
개발자 8
등급
(195)
프로젝트
395
28%
중재
155
20% / 52%
기한 초과
112
28%
무료
9
개발자 9
등급
(62)
프로젝트
140
46%
중재
19
42% / 16%
기한 초과
32
23%
무료
10
개발자 10
등급
(339)
프로젝트
809
73%
중재
30
33% / 37%
기한 초과
194
24%
무료
비슷한 주문
Hi, I have 2 indicators which are based on the super trend , the alerts on indicator (1) does not work at all , and on the other indicator the alerts do not come on time on time, which is kind of delayed. see attached file below
Looking for an experienced developer to modify my existing TDI strategy , want to add filter for Buy and Sell Signals, Arrows are displayed on chart and what only to leave high accurate arrows Source code to be provided
I have the mq5 file, I need a buffer adding to the indicator, so it appears in the data window so I can reference it later in an EA. As the below screenshot shows, there is a median ray line from yesterday (the dashed horizontal line) - I want this value in the data window called Median Ray. I want this to be a single value per day, so todays Median Ray would be 17868, and so on each day. So I want all the Developing
I would like to develop my own indicator on metatrader 4 and tradingview. We would start with a basic version that we would improve later. It is an indicator based on several analyses and which would provide several indications. I am looking for someone who can develop on MT4 and Mt5, initially I would like to do it on mt4 and then on mt5. If you have expertise in pinescript it is a plus because I would like to
I urgently require swift assistance to convert a complex indicator into a fully functional scanner, capable of automatically sending real-time data, alerts, and notifications via email, ensuring seamless integration and prompt delivery of critical information to facilitate informed decision-making and timely action
I need to improve the code of an indicator that is too heavy and slow when running and when used with iCustom in an EA. No other changes to the indicator are requested: the original features of the indicator should remain as theay are. I'll provide the indicator after job acceptance. I request final source code mq5 file. Thank you Regards
I have a mt5 indicator that is working perfectly but I will like to make it an expert advisor to have an automated trade. I will be glad if I can get a well experienced developer to execute this project. Thanks
O TRABALHO CONSISTE NA MUDANÇA DO HISTOGRAMA DO INDICADOR TREDN DIRECTION AND FORCE DSEMA SMOOTHED PARA O HISTOGRAMA DA FOTO ANEXA, OBEDECENDO AS TRES CORES VERDE (UP, VERMELHOR(DOWN) E CINZA(TREND). O MESMO TEM QUE ODECER O MESMO CALCULO E COLORIR DA MESMA FORMA POREM COM HISTOGRAMA DDE FORMATO DIFERENTE
If you are knowledgeable in hedging strategy we can chat. I created my simple EA using Fxdreema , so you only need to modify it for me. There are two parts of the EA , 1. Is the execution strategy 2. Is the money management strategy (hedging). I already created number 1 which is the execution of trades , I only need someone who can implement hedging in every orders the EA create. Additional Parameters needed. Trade
We are interested in a TradingView indicator that reads candlestick pattern shapes and shows the location of entry and exit points on a candlestick chart. What services do you provide related to this

프로젝트 정보

예산
10 USD
개발자에게
9 - 9 USD
기한
에서 1  3 일