Spread trading in Meta Trader - page 70

 

Hi all, I'm a bit dull here. There is an indicator that outputs MA of different instruments in one window.

Here are its external parameters (1st instr. =0th buffer, 2nd instr. =1st buffer):

extern string  Symbol_1 = "FDAXH0";
extern string  Symbol_2 = "FTSEH0";
extern int N1 = 10;
extern int N2 = 10;
extern string  _________  = "=== Параметры МА ==="; 
extern int MA_per =  21;

How do I write the challenge in the EA? Is this the right way?

//--задаем значения индикатора по первому символу  ---
   double Complex_1_1=iCustom( Symbol_1,0,"C_Com", N1, N2, MA_per,0,1); 

  
//---задаем значения индикатора по второму символу ---
  double Complex_2_1=iCustom(  Symbol_2,0,"C_Com", N1, N2, MA_per,1,1); 

I put these values in the comment window (to be more exact - their difference) and found out that in my visual chart the comment values do not coincide with the values of indicator I drew in the visual chart. It is the same, though the parameters are the same.

I cannot understand why it is so. They are by more than one order of magnitude different...



 

All parameters in icustome should be the same :-) otherwise you call 2 different indicators.

In your case:

double Complex_1_1=iCustom( NULL,0,"C_Com", Symbol_1,Symbol_2, N1, N2, MA_per,0,1); 
double Complex_2_1=iCustom( NULL,0,"C_Com", Symbol_1,Symbol_2, N1, N2, MA_per,1,1); 
 
But they're all the same for me! Except for the name of the characters.
 
Okay. I see. Thanks.
 
forex-k you could write another correlation indicator like for EURO and SWISS FRANC, but only for AUSTRALIAN DOLLAR and NEW ZEALAND DOLLAR futures, good correlation and do not go far away from each other
 
kaln82 >>:
forex-k вы не моглибы ещё написать индюк по кореляциям такойже как для EURO и SWISS FRANC, но только для фьючей AUSTRALIAN DOLLAR и NEW ZEALAND DOLLAR, хорошая кореляция и далико от друг дружка не уходят

why write it - it's a versatile tool, you just need to prescribe the right tools in the settings and that's it

 
forex-k , thank you very much, I tried to write 6NH0 and 6AH0in the settings but nothing came out
 
neoclassic >>:

Все параметры в icustome должны быть одинаковые :-) а то тыж 2 разных индикатора вызываешь.

В твоем случае:


I guess so :

double Complex_1_1=iCustom( NULL,0, "C_Com",Symbol_1,Symbol_2,N1,N2,MA_per,0,1);
double Complex_2_1=iCustom( NULL,0, "C_Com",Symbol_1,Symbol_2,N1,N2,MA_per,1,1);

It doesn't work either. After all, the variables Symbol_1,Symbol_2 are set in the parameters of the indicator and advisor - as an extern string, and this kind of iCustom probably can't be set....

I'm afraid there's no way around it at all...

 
... - List of parameters (if necessary). Transmitted parameters should correspond to the order of declaration and type of external (extern) variables of the custom indicator

There is no any information about restrictions. And I kind of did it once. What does it say?

 

It doesn't write anything. It returns zeros.

And here is how

double Complex_1_1=iCustom( NULL,0, "C_Com",N1,N2,MA_per,0,1);
double Complex_2_1=iCustom( NULL,0, "C_Com",N1,N2,MA_per,1,1);

works. But the numbers in Comment(Complex_1_1,"\n",Complex_2_1,"\r\n");

are not the same as the indyuk itself on the visual chart by a factor of ten.

Reason: