New MetaTrader 5 Platform Build 5260: Enhancements in Algo Forge, extended OpenBLAS support, and new inheritance rules in MQL5 - page 5

 
fxsaber #:
It has always been this way and it is correct. You can address your BMPs in abbreviated form, and other people's - by full name. The window shows the full name.

I am referring to the On/Off flag. When setting the BMP for On state, it actually applies it to the off state.

Even if it has been like that, it is not correct, and I am certain, it hasn't been like that for quite some time.
 
Dominik Egert #:

Something is a bit broken when it comes to chart objects at the moment.

Setting the parameters of the OBJ_BITMAP_LABEL is not working properly:


EDIT:

Only when setting the params like shown, it is as expected, but not as it should be done. 

As a sidenote, I know reporting bugs via Screenshots is a very bad habit, but I want to see how my reports are being treated before putting in the full effort of reducing the amount of work on MQs side. - Please bear with me for now.

The problem is not the screenshot, it's what you are reporting is not clear, at least for me.

 
@Dominik Egert #Something is a bit broken when it comes to chart objects at the moment. Setting the parameters of the OBJ_BITMAP_LABEL is not working properly:

There is no bug. You are using it incorrectly. The ObjectSetString()'s 4th parameter is not a "bool", it is an "int" (0 for "On", 1 for "Off").

bool  ObjectSetString(
   long                            chart_id,          // chart identifier
   string                          name,              // object name
   ENUM_OBJECT_PROPERTY_STRING     prop_id,           // property
   int                             prop_modifier,     // modifier
   string                          prop_value         // value
   );

The following sample code is taken from the example in: Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_BITMAP_LABEL

//--- set the images for On and Off modes
   if(!ObjectSetString(chart_ID,name,OBJPROP_BMPFILE,0,file_on))
     {
      Print(__FUNCTION__,
            ": failed to load the image for On mode! Error code = ",GetLastError());
      return(false);
     }
   if(!ObjectSetString(chart_ID,name,OBJPROP_BMPFILE,1,file_off))
     {
      Print(__FUNCTION__,
            ": failed to load the image for Off mode! Error code = ",GetLastError());
      return(false);
     }
 
Good day to all, it seems the toolbar issue on undocked charts has still not been fixed. Hiding toolbar at every MT5 start is taking quite some time.
 
Fernando Carreiro #:

There is no bug. You are using it incorrectly. The ObjectSetString()'s 4th parameter is not a "bool", it is an "int" (0 for "On", 1 for "Off").

The following sample code is taken from the example in: Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_BITMAP_LABEL

Fernando, thank you for pointing out my failure to RTFM. - Here, it is actually working as intended:



 

Good morning,

I have a problem with Metatester after the update.
On Metatrader, I clearly see my 56 available threads. However, when I try to share them on Metatester, this number drops to 28, as if only one processor was detected.

Could you please advise me on how to solve this problem?

Thanks in advance.



Auto-translation applied by moderator.

On the English forum, please write in English. Either use the automatic translation tool, or post in one of the other language forums.

 

Error with Margin Calculations with MetaTrader 5 Platform Build 5260

My risk management function has stopped working with the new build as the Margin Level return function now returns rubbish values, i Have had to shut down my whole trading setup because the margin calculation are now faulty.

Has anyone encountered this error and is there a fix ?

P.S: When i revert to the older build everything works fine again

Code Below:

bool func_MarginCheckPass () {
   double fMarginLevel = AccountInfoDouble ( ACCOUNT_MARGIN_LEVEL ) ;
   if ( fMarginLevel <= 0 ) { return true ; }
   if ( fMarginLevel >= fCuttOffLevel ) { return true ; }
   return false ; }

Improperly formatted code edited by moderator. Please always use the CODE button (Alt-S) when inserting code or log output.

Code button in editor

 

After updated to version 5260. StringFormat() function sometimes gives wrong result. And can't printf() function if string has % character.

void OnStart()
{
   printf("60 -> " + StringFormat("%%%02X", 60));
   printf("62 -> " + StringFormat("%%%02X", 62));
   printf("171 -> " + StringFormat("%%%02X", 171));
   printf("195 -> " + StringFormat("%%%02X", 195));
   printf("225 -> " + StringFormat("%%%02X", 225));
   
   string Text = "%3Ccode%3E%7BRaS%7D+0%2F2+++%7BMS%7D%7B1S%7D+%7B2S%7D%7B3S%7D%7B4S%7D+%7B6S%7D%7B8S%7D%7BMS%7D%7B1S%7D%7B2S%7D";
   string find = "%7B2S%7D";
   printf("Src: " + Text);
   printf(StringReplace(Text, find, ""));
   printf("Des: " + Text);
}

StringFormat() function error causes UrlEncode() function to always return NULL result. So can't send messages in Telegram -> Error: {"ok":false,"error_code":400,"description":"Bad Request: chat not found"}

string UrlEncode(const string text)
     {
      string result=NULL;
      int length=StringLen(text);
      for(int i=0; i<length; i++)
        {
         ushort ch=StringGetCharacter(text,i);

         if((ch>=48 && ch<=57) || // 0-9
            (ch>=65 && ch<=90) || // A-Z
            (ch>=97 && ch<=122) || // a-z
            (ch=='!') || (ch=='\'') || (ch=='(') ||
            (ch==')') || (ch=='*') || (ch=='-') ||
            (ch=='.') || (ch=='_') || (ch=='~')
            )
           {
            result+=ShortToString(ch);
           }
         else
           {
            if(ch==' ')
               result+=ShortToString('+');
            else
              {
               uchar array[];
               int total=ShortToUtf8(ch,array);
               for(int k=0;k<total;k++)
                  result+=StringFormat("%%%02X",array[k]);
              }
           }
        }
      return result;
     }

If change

result+=StringFormat("%%%02X",array[k]);

to

result+="%%" + StringFormat("%02X",array[k]);

Can't send messages in Telegram either -> Error: {"ok":false,"error_code":400,"description":"Bad Request: text must be encoded in UTF-8"}
I checked and found an error when processing the % character in the string.

 

My old project was compiled under version 5200 and could still send messages to Telegram normally. But when recompiled under version 5260, it reported an error {"ok":false,"error_code":400,"description":"Bad Request: chat not found"}

I checked and found that there is a change in the processing of the StringFormat() or StringReplace() function when the string to be processed contains the character %.

StringFormat("%%%02X", 
array[k] )
 
Yu Pang Chan #:

MQL5 Cloud Protector failed after this build launched, on both MT4 and MT5:

MT4 Message:

MT5 Message:

Is this my issue or is anyone facing the same?


Update:
For MT5, found that Windows Defender updates on 7 Sept blocked MQL5 Cloud Protector, have solved by Firewall settings.
For MT4, still getting failed message even no firewall at all.

Latest update:

MT4 Message: (My MT4 still unable to MQL5 Cloud Protect for 7 consecutive days, have tried (1) no firewall, (2) run as admin, still no luck, hope there will be any suggestion for that)

sending request to protector server error (3-3, #0)

MT5 Message: (My MT5 is 50/50 failing to be protected, which casued me 2x time for compilation, 1 minute compilation then failed protection, then 1 minute compile again then finally success, feels that the server may reject request or timeout too quickly)

request to protector server failed