[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1057

 
eddy:

I change declaration int Pos[k] to double Pos[k] - outputs 33.00000000, why int array does not work?


eddy:
well the only logical point of his post is that he assumed I hadn't read the textbook

If you read it, you would know WHAT


In MQL4 expressions, only implicit type conversions are used. The types are prioritized in ascending order during conversion:

int (bool,color,datetime); double; string;

Before operations (except for assignment operations), a conversion to the type with the highest priority is performed, and before assignment operations - to the target type.

Examples:

int i = 1 / 2; // no type conversion, result: 0 int i = 1 / 2.0; // expression is converted to type double, then converted to target type int, result: 0 double d = 1 / 2; // int type expression is converted to target type double, result: 0.0 double d = 1.0 / 2.0; // no type conversion, result: 0.5 double d = 1 / 2.0; // expression is cast to the double type, which coincides with the target type, result: 0.5 string s = 1.0 / 8; // expression is cast to the double type, then it is cast to the target string type, result: "0.12500000" (string containing 10 symbols) string s = NULL; // the constant of int type is cast to the target type string, the result: "0" (string containing one symbol) string s = "Ticket #"+12345; // the expression is cast to the type string, which coincides with the target type, the result: "Ticket #12345".

Type conversion applies not only to constants, but also to variables of different types.

 
What does type conversion have to do with it if I assign an int-value to an int-array and use int-variables in calculations?
 

eddy:

the standard codbase RSI, which is the ratio of the average of positive changes to the average of negative changes, is not the same

the real, original RSI, which is the ratio of the sum of positive changes to the sum of negative changes.

although I don't claim that my version is correct, although I've known and understood it for years, unlike the codebase one.

i think everyone who has been in the market for a long time knows that rsi is sumpos/sumneg*100

>
 
eddy:

What does type conversion have to do with it if I assign an int-value to an int-array and use int-variables in calculations?

  Alert(Pos[k],"=("+vol+"-"+telo+")/2"); 
//выводит 0=(72-6)/2
you're dividing the int-.... and that's
int i = 1 / 2; // no type conversion, result: 0
 

I divide an even number by 2. And I divide an int by an int.

that's it, it turns out. the indicator buffer can only be double

 
can the terminal be reinstalled leaving everything as it is (graphs etc.), if so how?
 
suffer... - you won't get anything
 
good people have already explained it to me)
 
Aleksander:

you're sharing the int.... and this.

int i = 1 / 2; // no type conversion, result: 0
He was dividing int 66 by int 2 ... So ... And the man himself understood the indicator buffers, and this says a lot about who and what, and where it shines, and who just boasts of his "knowledge". Do not be so obvious in your ignorance and rudeness in dealing with people ... And something will shine for you.
 
eddy:
Can I reinstall the terminal but leave everything as it is (charts, etc.), if yes, how?


Like reinstalling Windows, save all your "precious" files and reinstall MT4 at least every day.

If this option seems complicated (you don't know which files to save), try another way:

Rename the folder with today's MT4 to, say, "ARCHIVE" and install a new copy of MT4. Later, from the "ARCHIVE" folder, you will drag and drop the files you need into the new MT4 and put them in the appropriate folders.

Everything is very simple.