Download MetaTrader 5
To add comments, please log in or register
Any questions regarding MQL5 Cloud Network? FAQ will help you!
jayaramnaick bukke
555
jayaramnaick bukke 2014.02.09 16:46 

Hi

i have created an indicator which makes Red dot for lower low candle and Blue dot for Higher high candles

can some one help me to create a line which connects Lows of red dot and highs of blue dot

Thanks for your help

This is my code

/+------------------------------------------------------------------+
//|                                      Jaya Fractals(all)(4x4).mq4 |
//|                                                          Jayaram |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Jayaram"
#property link      ""

#property indicator_chart_window

// The number of buffers for calculation, up to 8
#property indicator_buffers 2

// The color for displaying arrows
#property indicator_color1 Blue         // Long signal
#property indicator_color2 Red         // Short signal

// Width of the arrows
#property indicator_width1 1  // Long signal arrow
#property indicator_width2 1  // Short signal arrow

extern int ArrowDistance = 3;

// Buffers for the calculations
double Up_Arrow_Buffer[];    // Long buffer for display
double Down_Arrow_Buffer[];   // Short buffer for display

int RightSideCandleNum = 0; // define inpupt integer to start from
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   // SetIndexStyle  - sets the new type, style, width and color for a given indicator line
   // SetIndexBuffer - binds the array variable declared at a global level to the custom indicator pre-defined buffer
   // SetIndexArrow  - sets an arrow symbol for indicators line of the DRAW_ARROW type.
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexBuffer(0, Up_Arrow_Buffer);
   SetIndexArrow(0, 159); // Up arrow
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexBuffer(1, Down_Arrow_Buffer);
   SetIndexArrow(1, 159); // Down arrow
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int i;                           // Bar index       
   int Counted_bars;                // Number of counted bars
   //--------------------------------------------------------------------   
   Counted_bars=IndicatorCounted(); // Number of counted bars   
   i=Bars-Counted_bars-1;           // Index of the first uncounted which is zero bar(current bar)
   if (i == 0)
   {
      i = 1;  // the newest signal bar maximum limit is till at index 1(and min stats with index 1 as we mentioned while(i>=1)
   }
   while(i>=1)                      // Loop for uncounted bars but always recount the newest 3 bars(u should mention i>=1 though it is at 1 exactly to see history swings also)
   {      
      if (isUpSwingBar(i))
      {
         if (RightSideCandleNum == 0 || (RightSideCandleNum == 0 && i >= 1)) // mention condition if number of completed bars to the rightside of swingupbar
         {
            Up_Arrow_Buffer[i] = Low[i] - (ArrowDistance * Point);
            Down_Arrow_Buffer[i] = EMPTY_VALUE;
         }
      }
      else if (isDownSwingBar(i))
      {
         if (RightSideCandleNum == 0 || (RightSideCandleNum == 0 && i >= 1)) // mention condition if number of completed bars to the rightside of swingupbar
         {
            Down_Arrow_Buffer[i] = High[i] + (ArrowDistance * Point);
            Up_Arrow_Buffer[i] = EMPTY_VALUE;
         }
      }
      
      i--;
   }
//----
   return(0);
}

bool isUpSwingBar(int i)
{
   if (UpSwingLeftOk(i))
   {
      return (true);
   }
   return (false);
}

bool UpSwingLeftOk(int i)                          //UPSWING LEFT OF i bar
{
   if (Low[i] > Low[i+1] && High[i] > High[i+1] && (((Close[i]-Open[i])>(High[i]-Close[i]))||((Close[i+1]-Open[i+1])>(High[i+1]-Close[i+1]))))   // case i Left(upswing)
   {
   return (true);
   }
   if (Low[i] < Low[i+1] && High[i] > High[i+1] &&((Close[i]-Open[i])>(High[i]-Close[i])))   // case ii Left(upswing)
   {
   return (true);
   }
   
   return (false);
}

bool isDownSwingBar(int i)
{
   if (DownSwingLeftOk(i))
   {
      return (true);
   }
   return (false);
}

bool DownSwingLeftOk(int i)                           //DOWNSWING LEFT OF i bar
{
   if (Low[i] < Low[i+1] && High[i] < High[i+1] && (((Open[i]-Close[i])>(Close[i]-Low[i]))||((Open[i+1]-Close[i+1])>(Close[i+1]-Low[i+1]))))       // case i left(downswing)
   {
   return (true);
   }
   if (Low[i] < Low[i+1] && High[i] > High[i+1] && ((Open[i]-Close[i])>(Close[i]-Low[i])))       // case ii left(downswing)
   {
   return (true);
   }
   return (false);
}
   
//+------------------------------------------------------------------+
and this is my image which connects Lows of Red dot and Highs of Blue dot

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.09 17:02  
naickmt4:

Hi

i have created an indicator which makes Red dot for lower low candle and Blue dot for Higher high candles

can some one help me to create a line which connects Lows of red dot and highs of blue dot

Thanks for your help

This is my code

Create another Buffer, style line, and set it's values the same as the Low[i] when a Red dot is set and High[i] when a Blue dot is set.
jayaramnaick bukke
555
jayaramnaick bukke 2014.02.09 17:14  
RaptorUK:
Create another Buffer, style line, and set it's values the same as the Low[i] when a Red dot is set and High[i] when a Blue dot is set.


hi

can u just make it please...

i am very thankful to you

Thanks

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.09 17:37  
naickmt4:


hi

can u just make it please...

i am very thankful to you

Thanks

Yes I can . . . but I'm not here to code for you. If you need someone to do it for you go here: MT4 & MT5 coding
jayaramnaick bukke
555
jayaramnaick bukke 2014.02.09 17:51  

can u make it

i will pay

now one is responding to my job ..though i posted previously two more.

Thanks

jayaramnaick bukke
555
jayaramnaick bukke 2014.02.09 17:53  
RaptorUK:
Yes I can . . . but I'm not here to code for you. If you need someone to do it for you go here: MT4 & MT5 coding


I posted already

this is my query

https://www.mql5.com/en/job/13528

if u can do i will pay for it

thanks

help me

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.09 19:32  
naickmt4:


I posted already

this is my query

https://www.mql5.com/en/job/13528

if u can do i will pay for it

This Job is not what you have described above . . . the Job is asking for an EA not a simple Indicator modification.
jayaramnaick bukke
555
jayaramnaick bukke 2014.02.09 20:24  

Hi

sorry

this is my job

https://www.mql5.com/en/job/13247

needs to create indicator ofcourse

can u do it

thanks

Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.02.09 21:13  
naickmt4:

Hi

sorry

this is my job

https://www.mql5.com/en/job/13247

needs to create indicator ofcourse

can u do it

thanks

You have a very capable bidder . . . give him the Job.
/
To add comments, please log in or register