Download MetaTrader 5

Indicators: Indicator of Candlesticks Combinations (Japanese Candlesticks)

To add comments, please log in or register
Interested in earning money via MQL5 Cloud Network? Enter your profile!
MetaQuotes Software Corp.
Moderator
181327
MetaQuotes Software Corp. 2008.10.11 19:53 

Indicator of Candlesticks Combinations (Japanese Candlesticks):

It denotes the combinations of candlesticks using the "wingdings".

Author: IURII TOKMAN

MQL4 Comments
16319
MQL4 Comments 2008.10.13 15:29  

Hello,

thanks for a sharing, I've translated below this indicator into English comments.Regards

 

///------------------------------------------------------------------+
//|                                                   Japan.mq4 |
//|                                                     Yuriy  tokman |
//|                                            yuriytokman@gmail.com |
// +------------------------------------------------------------------+
#property  copyright " yuriy  tokman "
#property  link      "yuriytokman@gmail.com"
#property  indicator_chart_window
//---- input  parameters
extern  int       barsToProcess=1000;
// +------------------------------------------------------------------+
//| Custom  indicator  initialization  function                         |
// +------------------------------------------------------------------+
int  init ()
  {
//---- indicators
//----
   return (0);
  }
// +------------------------------------------------------------------+
//| Custom  indicator  deinitialization  function                       |
// +------------------------------------------------------------------+
int  deinit ()
  {
//----
int i;
  
  for (i=0; i<  Bars; i++)
    {
    ObjectDelete ("hung or hammer "+DoubleToStr (i, 0));
    ObjectDelete ("bull absorption " +DoubleToStr (i, 0));
    ObjectDelete ("bear absorption " +DoubleToStr (i, 0));
    ObjectDelete ("curtain from the dark clouds " +DoubleToStr (i, 0));
    ObjectDelete ("the cloud gap " +DoubleToStr (i, 0));
    ObjectDelete ("doji " +DoubleToStr (i, 0));
    }
//----
   return (0);
  }
// +------------------------------------------------------------------+
//| Custom  indicator  iteration  function                              |
// +------------------------------------------------------------------+
int  start ()
  {
   int    counted_bars=IndicatorCounted (),
//----
   limit,
   i=0; 
   if (counted_bars> 0)
      counted_bars--;
   
   limit=Bars-counted_bars;
   
   if (limit>  barsToProcess)
      limit=barsToProcess;
   while (i<  limit)
   {           
                                 // hung or the hammer
      double k = (High [i] - Low [i]) /3;
      if ((Open [i]> (Low [i]  +2*k))&& (Close [i]> (Low [i]  +2*k)))
       {
        ObjectCreate ("hung or hammer "+DoubleToStr (i, 0), OBJ_ARROW, 0, Time [i], High [i]  +10*Point);
        ObjectSet ("hung or hammer "+DoubleToStr (i, 0), OBJPROP_ARROWCODE, 108);
        ObjectSet ("hung or hammer "+DoubleToStr (i, 0), OBJPROP_COLOR, DimGray);
       }            
                                // the bull absorption
      if ((Open [ i+1]>  Close [ i+1]) && (Close [ i+1]>  Open [i]) && (Close [i]>  Open [ i+1]))
       {
        ObjectCreate ("bull absorption " +DoubleToStr (i, 0), OBJ_ARROW, 0, Time [i], Low [i] - 15*Point);
        ObjectSet ("bull absorption " +DoubleToStr (i, 0), OBJPROP_ARROWCODE, 110);
       }            
                               // the bear absorption
       if ((Close [ i+1]>  Open [ i+1]) && (Open [i]>  Close [ i+1]) && (Open [ i+1]>  Close [i]))
       {
        ObjectCreate ("bear absorption " +DoubleToStr (i, 0), OBJ_ARROW, 0, Time [i], High [i]  +15*Point);
        ObjectSet ("bear absorption " +DoubleToStr (i, 0), OBJPROP_ARROWCODE, 110);
        ObjectSet ("bear absorption " +DoubleToStr (i, 0), OBJPROP_COLOR, Lime);
       }
                               // curtain from the dark clouds
       if ((Open [ i+1]<  Close [ i+1]) && (Open [i]>  High [ i+1]) && (Close [i]< (Open [ i+1] + (Close [ i+1] - Open [ i+1]) /2)))
       {
        ObjectCreate ("curtain from the dark clouds " +DoubleToStr (i, 0), OBJ_ARROW, 0, Time [i], High [i]  +25*Point);
        ObjectSet ("curtain from the dark clouds " +DoubleToStr (i, 0), OBJPROP_ARROWCODE, 116);
        ObjectSet ("curtain from the dark clouds " +DoubleToStr (i, 0), OBJPROP_COLOR, Lime);
       }
                               // cloud gap 
       if ((Open [ i+1]>  Close [ i+1]) && (Low [ i+1]>  Open [i]) && (Close [i]> (Close [ i+1] + (Open [ i+1] - Close [ i+1]) /2)))
       {
        ObjectCreate ("the cloud gap " +DoubleToStr (i, 0), OBJ_ARROW, 0, Time [i], Low [i] - 25*Point);
        ObjectSet ("the cloud gap " +DoubleToStr (i, 0), OBJPROP_ARROWCODE, 116);
       }
                               // doji
       if (Open [i]  ==Close [i])
       {
        ObjectCreate ("doji " +DoubleToStr (i, 0), OBJ_ARROW, 0, Time [i], High [i]  +30*Point);
        ObjectSet ("doji " +DoubleToStr (i, 0), OBJPROP_ARROWCODE, 174);
        ObjectSet ("doji " +DoubleToStr (i, 0), OBJPROP_COLOR, Indigo);
       }
     i++;  
   }
//----
   return (0);
  }
 +------------------------------------------------------------------+
Iurii Tokman
31168
Iurii Tokman 2008.10.14 16:20  
Ok . I shall take into account this lack of the complete version.
DeveloperMQL
25
DeveloperMQL 2010.02.28 18:08  

This is good candlestick indicator as well

rossiya
38
rossiya 2010.12.29 04:52  

Nice indicator. One glitch is that Objects are named backwards i.e.

ObjectCreate ("curtain from the dark clouds " +DoubleToStr (i, 0), ...

instead of

ObjectCreate ("curtain from the dark clouds " +DoubleToStr (Bars-i, 0), ...

As a result the objects at the old index 0 get clobbered.

To add comments, please log in or register