Errors, bugs, questions - page 1701

 
pako:
Are there fish in the tikes?
That's what I want to find out.
 
fxsaber:
That's what I want to find out.

It only makes sense to try it on some lmax. And even that is questionable.

Have you tried volumes, sentiment, glass? For me it tastes better. My favourite trades are on the tape and the glass, but I can't find anything like that on forex.

 
Комбинатор:

It only makes sense to try it on some lmax. And that's doubtful.

Have you tried volumes, sentiment, glass? For me it tastes better. My favourite trading is with Ribbon and Gauge, but there is nothing like that on forex.

I want to try the Exchange. Somehow it's all clear to me so far what to do there. And it is not clear why it is not done even in the form of indicators.

Only bugs are slowing me down.

 
void OnStart()
  {
//---
   Print("-----------------------------   ");
   Print("DBL_MAX= ", DBL_MAX);
   Print("IntegerToString(int(DBL_MAX) )= ", IntegerToString(int(DBL_MAX) ) );
   Print("IntegerToString(uint(MathAbs(DBL_MAX) ) )= ", IntegerToString(uint(MathAbs(DBL_MAX) ) ) );
  }

I run a script like this

and get

DBL_MAX= 1.797693134862316e+308

IntegerToString(int(DBL_MAX) )= -2147483648

IntegerToString(uint(MathAbs(DBL_MAX) ) )= 0

------

Question: why do we actually get a negative number when converting a positive double number to int?

 
Print("-----------------------------   ");
   Print("DBL_MAX= ", DBL_MAX);
   Print("IntegerToString(int(DBL_MAX) )= ", IntegerToString(int(DBL_MAX) ) );
   Print("IntegerToString(uint(MathAbs(DBL_MAX) ) )= ", IntegerToString(uint(MathAbs(DBL_MAX) ) ) );
   Print("---");
   Print("int(DBL_MAX)= ", int(DBL_MAX) );
   Print("uint(DBL_MAX)= ", uint(DBL_MAX) );
Or so it's still the same.
 
fxsaber:
I filled out an application, even though I'm sick of doing it so often.
Answered and immediately closed

The author of the indicator deliberately coded the link to himself.

You can either ban this "hack" or leave it to the conscience of the one who uses it.

So far you are the first person who has been prevented from using the terminal by this feature for several years.

How many indicators can be executed in idle mode and we have no idea about them? There is no control at all.

I do not really understand the regular pathetics in your posts. Clearly, we are not talking about a massive or serious problem.

1) Only deliberately, consciously can you write an indicator with the specified behaviour. Who makes you write such a code and run such an indicator? Or do you run other programs without knowing their code?

2) It is no more malicious than many other indicators with less obvious logical errors.

3) When you restart the terminal, the indicator will be unloaded and will not start again. If you accidentally start such an indicator - restart the terminal. And don't run it again.

I should have a possibility to delete myself (the indicator) in case at least one copy is launched, even if it has different input parameters. To do this I needed to figure out the handle itself. Unfortunately, at that moment I didn't know yet that it's impossible in MQL in 100% of cases. I therefore decided to try a not very smart trick.

I went through all the handles. If it coincides with the random I wrote in my indicator before checking, it automatically means the handle belongs to me and I can delete myself, if necessary.

It was from these considerations that such harmless code was written, which caused such an ambiguous, but obviously negative reaction from the developers. You see, you can't do that. What did you do? Well, I read the value of my buffer through the CopyBuffer. Is it illegal?!

Let the community be aware that you can create in such a way a background uncontrollable execution of any code even on the terminal without charts. Here is a little tiptoe. Whether or not to consider it a bug is probably a matter of terminology. My understanding is that the developers are not able to change anything architecturally here. That is why there is such anger. I cannot explain this reaction in any other way.

No one will say anything anyway. Such a rake would be well reflected in the Help.

 
Если вы случайно запустили такой индикатор - restart the terminal. And don't run it again.
There's no way to know. There's no way!
 
Dmytro Zelenskyy:
Or it's still the same.

The int type has a size of 4 bytes. The double type has size 8 bytes. You must not do so - try to get 4 bytes from 8 bytes - you may end up with nonsense - especially in this case, when DBL_MAX value lies outside of int values.

If you take the number double d=123456.1258 and try to get int from it - then the number will work, but still, you cannot do it that way.

 
Karputov Vladimir:

The int type has a size of 4 bytes. The double type has size 8 bytes. You must not do so - try to get 4 bytes from 8 bytes - you may end up with nonsense - especially in this case, when DBL_MAX value lies outside of int values.

If you take the number double d=123456.1258 and try to get int from it, the number will work, but still you cannot do so.

Ok, how to correctly convert double to int with preservation of sign (the number does not matter, if it goes outside the limit then limit it to int)

 
Dmytro Zelenskyy:

OK, how to correctly convert double to int with the sign intact (the number does not matter, if it is outside the limit then limit it to int)

int

The integer int type has size 4 bytes (32 bits). The minimum value is -2 147 483 648, the maximum value is 2 147 483 647. Based on this,

   int A=(int)2147483647.0;
   int B=(int)2147483646.2;
   int C=(int)2147483647.2;
   int D=(int)2147483648.0;
   Print("A: ",IntegerToString(A),", B: ",IntegerToString(B),", C: ",IntegerToString(C),", D: ",IntegerToString(D));

see what is returned:

A: 2147483647, B: 2147483646, C: 2147483647, D: -2147483648

I think the principle is clear.


Reason: