Getting values from a custom indicator

 

Im trying to get the values from this JFDS custom   indicator but i only get an error  "cannot load custom indicator 'JFDS' [4804]" .

And what is exactly 

ERR_INDICATOR_CANNOT_APPLY

4804

The indicator cannot be applied to another indicator

  means?


This is the code


#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
const  string     JFDS = "JFDS";
sinput int        ShowPeriod = 5;
sinput int        Slw = 5;
sinput int        Pds = 10;
sinput int        Slwsignal = 7;
sinput int        Barcount = 2000;


double dds_handle;

double ddsM1_Index = 0;
double ddsM5__Index = 1;
double ddsM15_Index = 2;

double ddsM1_Buffer[3];
double ddsM5_Buffer[3];
double ddsM15_Buffer[3];

  
  
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {


    dds_handle = iCustom(Symbol(),Period(),JFDS,ShowPeriod,Slw,Pds,Slwsignal,Barcount);
   
    
   int cnt = CopyBuffer(dds_handle, ddsM1_Index, 0, 3, ddsM1_Buffer);

 
 
 if(dds_handle==INVALID_HANDLE){
   //Alert(GetLastError());
 }
 
 PrintFormat(dds_handle);
 //Alert(ddsM1_Buffer[2]);
 
   return(rates_total);
  }
//+------------------------------------------------------------------+

void OnDeinit(const int reason){
   IndicatorRelease(dds_handle);
}
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
Files:
JFDS.ex5  23 kb
 
Your JFDS calls another indicator that you do not have.
 
William Roeder:
Your JFDS calls another indicator that you do not have.
JFDS is the indicator that  i'm trying to get values from, and it is in the Indicators folder
 
shashin wijewardhane: JFDS is the indicator that  i'm trying to get values from, and it is in the Indicators folder

What part of “JFDS calls another indicator that you do not have” was unclear to you?

 
William Roeder:

What part of “JFDS calls another indicator that you do not have” was unclear to you?

oh  thank you  .i resolved it , i had to call the indicator by the name "JFMDS" instead JFDS file name, it is weir d , thank you for your time.

 
shashin wijewardhane :


Correct your code: in MQL5, the indicator handle should be RECEIVED ONLY ONCE !!! And you need to do this in OnInit !!!

Reason: