[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
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I change declaration int Pos[k] to double Pos[k] - outputs 33.00000000, why int array does not work?
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:
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.
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
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?
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
you're sharing the int.... and this.
int i = 1 / 2; // no type conversion, result: 0
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.