Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1891

 
Tretyakov Rostyslav #:

This will speed things up...why double check the same thing.

By the way, you posted two different functions

и

Is that how it works?

I checked it now and without this condition the EA closes poorly, so I can't do without it

 
Vitaly Muzichenko #:

Please help me!

I'm not getting what I'm expecting at all. I need to read the log file.

Should have started here:

#include <WinAPI\\fileapi.mqh>
 
EVGENII SHELIPOV #:

I checked it now and without it the Expert Advisor closes poorly, so there is no way to do it without it.

So they're not the same.

               if(CalculiteProfitMinMaxPenultimateOrders() >= 0 && OrderGroupCloseSignal()==0 &&
                  Drawdown >= DrawdownClosingMinMaxOrders && FindPenultimateProfit() > 0)
               if(CalculiteProfitMinMaxPenultimateOrders() >= 0 && OrderGroupCloseSignal()==1 &&
                  Drawdown >= DrawdownClosingMinMaxOrders && FindPenultimateProfit() > 0)
 
Иван the FileSeek function were unsuccessful.
My intellect is not enough to understand the reason for this. Please explain what the hell is going on.

Well? Anybody got a clue?

 

Friends, please help.

I have a multicurrency EA I wrote in mql4. In the tester of course it does not work. I have decided that I should switch to mql5.

I have adapted all the compiler errors and fixed them. , except for the use of technical indicators. I have very little idea what to do with my head. The documentation is incomprehensible and covers two pages. Maybe I am looking in the wrong place.

One line of code in mql4 as follows

double MA1EURGBP_TF = iMA("EURGBP",15,MA1_Period,0,MODE_EMA,PRICE_OPEN,0);

or

double Stoch_M_GBPUSD=iStochastic("GBPUSD", Stoch_Period, K_Period, D_Period, Slowing, MODE_EMA, 0, MODE_MAIN, 0);

According to the documentation, the entire page of code changes in mql5. Handles, buffers, arrays with parameters, this to init, this to calculate, error handling during handle creation... this is crazy... Maybe I'm looking in the wrong place.

And if I use several pairs and several timeframes, I get "War and Peace" there.

 
Sergey Dymov a multicurrency EA I wrote in mql4. In the tester of course it does not work. I have decided that I should switch to mql5.

I have adapted all the compiler errors and fixed them. , except for the use of technical indicators. My head is soaking in flames that I have no idea what to do with it. The documentation is incomprehensible and covers two pages. Maybe I am looking in the wrong place.

One line of code in mql4 as follows

double MA1EURGBP_TF = iMA("EURGBP",15,MA1_Period,0,MODE_EMA,PRICE_OPEN,0);

or

double Stoch_M_GBPUSD=iStochastic("GBPUSD", Stoch_Period, K_Period, D_Period, Slowing, MODE_EMA, 0, MODE_MAIN, 0);

According to the documentation, the entire page of code changes in mql5. Handles, buffers, arrays with parameters, this to init, this to calculate, error handling during handle creation... this is crazy... Maybe I'm looking in the wrong place.

And if I use several pairs and several timeframes, I get "War and Peace" there.

int handleSQ=-1;
double BufferSQ[1];
int OnInit()
{

  handleSQ=iCustom(Symbol(),PERIOD_CURRENT,"squares",Period1,Period2,Period3,Dev_Step_1,Dev_Step_2,Dev_Step_3);
  if(handleSQ<0) {
    return(INIT_FAILED);
    Print("handleSQ = ",handleSQ,"  error = ",GetLastError());
  }
//---
  return(INIT_SUCCEEDED);
}

void OnTick()
{

    int copy=CopyBuffer(handleSQ,0,1,1,BufferSQ);
    if(copy<0) Print("Неудачная попытка копирования Squares");
    u1=BufferSQ[0];//iCustom(Symbol(),PERIOD_CURRENT,"squares_v2",Period1,Period2,Period3,Dev_Step_1,Dev_Step_2,Dev_Step_3,i);
 
Vitaly Muzichenko #:

Thank you. I'll work with that. The handbook's a mess.

 
Sergey Dymov #:

Thank you. I'll work with that. The handbook's a mess.

It seems to be adapted...

Everyone says that mql5 is faster than mql4. Then I have a question. Why has the same Expert Advisor been executed in 164 ms on mql4 and 527 ms on mql5? What could be the problem?

 
Sergey Dymov #:

The adaptation seems to have worked...

Everyone says that mql5 is faster than mql4. Then I have a question. Why does the same Expert Advisor run in 164 ms on mql4 and 527 ms on mql5? What could be the problem?

With what and how have you measured the performance?

 
Sergey Dymov a multicurrency EA I wrote in mql4. In the tester of course it does not work. I have decided that I should switch to mql5.

I have adapted all the compiler errors and fixed them. , except for the use of technical indicators. I have very little idea what to do with my head. The documentation is incomprehensible and covers two pages. Maybe I am looking in the wrong place.

One line of code in mql4 as follows

double MA1EURGBP_TF = iMA("EURGBP",15,MA1_Period,0,MODE_EMA,PRICE_OPEN,0);

or

double Stoch_M_GBPUSD=iStochastic("GBPUSD", Stoch_Period, K_Period, D_Period, Slowing, MODE_EMA, 0, MODE_MAIN, 0);

According to the documentation, the entire page of code changes in mql5. Handles, buffers, arrays with parameters, this to init, this to calculate, error handling during handle creation... this is crazy... Maybe I'm looking in the wrong place.

And if I use several pairs and several timeframes, i get "War and Peace" there.

In 4ka, the informative part should work with other symbols, the order part doesn't. But we should first load the required symbols into the quote archive. It didn't work before. It will work for the depth of loading the archive by a symbol. You can see the date in the archive.

Reason: