Ichimoku Returning Incorrect Value

 

Good morning;

I'm developing an EA that uses the Ichimoku Indicator. When I check the various values, I noted that the value for the Chikou Span is incorrect. Please see screenshot attached.

How can I correct this? 

If anyone has encountered this  problem, please point me in the right direction.

Appreciated. 

#include <Trade/Trade.mqh>
CTrade Trade;
#include <Indicators/Trend.mqh>
CiIchimoku*Ichimoku;

int OnInit(){
   Ichimoku = new CiIchimoku();
   Ichimoku.Create(_Symbol,PERIOD_CURRENT,9,26,52);
return(INIT_SUCCEEDED);
}

void OnTick(){
chimoku.Refresh(-1);
   double Tenkan        = Ichimoku.TenkanSen(0);
   double Kijun         = Ichimoku.KijunSen(0);
   double SpanA      = Ichimoku.SenkouSpanA(0);
   double SpanB      = Ichimoku.SenkouSpanB(0);
   double Chikou        = Ichimoku.ChinkouSpan(26);

   Comment("Tenkan Value is: ",Tenkan,"\n",
           "Kijun Value is: ",Kijun,"\n",
           "Span A Value is: ", SpanA,"\n",
           "Span B Value is: ", SpanB,"\n",
           "Chikou Span Value is: ",Chikou);

   }
Files:
 

As you can see chicou[26] is holding the current bid price and my screenshot is working correctly.


 
Thank you,  got it! The logic of current price moved back 26 bars is what I was missing. I've adjusted my code accordingly. Thanks for your input bud!