How show indicator on EA with mql5 on meta trader 5?

 

Hi I try Create some EAs base on my custom indicator and ichimoku for meta trader 5, But when I run my EAs on strategy tester or real chart the indicators not show. I try ChartIndicatorAdd from this link but not working(https://www.mql5.com/en/forum/ea/new_topic).

how can fix this problem? please help me.

this is my entire code from one off my projects until now:


//+------------------------------------------------------------------+
//|                                          test_show_indicator.mq5 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int      ichi_handle ;
double   tenkan[5000]  ;
double   kijun[5000]   ;
double   senb[5000]   ;
double   sena[5000]   ;



int OnInit()
  {
//---
   ichi_handle = iIchimoku(NULL, PERIOD_CURRENT, 9, 26, 52) ;
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
    CopyBuffer ( ichi_handle , TENKANSEN_LINE   , 0 , 5000   , tenkan) ;
      CopyBuffer ( ichi_handle , KIJUNSEN_LINE    , 0 , 5000 , kijun ) ;
      CopyBuffer ( ichi_handle , SENKOUSPANB_LINE , 0 , 5000 , senb  ) ;
      CopyBuffer ( ichi_handle , SENKOUSPANA_LINE , 0 , 5000 , sena  ) ;
      
        ChartIndicatorAdd(  NULL,  0  ,  ichi_handle   );
      
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   
  }
//+------------------------------------------------------------------+
Reason: