Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 378

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
Can someone kindly tell me how to write the following thing.
I made a training indicator, which counts iVolume for each tick: iVolume is positive for those that moved up, and negative iVolume for those that moved down. To make a curve, all iVolume (positive and negative) I add increasing total from bar to bar. A curve is obtained. However, I encountered two problems:
1) the line turns out very broken;
2) it is impossible to test the Expert Advisor, because the obtained iVolume chart has only a real life.
Question:
1) how to describe the code that allows to build a chart based on averaged data that I write in the buffer?
2) Is it possible to write the data of this indicator (that is received in the real mode) to a certain file, so that later, referring to this file, we could build the indicator on the historical data, applying the already collected tick volumes to them? If possible, how to describe it programmatically? Or is there another solution that does not require writing current iVolume information to a file?
Maybe add at the end of the code:
double macurrent=iMAOnArray(Buf_1[0],0,5,0,MODE_LWMA,0);
Eh, no! The compiler generates the error saying there is no array.
Anyone....., can you help? My dead end for me is set out here:https://www.mql5.com/ru/forum/160683/page378#comment_6053255
Indicator based on data from file - entered this line in search and found
Some kind of nightmare, I don't understand why it gives out like this:
Code section :
line[0]=MathFloor(Low[1]*MathPow(10,D-1));
Print("Var ",DoubleToStr(line[0],D));
Print("Code ",DoubleToStr(MathFloor(Low[1]*MathPow(10,D-1)),D));
Output :
EURUSD,M15: Var 0.00000
EURUSD,M15: Code 11754.00000
What happens to the value after assignment?
line[0]=MathFloor(Low[1]*MathPow(10,D-1));
Print("Var ",DoubleToStr(line[0],D));
Print("Code ",DoubleToStr(MathFloor(Low[1]*MathPow(10,D-1)),D));
Print :
EURUSD,M15: Var 0.00000
EURUSD,M15: Code 11754.00000
What happens to the value after assignment?
Print the value of the variables after the assignment and the value of variable D. Use your calculator to do the math.
Hello all. Folks, could you please give us a little help? Could someone please set a line in the indicator where you can specify the name of the sound file, so that the line is displayed in the indicator settings.
Print out the values of the variables after assignment and the value of variable D. Let's calculate it on a calculator...
So I print out the value of the variable after the assignment. So the code is basically the following:
a=b;
Print (a);
Print (b);
But a equals zero and b is printed correctly
This is how I output the value being assigned. So the code is essentially as follows:
a=b;
Print (a);
Print (b);
But a equals zero while b is printed correctly
I do not see zero, you have made a mistake somewhere