Errors, bugs, questions - page 1304

 
ns_k:
Build 1100 of 20.03.2015. Code compiles fine, wanted to get rid of the warnings. Basically, the warnings themselves don't bother me, but I was confused by the fact that there is no DoubleToInt, which the compiler seems to be hinting at by generating"possible loss of data due to type conversion" :)

In this situation it is unnecessary to normalise the value of the real type to 0 decimal places, because it is normalised^

1. A value of the real type to 0 decimal places, the result of which will anyway be cast to int type explicitly or implicitly, and everything after the decimal point will be ignored in any case.

2) This is an unnecessary operation for processor, it's enough to use explicit type conversion:

lSign = (int)(MathAbs(xPosition.Profit())/xPosition.Profit());

And for future, to understand the topic, look through the reference section on type conversions. If it is not enough, the Internet is full of information about type conversions in C and C++ :)

PS. about xPosition.Profit() I understand this is a call to a method of a class object, if there are no warnings on it.

 

The task is to delete the file if it is larger than required

   if(FileSize(file_handle)>1024) // 1 megabyte [MB] = 1048576 byte // 2 megabyte [MB] = 2097152 byte
      FileDelete(InpFileName);

But the file keeps growing ... And it is not deleted ...

 
VOLDEMAR:

The task is to delete the file if it is larger than required

But the file keeps growing ... And it is not deleted ...

The file has to be closed first. And then delete ...
 
stringo:
The file has to be closed first. And then delete it.
Tried, file_handle then -1 and no return file size...
 
stringo:
The file has to be closed first. And then delete it.
All figured it out, at the moment of reading the record remembered the size, then after all if the size has grown then delete ...
 
_Konstantin_:

In this situation it is unnecessary to normalise the value of the real type to 0 decimal places, because it is normalised^

1. A value of the real type to 0 decimal places, the result of which will anyway be cast to int type explicitly or implicitly, and everything after the decimal point will be ignored in any case.

2) This is an unnecessary operation for processor, it's enough to use explicit type conversion:

And for future, to understand the topic, look through the reference section on type conversions. If it is not enough, the Internet is full of information about type conversions in C and C++ :)

PS. about xPosition.Profit() I understand it's a call to method of object of class, if there is no warning on it.

Thanks!

(int) is just what the doctor ordered :)

 

Gentlemen developers!

The substitution of method and property names is case insensitive, and that's good, but why should the substitution of the names of the variables themselves work differently?

Please make it all the same way!

Thank you!

ps. By the way, so are the function names. In general, it feels like everything after the dot is case insensitive, and everything first is not. For example, start typing Arrays - ArraySize won't show up in the list

 

I would like to know for sure what the difference between an Expert Advisor and an Expert Advisor is. Previously, I was convinced that the EA is engaged in auto-trading, while the EA only prompts signals to enter the market at the right time (hence the different structure of the main blocks of the program code). Then what lies along these lines:

\MQL5\Experts\Examples\MACD\MACD Sample.mq5,

\MQL5\Experts\Advisors\ExpertMACD.mq5?

They both trade as EAs automatically, but the second one is in the \Advisors folder, i.e. EAs.

 

Also, to the tooltips. The up arrow is supposed to move the cursor from the top line to the bottom line ;)

 

Can you explain how this can happen?

The header shows a period of 15 minutes, but the chart actually shows an hour

Reason: