[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 996
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Techno totally agree with you, but I'm asking you to come from a thread and not somewhere else.
Any question from a beginner, so as not to clutter up the forum. Professionals do not go by. There is nowhere without you.
moderators may leave it on a separate thread if the discussion does not fit into the main thread.
And then the case is purely voluntary, I'm not asking to write for me all the work, and as I said above, I'm learning, and I think that those newcomers who are just joining, too, learn a lot,
Techno totally agree with you, but...
So far, judging from the above written ToR, you propose to have everything written for you. The topic is designed for questions that beginners have during programming and training, not for fulfilling all their desires)
I want to rewrite my EA from mq4 to mq5. Can you advise how much faster the EA will be tested and optimized in mq5?
So if everyone agrees with the terms of reference and all clear, then proceed. First I attach all the template files
Why so complicated?
Why so complicated?
Let's start with the Criterion function
To determine the channel we will use the ZigZag indicator, respectively, let's set its parameters,
//--------------------------------------------------------------------
// Criterion.mqh
//--------------------------------------------------------------- 1 --
// Функция вычисления торговых критериев.
// Возвращаемые значения:
// 10 - открытие Buy
// 20 - открытие Sell
// 11 - закрытие Buy
// 21 - закрытие Sell
// 0 - значимых критериев нет
// -1 - используется другой финансовый инструмент
//--------------------------------------------------------------- 2 --
// Внешние переменные:
eextern int ExtDepth=12;
extern int ExtDeviation=5;
extern int ExtBackstep=3;
//-----------------------------------------------------------------------
int Criterion() // Пользовательская функция
{
string Sym="EURGBR";
if (Sym!=Symbol()) // Если не наш фин. инструмент
{
Inform(16); // Сообщение..
return(-1);
} // .. и выход
double
High,
Low ;
//------------------- Параметры технич. индикат: -------------------
High =iCustom (NULL,0, "Zigzag",ExtDepth,ExtDeviation, ExtBackstep,1,bar);
Low = iCustom (NULL,0, "Zigzag",ExtDepth,ExtDeviation, ExtBackstep,2,bar);
int TicSpred=100;
double Spread[1000];
if (Spread[0]==0) {ArrayInitialize(Spread,(Ask-Bid)/delta);}
for (int q=TicSpred;q>0;q--){
if (Spread[q]==0) Spread[q]=(Ask-Bid)/delta;}
for (q=TicSpred;q>0;q--) {Spread[p]=Spread[p-1];}
Spread[0]=(Ask-Bid)/delta;
double CountedSpred;
for (q=0;q<bars;q++){CountedSpred=CountedSpred+Spread[p];}
//--------------------------------------------------------------- 5 --
// Вычисление торговых критериев
if (Bid <= Low && Ask< High -CountedSpred/2*delta )
return(10);
if ( Bid>= High )
return(20);
// Calculation of trading criteria
if (Bid <= Low && Ask< High -CountedSpred/2*delta)
return(10);
if ( Bid>= High )
return(20);
Here I got stuck. According to the task we should first obtain the history of average spread, how should I do that?
I want my 100 cell array to be filled completely