Errors, bugs, questions - page 2447

 

error in strategy tester during optimisation.

"task rejected bytester agent".

For example if your account currency is EUR,

  • EURJPY No problem
  • Error on GBPJPY


If your account currency is USD

  • USDCAD No Problem
  • USDJPY No problem
  • Error at EURAUD


appears when other currency pairs are used in the code.

In my example it's using calculation of dynamic lot

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
   if(DynamicLot)
     {
      if(SymbolInfoDouble(sym,SYMBOL_ASK)!=0)
        {
         if(Valdepo=="USD" || Valdepo=="USC")
           {
            if(StringSubstr(sym,0,3)=="USD")Lot2=BalanceFreeMargin*LotBalancePercent*AccountInfoInteger(ACCOUNT_LEVERAGE)/100/SymbolInfoDouble(sym,SYMBOL_TRADE_CONTRACT_SIZE);
            else if(StringSubstr(sym,3,3)=="USD")Lot2=BalanceFreeMargin*LotBalancePercent*AccountInfoInteger(ACCOUNT_LEVERAGE)/SymbolInfoDouble(sym,SYMBOL_ASK)/100/SymbolInfoDouble(sym,SYMBOL_TRADE_CONTRACT_SIZE);
            else
              {
               pr=SymbolInfoDouble(StringSubstr(sym,0,3)+"USD"+prefix,SYMBOL_ASK);
               if(pr!=0)Lot2=BalanceFreeMargin*LotBalancePercent*AccountInfoInteger(ACCOUNT_LEVERAGE)/pr/100/SymbolInfoDouble(sym,SYMBOL_TRADE_CONTRACT_SIZE);
               else
                 {
                  double Margin=0;
                  OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1,SymbolInfoDouble(Symbol(),SYMBOL_ASK),Margin);
                  if(Margin!=0)Lot2=BalanceFreeMargin/Margin/100*LotBalancePercent;
                 }
              }
           }
         else

         if(Valdepo=="EUR" || Valdepo=="EUC")
           {
            if(StringSubstr(sym,0,3)=="EUR")Lot2=BalanceFreeMargin*LotBalancePercent*AccountInfoInteger(ACCOUNT_LEVERAGE)/100/SymbolInfoDouble(sym,SYMBOL_TRADE_CONTRACT_SIZE);
            else
              {
               pr=SymbolInfoDouble("EUR"+StringSubstr(sym,0,3)+prefix,SYMBOL_BID);
               if(pr!=0)Lot2=BalanceFreeMargin*LotBalancePercent*AccountInfoInteger(ACCOUNT_LEVERAGE)*pr/100/SymbolInfoDouble(sym,SYMBOL_TRADE_CONTRACT_SIZE);
               else
                 {
                  double Margin=0;
                  OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1,SymbolInfoDouble(Symbol(),SYMBOL_ASK),Margin);
                  if(Margin!=0)Lot2=BalanceFreeMargin/Margin/100*LotBalancePercent;
                 }
              }
           }



i.e. when EA is requesting price of another currency.

 
Nikolai Semko:

Well then you need a competent reasoning for MQ.
What is it for? How and in what cases can it enhance mql capabilities? And not just to satisfy a personal whim.

Let's say you write EA manager. Now two identical EAs with different names cannot be recognised as the same.

For example, you need to determine if the EA and its clone have been run before.

Well, this happens when there are a lot of charts and EAs. And something is launched again by mistake.

 

Dear developers, please explain why I periodically get an error when copying the current bar date in the indicator to the buffer?

2019.04.26 12:12:39.811 i-Regr4_05i (Si-6.19,M1)        Failed to copy data from the handle_Regressor indicator, error code 4401
   datetime Arr[],time1;
   if(CopyTime(symb,0,0,1,Arr)<=0)
   {
   PrintFormat("Failed to copy data from the handle_Regressor indicator, error code %d",GetLastError());
   return(0);
   }

In winter there was no such error - indicators worked consistently for a month, but in the new builds I started to see it.

 
Thank you!
 
Mykhailo Ohorodniichuk:

Help me solve this problem. how can i get normal characters to be transmitted instead of the current one?

Google chcp command

chcp 1251 - windows-1251

chcp 65001 - utf-8

...

 
fxsaber:

Let's say you write EA manager. Now two identical EAs with different names cannot be recognised as the same.

For example, you need to determine if the EA and its clone have been run before.

Well, this happens when there are a lot of charts and EAs. And you run something by mistake again.

I see...

But I'm still leaning towards the following formula: not more than one Expert Advisor per one trading account. It makes more sense. Even if there are several strategies you want to combine, you should do it within the framework of one Expert Advisor. In this case, you don't need an EA manager. Moreover, once again, a different hash is not a guarantee that the EA is dissimilar, even if it is the developers' native internal hash.

And if we want to check at the moment of launching an EA if some other EA is launched on this account by accident, in order to prevent and further allow the operation of a new EA in order to avoid possible conflicts, it can be easily solved by regular functions and the sameness check is not needed here.

 
Nikolai Semko:

I see...

But I'm still leaning towards the following formula

So what does your personal preference have to do with it? It's about MT5 in general.
 
fxsaber:
So what does this have to do with your personal preferences? It's about MT5 in general.
I doubt very much that anyone apart from you would think of creating an EA manager. ))
 
Nikolai Semko:
I doubt very much that anyone apart from you will ever think of creating an EA manager. ))

Why? It's a very good and handy thing to do.

I have to use profiles for now, but they have a lot of limitations.

 
Andrey Khatimlianskii:

Why? It's a very good and handy thing to do.

I have to use profiles for now, but they have a lot of limitations.

Andrei, I don't understand about the profiles.

Reason: