Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 379
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 don't see zero, you've messed up somewhere.
Do both printers give the same values?
Because there are no Print functions in my code and these lines follow one after another, so the values don't change in any way.
But Var gives 0 and Code gives the needed value
But I output the value I'm assigning right away. So the code is essentially as follows:
a=b;
Print (a);
Print (b);
But a equals zero while b is printed correctly
It is possible if int a and double b>0 and b<1 when assigning a real value to an integer variable, the fractional part is discarded
This is possible if int a and double b>0 and b<1 when assigning a real value to an integer variable, the fractional part is discarded
b is greater than one much greater than one
a is an array of type double
The problem has been solved.
I created the array in the following way:
double line[];
With this option, when assigning line[0]=x; the null element still appeared to be empty.
When I wrote
double line[20];
Everything is working as it should. I don't understand why, in the first case I simply created an unbounded array; what is the difference?
The problem has been solved.
I created the array in the following way:
double line[];
With this option, when assigning line[0]=x; the null element still appeared to be empty.
When I wrote
double line[20];
Everything is working as it should. I don't understand why, in the first case I simply created an unbounded array; what is the difference?
You have created a dynamic array, while its size should be set and controlled by yourself.
You have created a dynamic array, but you need to set and control the size yourself.
Is no one there to help? The dead end for me is set out here:writing the current iVolume informationto the file?
The software code is described here:https://www.mql5.com/ru/forum/160683/page378#comment_6053255
Indicator by data from file - entered this line in the search and found
To retrieve data from a file, you must first fill it in.
Ow... Good people! Help, please! I'm learning how to program. Without your help it's a deadlock.
I am trying to write the indicator data into a file, so I can use it later to build an indicator. The indicator is drawn as a line based on the difference between the volume of positive ticks and volume of negative ticks for the current bar.
I used MQL4 Reference to receive information about how to upload a data array to a file. I have ended up with a code full of errors. I cannot understand the essence of errors, and in general I have not used correctly the hint from the reference book or not. Can anyone help?
If you think that someone looking at your code can quickly find an error, you are mistaken. The compiler looks for errors. The program text should be formatted - MetaEditor has a styling tool for that. If you like a different style - use, for example, the AStyle.exe program. After styling, you will quickly see that the program 1) has an extra closing parenthesis. 2) Declared variable: datetime date_Buf_1; // indicator date array - for this to be an array, it must be [size] or [] for a dynamic array and then the size must be set to ArrayResize it seems. And you have to do it before you use an array - see above posts about it. 3) FileOpen(InpDirectoryName+"//"+InpFileName - seems like the sticks should be tilted in the other direction. And you'd better do without InpDirectoryName+"//" - you will find the file in the Files folder anyway.
on line: int copied=CopyTime(NULL,0,0,0,date_Buf_1); the compiler gets angry, start=end=0 number=0