Need some help with iCustom

 

Dear forum, I need some help,


I have a Custom Indicator 'Strength EUR' and I want to use this in my EA. It is a simple currency strength indicator solely for EUR. 


I know i need to use iCustom and put in the relevant parameters as well. However I am still not able to manage to get the right output. (the result = 0 while it should be 18 or so).

Can someone help me what I do wrong. I am missing someting. 

What I want to do is compare BufferEUR[0] (current strength) with BufferEUR[1] (previous bar) and make an signal of it. 

The code beneath give a result 0... 

I have attached the indicator code aswell.


//+------------------------------------------------------------------+
//|                                                     iCustoms.mq4 |
//|                                                      Erik Bakker |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "xxxxx"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

extern int Periode=14;
extern int TotalDevise=5;
int mEURUSD;
int mEURJPY;
int mEURGBP;
int mEURCHF;
double BufferEUR[];
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   int C1 = mEURUSD;
   int C2 = mEURJPY;
   int C3 = mEURGBP;
   int C4 = mEURCHF;
   int P=Periode;
   int T=TotalDevise;
   int Test = iCustom(NULL,PERIOD_CURRENT,"Strength EUR",P,0,0);
   Alert(Test);
  }
//+------------------------------------------------------------------+
Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • www.mql5.com
Finally we've got an opportunity to try the new trade terminal - MetaTrader 5 . No doubt, it is noteworthy and has many new features as compared to its predecessor. The important advantages of this platform among others are: Essentially modified language allowing now to use the object-oriented programming, still allowing to use the rich...
Files:
 
Erik Bakker:

Dear forum, I need some help,


I have a Custom Indicator 'Strength EUR' and I want to use this in my EA. It is a simple currency strength indicator solely for EUR. 


I know i need to use iCustom and put in the relevant parameters as well. However I am still not able to manage to get the right output. (the result = 0 while it should be 18 or so).

Can someone help me what I do wrong. I am missing someting. 



int Test = iCustom(NULL,PERIOD_CURRENT,"StrengthEUR",Periode,0,0);
You should call it with correct Periode not P and you will get current bar value and exact indicator name
 

Nikolay Georgiev



Thanks for the reply but still get the result 0. 

Any other suggestions?

 
topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
 
Keith Watford:
topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
I will sorry
 
Nikolay Georgiev:


You should call it with correct Periode not P and you will get current bar value and exact indicator name
Thanks, forgot the space between the 'strength and EUR'. Stupid of me... :-) 
 
Erik Bakker:
Thanks, forgot the space between the 'strength and EUR'. Stupid of me... :-) 

all good :)

Reason: