Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 543

 
zoritch:

https://www.mql4.com/ru/search#!keyword=%D0%B3%D1%80%D0%B0%D0%B0%D0%BB%D1%8C&module=mql4_module_forum

It'll take until retirement to disassemble it... :-)))


Who is prohibiting the questioner to create his own branch
 

Hi all!

I have a problem when using a sliding AMA, I got it from here https://www.mql5.com/ru/code/7378

I put the simplest code

double ama=iCustom(NULL,0,"AMA",0,0,0);
double ma=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE,0);

if (ama > ma){Opn_B=true;}
if (ama < ma){Cls_B=true;}

It does not work like in EA's terms and conditions. After the test, the AMA indicator itself appears with a period of zero.

But the period of the indicator itself is 9. I do not see any errors in the journal.

What am I doing wrong?

 
Forexman77:

Hi all!

I have a problem when using a sliding AMA, I got it from here https://www.mql5.com/ru/code/7378

I put the simplest code

It does not work like in EA's terms and conditions. After the test, the AMA indicator itself appears with a period of zero.

But the period of the indicator itself is 9. I do not see any errors in the journal.

What am I doing wrong?

Between 3 (indicator name) and the last two parameters you specify the indicator parameters you want, you pass in the fourth parameter 0, which is what you get. If the default is

double ama=iCustom(NULL,0,"AMA",0,0);
 
GSB:

Between 3 (indicator name) and the last two parameters you specify the indicator parameters you want, you pass in the fourth parameter 0, which is what you get. If the default is



Thank you! It worked!

How to transfer a period for optimisation through the EA to the indicator?

 
skyjet:

Hello! Having EAs on a previous version of MetaTrader I upgraded the terminal. After that I went back to 509. So the EAs have "been" in 60... Bild, they returned to the terminal version they were written on.

The question is: What to do with those EAs that stop opening deals in the Strategy Tester after "coming back" and those that cannot be tested anymore (the start button in the Strategy Tester simply does not respond to a click)?


Since no one answers, I will rephrase the question - what should be done in the Expert Advisor, written for 509 build, so that it works correctly on the new platform?
 
Forexman77:


Thank you! It works!

How to pass a period for optimisation through the EA to the indicator?

In iCustom() there are parameters that you pass to the indicator from 4 onwards according to their quantity in the indicator, the last two parameters are reserved for the indicator buffer number and shift relative to 0 (last) bar

extern int opt = 9;
void OnTick()
{
double ama=iCustom(NULL,0,"AMA",opt,0,0);
}

Like this for 4 parameters!

extern int periodAMA=9; 
extern int nfast=2; 
extern int nslow=30; 
extern int G=2; 

double ama0=iCustom(NULL,0,"AMA",periodAMA,nfast,nslow,G, 0,0); // на нулевом баре
double ama1=iCustom(NULL,0,"AMA",periodAMA,nfast,nslow,G, 0,1); // на первом баре

 

I am eating to write the Binet formula in µl, tell me what is wrong with me,

int FiboN = MathRound((1/MathSqrt(5))*(MathPow(((1+MathSqrt(5))/2),N)-MathPow(((1-MathSqrt(5))/2),N)));
Thank you
 
skyjet:

Since no one is answering, I'll rephrase the question - what should I do in an EA written for 509 build to make it work correctly on the new platform?
Not to compile it in builds older than 509... Just put the file compiled in 509 build into the appropriate folder in the new build.
 
GSB:

In iCustom() there are parameters that you pass to the indicator from 4 onwards according to their quantity in the indicator, the last two parameters are reserved for the indicator buffer number and shift relative to 0 (last) bar

Like this for 4 parameters


Thanks, I checked it with the script it works!

And in general, when using two AMA, is it possible to pass two different periods from the Expert Advisor during optimization?

 
Forexman77:


Thank you, I checked with the script and it works!

Is it at all possible to transfer two different periods from an EA when using two AMA's, when optimising?

Yes.