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

 

Good day all!
I am switching from MT4 to MT5. I wrote a simple code. Executed it. EA opened all trades that were coded.... It seems to me at first glance.
But ....Backtest history quality shows 0 . Q: Is it supposed to be like this with my settings? If the history quality bar should be green. What should I do to achieve it.

Note: When I test my code for a period of 10 years, the history quality shows 10%. I have not found any red error icons in the log. I rebooted МТ5, but it didn't help. The history quality is 100% (green bar) and only for 2020 and 2019.

Thank you all in advance for your help


Files:
20201105.log  6159 kb
 
ANDREY:

Good day all!
I am switching from MT4 to MT5. I wrote a simple code. Executed it. EA opened all trades that were coded.... It seems to me at first glance.
But ....Backtest history quality shows 0 . Q: Is it supposed to be like this with my settings? If the history quality bar should be green. What should I do to achieve it.

Note: When I test my code for a period of 10 years, the history quality shows 10%. I have not found any red error icons in the log. I rebooted МТ5, but it didn't help. The history quality is 100% (green bar) and only for 2020 and 2019.

Thank you all in advance for your help


There is no way to change the quality in MT5. Only create your own symbol and fill it with verified quotes. Or try another brokerage company.
 
Does anyone have a ZigZag transferred to an EA without iCustom? Thank you!
 
makssub:

Good afternoon everyone.

Can you tell me how to find with maximum profit or loss, among open orders.

In MQL4


double  Max_Proftit, Min_Profit;
int     Ticket_Max_Proftit, Ticket_Min_Profit;
//+------------------------------------------------------------------+
void Profit()
  {
   for(int i = OrdersTotal() - 1; i >= 0; i--)
     {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false)
         break;
        {
         if(Max_Proftit < OrderProfit())
           {
            Max_Proftit = OrderProfit(); //Максимальный профит
            Ticket_Max_Proftit = i;      //Номер одера с максмилаьной прибылью
           }
         if(Min_Profit > OrderProfit())
           {
            Min_Profit = OrderProfit();
            Ticket_Min_Profit = i;
           }
        }
     }
  }
//+------------------------------------------------------------------+
This is among the open orders. NOT CLOSED!
 
Александр:


This is among open orders. NOT CLOSED!

The initial values you forgot to set were minimum profit 1000000, maximum profit 0. Otherwise the minimum will always be 0, if it is initially initialised 0.

 if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false)
 continue; //   break; брейк выйдет из цикла насовсем, а нам нужно продолжить цикл на след. итерации
 
Александр:
In my opinion, there is no way to change the quality in MT5. I have to create my own symbol and fill in tested quotes. Or try another brokerage company.

Thanks for the tip

If I load verified quotes into my symbol, does Alpari have them and if so, where and how can I get or buy them?

What do you mean by verified quotes? Do I have to check them? Or has Alpari verified them and I have to trust this verification?
Thanks in advance for your help.

 
Valeriy Yastremskiy:

The initial values you forgot to set were minimum profit 1000000, maximum profit 0. Otherwise the minimum will always be 0, if it is initially initialised 0.

This is correct.
 

 if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false)
 continue; //   break; брейк выйдет из цикла насовсем, а нам нужно продолжить цикл на след. итерации

If there are no open orders, then let it go out. Or? I don't understand...

 
ANDREY:

Thanks for the tip

If I load verified quotes into my symbol, does Alpari have them and if so, where and how can I get or buy them?

What do you mean by verified quotes? Do I have to check them? Or has Alpari verified them and I have to trust this verification?
I am grateful in advance for the help.

I'm tormented by this problem myself, and would buy for the major pairs too.... As it is... So far I know only Alpari and Dukascopy. Their quotes are more or less good.

If you want to get Alpari quotes for MT5, you have to download their terminal. Create an account there and download it.

 
Александр:

I'm struggling with this problem myself. I'd buy it for the main couples too... And so far... So far I only know Alpari and Dukascopy. They have more or less good quality.

I want to get Alpari quotes for MT5, just download their terminal. Create an account and download it.

That's exactly what I did. So I have no worries about the quality of their (Alpari's) quotes....
One more thing. I just started to use MT5. I realised that if I choose REAL TICKS based modelling then when I test my Expert Advisor, I get REAL spread at trade close, i.e. like when I trade on a real account.

QUESTION 1. With this simulation method, is slippage at market close also considered on the REAL account?

QUESTION 2 If the simulation method is all ticks, is the spread considered as on REAL account?

Q3 If all ticks are simulated using simulation method, slippage is considered like on REAL account
Thanks for your help
.

Reason: