Indicators: Ichimoku Kinko Hyo2

 

Ichimoku Kinko Hyo2:

Ichimoku Kinko Hyo (IKH) is an indicator that tracks the equilibrium of momentum and identify likely areas of support and resistance. The Ichimoku chart is composed of five (5) separate indicator lines. These lines work together to form the complete "Ichimoku picture".

Ichimoku Kinko Hyo2

Author: Dwaine Hinds

 

I made some important changes so kindly re-download and try this version. This indicator will store the last received kumo depth values to file by default. This is useful when you want to terminate the indicator and restart it at a later date without having to recollect all the required amount of kumo depth values from the start. If you don't want this just delete the "ichimoku2_kumo_data.txt" found in "../files" directory. Ofcourse, doing this will cause all stored kumo data to be lost and therefore the indicator will start collecting new data. Concerning the issue of not recalculating the data on every tick, I have decided to make this feature optional and called it "economy_mode". This can be set only in the indicator file using the "economy_mode" parameter.

The indicator code has been changed to also accommodate for multi time frames. This means it should work as normal when used on a chart that is not the current one, at the same time. 

For clarity, the indicator will now output text for the calculated kumo implied volatility instead of an integer value. Why? Because it becomes easy to understand what is taking place and so this aids the coder. I have included a handy breakpoint tool you can use to stop an EA to observe the values coming from the indicator. This tool is not used nor needed by the indicator but is just included here for demonstration. Demo EA:

#property copyright "Copyright 2020, Peoples' software corp."
#property link      "https://www.everywhere.com"
#property version   "1.00"
#property strict
#include <Ichimoku2_Kinko_Hyo_Indicator.mqh>
#include <BreakPoint.mqh>
double tk=0,kj=0,ch=0,spa=0,spb=0;
int shift=1;
string kshape1,ksentiment1,kiv1;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

   iIchimoku2(NULL,0,3,tk,kj,ch,spa,spb,kiv1,kshape1,ksentiment1,shift);
   if(kiv1=="thin")BreakPoint("","","",true,"tk=",DoubleToStr(tk)," kj=",DoubleToStr(kj)," ch=",DoubleToStr(ch)," spa=",DoubleToStr(spa)," spb=",DoubleToStr(spb)," kiv1=",kiv1," kshape1=",kshape1," ksentiment1=",ksentiment1);
  }
//+------------------------------------------------------------------+


Here you can see what the kumo implied volatility looks like when it is "thin". As you can see, the kumo appears to be getting thinner at the "shift=1" bar. 

kumo is thin



To stop the EA when kumo is "thick" just change the "if" statement from " if(kiv1=="thin")" to "if(kiv1=="thick")". Here you can see what the kumo implied volatility looks like when it is "thick". As you can see, the kumo appears to be getting thicker at the "shift=1" bar.

kumo is thick

 
Any questions? Or suggestions? Or problems?
 
Dwaine Hinds:
Any questions? Or suggestions? Or problems?

Updated "io_arrays.mqh" file today.

 

Updated "Ichimoku2.mq4" file today.

There are some users who still prefer to use this indicator manually and although it was rebuilt to suit expert advisors, I don't think we should  risk leaving out the manual traders. I have now included a little section to display a summary of all the relevant data the indicator has presented at a specific SHIFT. To see this, you must ensure that the "display_summary" is set to "yes". This can only be set in the "Ichimoku2.mq4" file. I know the advanced ichimoku practitioners will find this info unnecessary, as they already can get this by glancing at the lines on the chart. However, this indicator was rebuilt to assist the novices as well. This should be the last update.

Ichimoku Summary Comments


If you are going to use this in an expert advisor I would recommend you set "display_summary" to "no", since the EA already extracts this information itself. And also we don't want to overwhelm our eyes with too much data, so setting it to "no" will reduce cluttering of the chart. The ichimoku indicator already has a lot of lines, I think I have succeeded in making the indicator less complicated. The summary comments apply only to the indicator values at specified shift.

 
I want to subscribe
 
Thomas Patterson:
I want to subscribe

We are working on this. Just trying to complete a few other important projects. 👍

 

Just made some important changes to the code today. The reason for the change is because the previous indicator code could only be used by a single EA, utilizing it on multiple charts, on multiple symbols, simultaneously. The newer code should allow multiple EAs, utilizing it on multiple charts, on multiple symbols, simultaneously.

Please note the newer useage:

int aMagicNumber=1234;
...
   iIchimoku2(NULL,0,3,tk,kj,ch,spa,spb,kiv1,kshape1,ksentiment1,aMagicNumber,shift);
...

This should be my last update. The updated indicator now requires your EA's magic number. Of course, this does not affect manual users.

Reason: