Errors, bugs, questions - page 1812

 
Sergei Vladimirov:

"Doctor, I have something that hurts!" © )

Give me an example of such an expression. A reproducible one. Then you will be able to say something.

ulong PackMagic(int bs, int type, int frac, int ll)//bs=0 - sell, bs=1 - buy (в смысле ll), type - это тип FPST
     {
        int d1;
        ulong i, frac1=frac, ll1=ll, type1=type;
        
        i=1; d1=10;
        while (ll>=d1) {d1=d1*10; i=i+1;}
              
        if (type==0 || type==2) return (frac1+ll1*Pow10frac_length+i*Pow10(frac_length+i)+
         type1*Pow10(frac_length+i+1)+bs*Pow10(frac_length+i+2)+Id1_class*Pow10(frac_length+i+3));
        else return(ll1+i*Pow10(i)+type1*Pow10(i+1)+bs*Pow10(i+2)+Id1_class*Pow10(i+3));
     }    
    
     ulong Pow10(ulong power) // power>0
     {
        ulong r=10;
        if (power==0) return 1;
        for (ulong i=2; i<=power; i++) r=r*10;
        return r;
     }

The problem is in the PackMagic function. external variables int frac_length=2; int Pow10frac_length=100; int Id1_class=1;.

 
Sergey Kudryavtsev:
The problem is in the PackMagic function. external variables int frac_length=2; int Pow10frac_length=100;.
You didn't provide an example of the error. At which argument values does this function return the wrong value (which one?) and what should be the correct result?
 
Sergei Vladimirov:
You didn't give an example of an error. At what values of the arguments does this function return the wrong value (which one?) and what should be the correct result?

For example:

Id1_class=1, bs=0, type=0, frac=99, ll=1, frac_length=2, Pow10frac_length=100, return returned 11299.

It should be 1001199. In Expert, functions in class, demo account in Open.

It's not a fact that 11299 will always be returned in case of an error.

 
Not reproducible. With these parameters, the function stably returns 1001199. There are no errors in the function itself either. So, there is nothing to say. Most likely, the problem in your Expert Advisor is not in this function, but somewhere else. The values of the parameters passed to the function are different from those you expect. Accordingly, the result is different from the expected one.
 

It's playing. Wrote your code to script, it gave correct value (1001199) when run in debug mode, but if I compile release and run it from tree in MT5, it gave 11199 steadily. I was able to localize the problem, here is the reproducing code:

int frac_length = 2;

void OnStart()
{
        
        ulong i = 1;

        ulong a1 = Pow10(frac_length + i);
        ulong a2 = Pow10(frac_length + i + 1);
        ulong a3 = Pow10(frac_length + i + 2);
        ulong a4 = Pow10(frac_length + i + 3);
        
        Print(IntegerToString(a1), " ", IntegerToString(a2), " ", IntegerToString(a3), " ", IntegerToString(a4));

}  

ulong Pow10(const ulong power)
{
        ulong r = 10;
        
        if (power == 0)
                return 1;
                
        for (ulong i = 2; i <= power; i++)
                r = r*10;
                
        return r;
}

In debug mode it works correctly. But at start of release from navigator in MT5 either it produces nonsense ("1000 10000 100 100 100" instead of "1000 10000 100000 1000000") or MT5 hangs with full load of one of cores of the processor.

There are two ways to fix it. Either of these ways:

        ulong a1 = Pow10(frac_length + i);
        ulong a2 = Pow10(frac_length + i + (ulong)1);
        ulong a3 = Pow10(frac_length + i + (ulong)2);
        ulong a4 = Pow10(frac_length + i + (ulong)3);

Either by moving global variable frac_length inside Start() function.

This is indeed a compiler bug, write to Service Desk.

 
MT4 started to weigh 1.8 gigabytes (RAM). It ate all the UPU, the second terminal cannot be switched on properly. Can you tell me how to "clean" the RAM from MT?
 

When hovering over a just published own review for a Market product, several suggestions/actions appear. If you select "edit" and change the review, a "No rights" error will pop up after clicking on "Update".

Application to the SR cannot be created -An error has occurred.

 
fxsaber:
When hovering over a just published own review for a Market product, several suggestions/actions appear. If you select "edit" and change the review, the "No rights" error pops up after clicking on "Update".

Please specify the name and version of your browser.
On chrome 56.0.2924.87 the flight is fine, both with and without manually refreshing the review page.

 
fxsaber:

Application to the SR cannot be created -An error has occurred.

I see, you need to clear the cookies for www.mql5.com.
Apparently there has been an update to the anti-cSRF token checking principles.

In chrome, you can do it like this:
Press F12 while on www.mql5.com => in dashboard go to Application => Cookies => click on cookies => Clear all from...
 
Sergey Dzyublik:

Please specify the name and version of your browser.
On Chrome 56.0.2924.87 the flight is fine, both with and without manually refreshing the review page.

Portable ChromeVersion 45.0.2454.85 + Frigate.
Reason: