Ichimoku indicator class

 

About use of CiIchimoku class.

Above a code of EA intended for test.

When print values of ichimoku lines ChinkouSpan, TenkanSen or KinjunSen, a value is the same 1.797693134862316e+308

Thanks for help.

#include <Indicators/Trend.mqh>
MqlTick     m_tick    ;
CiIchimoku* m_ichimoku;

int OnInit()  {
   m_ichimoku = new CiIchimoku();
   
   if ( !m_ichimoku.Create(_Symbol,PERIOD_CURRENT,9,26,52) ){
      Print("ERROR ON CREATE ICHIMOKU INDICATOR");
      return(1);
   }
   
   return(0);   
}

void OnTick(){
   Print("Nome  :" ,m_ichimoku.Name  ());
   Print("Status:" ,m_ichimoku.Status());
   Print("symb:"   ,m_ichimoku.Symbol(),
         " cs="    ,m_ichimoku.ChinkouSpan(0),
         " ts="    ,m_ichimoku.TenkanSen(0),
         " ks="    ,m_ichimoku.KijunSen(0),
         " last="  ,m_tick.last,
         " ask="   ,m_tick.ask,
         " bid="   ,m_tick.bid);
   return;
}

void OnDeinit(const int reason)  {
   return;
}
 
You should call m_ichimoku.Refresh(-1) before query data

 
Thanks Shaparov. Calling Refresh(-1), TenkanSen and KinjunSen works fine. This solution not works for ChinkouSpan and SenkouSpan A and B. My problem may be the basis of mql5 documentation. You indicate same book or exemple of code?
 

Hello,

I'm trying to get the time when a new value in Kijun sen or Tenkan sen appears.

As I'm developing an Expert Advisor I can't use Time[] parameter of OnCalculate() in indicators.

can anyone help me?
 
amin_mohammadi:

Hello,

I'm trying to get the time when a new value in Kijun sen or Tenkan sen appears.

As I'm developing an Expert Advisor I can't use Time[] parameter of OnCalculate() in indicators.

can anyone help me?
Try CopyTime()
Reason: