Why does Ichimoku.ChinkouSpan(26); constantly return a value 1.79+308?

 

Hi

I've been looking at this indicator and while all the other components seem to work as expected, the .ChinkouSpan seems incorrect. While the tooltip and display look 'sensible' the value returned from the .ChinkouSpan(26) function seems to be stuck at 1.79+308? 

Even with this simple version from Mohamed Abdelmaaboud's article, www.mql5.com/en/articles/11081 does not seem to work correctly?

I've attached a screen grab, the plot looks correct, as does the tooltip, it's the value returned that seems incorrect? 

There was another post about this back in 2011, but with no solution as to why the value is stuck, other than to refresh, which as you can see is being done. 

Can anyone help with this please? Does anyone get the same display? Is this a bug or something I have missed?


Thank you.



Here is his code:

//+------------------------------------------------------------------+
//|                                       Simple Ichimoku system.mq5 |
//|                                  Copyright 2022, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#include <Indicators/Trend.mqh>
CiIchimoku*Ichimoku;
//+------------------------------------------------------------------+
void OnInit()
  {
   Ichimoku = new CiIchimoku();
   Ichimoku.Create(_Symbol,PERIOD_CURRENT,9,26,52);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {
   Ichimoku.Refresh(-1);
   double TenkanVal= Ichimoku.TenkanSen(0);
   double KijunVal= Ichimoku.KijunSen(0);
   double SpanAVal= Ichimoku.SenkouSpanA(-26);
   double SpanBVal= Ichimoku.SenkouSpanB(-26);
   double ChikouVal= Ichimoku.ChinkouSpan(26);

   Comment("Tenkan Sen Value is: ",TenkanVal,"\n",
           "Kijun Sen Value is: ",KijunVal,"\n",
           "Senkou Span A Value is: ", SpanAVal,"\n",
           "Senkou Span B Value is: ",SpanBVal,"\n",
           "Chikou Span Value is: ",ChikouVal);
  }
//+------------------------------------------------------------------+
Learn how to design a trading system by Ichimoku
Learn how to design a trading system by Ichimoku
  • www.mql5.com
Here is a new article in our series about how to design a trading system b the most popular indicators, we will talk about the Ichimoku indicator in detail and how to design a trading system by this indicator.
Files:
 
pete sw:

Hi

I've been looking at this indicator and while all the other components seem to work as expected, the .ChinkouSpan seems incorrect. While the tooltip and display look 'sensible' the value returned from the .ChinkouSpan(26) function seems to be stuck at 1.79+308? 

Even with this simple version from Mohamed Abdelmaaboud's article, www.mql5.com/en/articles/11081 does not seem to work correctly?

I've attached a screen grab, the plot looks correct, as does the tooltip, it's the value returned that seems incorrect? 

There was another post about this back in 2011, but with no solution as to why the value is stuck, other than to refresh, which as you can see is being done. 

Can anyone help with this please? Does anyone get the same display? Is this a bug or something I have missed?


Thank you.



Here is his code:

Ok, so I have tracked this down a little further. When I use my broker data it works fine. When I use custom data I downloaded from TickStory I get the error. 

So am I correct in assuming there is some error in the data?

Thank you.

 
pete sw:

Hi

I've been looking at this indicator and while all the other components seem to work as expected, the .ChinkouSpan seems incorrect. While the tooltip and display look 'sensible' the value returned from the .ChinkouSpan(26) function seems to be stuck at 1.79+308? 

Even with this simple version from Mohamed Abdelmaaboud's article, www.mql5.com/en/articles/11081 does not seem to work correctly?

I've attached a screen grab, the plot looks correct, as does the tooltip, it's the value returned that seems incorrect? 

There was another post about this back in 2011, but with no solution as to why the value is stuck, other than to refresh, which as you can see is being done. 

Can anyone help with this please? Does anyone get the same display? Is this a bug or something I have missed?

Thank you.


Here is his code:

The library is already taking the shift into account, your code to get the current values should be :

   double SpanAVal= Ichimoku.SenkouSpanA(0);
   double SpanBVal= Ichimoku.SenkouSpanB(0);
   double ChikouVal= Ichimoku.ChinkouSpan(0);
 

Hello,

I am getting the same error, even when I call Ichimoku.ChinkouSpan(0).

I observe this behaviour starting from period H8 and upwards, while everything works fine between M5 and H4.

 
The number you keep seeing is the highest existing double value DBL_MAX, also known as EMPTY_VALUE.

It has been used by MQ as a special value that is not plotted when it appears in indicator buffers (as opposed to all other double values which will be plotted when they appear in indicator buffers).

Its value is 1,7 times 10 to the power of 308.
This is often used in indicators to prime the buffers with a "neutral" value.
 
Tobias Johannes Zimmer #:
The number you keep seeing is the highest existing double value DBL_MAX, also known as EMPTY_VALUE.

It has been used by MQ as a special value that is not plotted when it appears in indicator buffers (as opposed to all other double values which will be plotted when they appear in indicator buffers).

Its value is 1,7 times 10 to the power of 308.
This is often used in indicators to prime the buffers with a "neutral" value.
Ok thanks, but this does look like a bug, right? How can we get the ChinkouSpan value for PERIOD_H4 and beyond?
 
Raz989 #:
Ok thanks, but this does look like a bug, right? How can we get the ChinkouSpan value for PERIOD_H4 and beyond?
It looks as if something went wrong
You can do three things to troubleshoot the bug:
1.CheckPointer(Ichimoku);   if Ichimoku object pointer is initialised correctly the return value is true.
2.check if the return value of Ichimoku.Create is also true.
3.The values that you are trying to visualise are in a place in the buffer that is not calculated. You are trying to get the Kijunsen value of bar zero, except i think the buffer in Indicator classes is per default non-series and has a size of 1024 bars(not 100% sure though).
Try to get the value Ichimoku.Kinjunsen(1023).

How to get H4 I haven't tried yet. But if you want to work with classes you have to look up what their methods are and what is inside them.