Can anyone help me in getting the custom indicator output value in export advisor

 
Hi All,

I am new to MQL, acn any one help me in getting my custom indicator output value in export advisor.

Currently I am getting 0.0 value in export advisor.

Code in custom indicator:-



//---- input parameters

extern int ADXPeriod=28;

//---- buffers

double abc[];



//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int init()

  {

//---- 3 additional buffers are used for counting.

   IndicatorBuffers(1);

//---- indicator buffers

   SetIndexBuffer(0,abc);



  



//----

   return(0);

  }



int start(){



   abc[0] = 123.4;

   Comment( abc[0]);



   return(abc[0]);

  }













Code in Export Advisor:-



//+------------------------------------------------------------------+

//|                                                  TestAdvisor.mq4 |

//|                        Copyright 2020, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2020, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

#property copyright "TestInd"



//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

  {

//--- create timer

   EventSetTimer(60);

     int i = iCustom (NULL, 0, "TestInd.ex4", 0, 6, 0);

      Alert("Custom :", i);

   return(INIT_SUCCEEDED);

  }

void OnTick()

  {

  }

void OnTimer()

  {

  }






Thanks a lot,

Rajesh KS.
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners — MQL5.community is developing along with you. Arbitration has not responded Hello ! The...
Files:
output.PNG  16 kb
 

Perhaps you should read the manual, specifically iCustom, and
          Detailed explanation of iCustom - MQL4 programming forum #33 2017.05.23

Your indicator has one input (ADXPeriod) and one buffer.

     int i = iCustom (NULL, 0, "TestInd.ex4", 0, 6, 0);
  1. Why are you passing zero as the period?
  2. Why are you asking for the seventh buffer (6)?
  3. iCustom returns a double. You would know that if you had used strict. Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.
  4. It's called an Expert Advisor, not export.