Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 436
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
How can I russify my manual in the meta editor?
Simply russify the MetaEditor
View - Languages-Russian
You are completely confused... The current bar always has the number 0. And if the time has come, in your case another five minutes, the bar you examined a few seconds ago will already be number 1, and the new, newly formed one will get number 0.
But according to your code, with each new bar should be shifted by one......??
Maybe it's not the reel. How do you look at the log? In Metatrader? Try <Journal><Open> and then use standard Notepad to open the last file. I have encountered this sometimes, if there are a lot of messages in the log, MetaTrader does not show everything... Try
Thanks for the help.But I cannot understand what I am confused about.
Where is the error in the course of my thinking?
Agreed.The current bar always has the number 0.
But the current bar also has a number beginning from the leftmost bar on the chart (bar N1).
I.e. if there are 100 bars on the chart at the current moment, the current (zero bar) will be bar N100
And it is the predefined variable Bars that stores the value of the current (zero bar) 100
In the log (below)the current (zero) bar opened at 21:25 and has the serial number 255.
Exactly the value 255 from 21:25 to 21:28 is stored in the Bars variable.
And at 21:30 the Bars variable will take on a value of 266.
This seems obvious to me.
QUESTION: Why is it that if there is only one variable pY in the code, its value is updated EVERY 5 minutes (at the top)?
And if there are 2 variables in the code
their values are not updated EVERY 5 minutes.
Thanks for your help. But I can't figure out what I'm confused about.
Where is the error in the course of my thinking?
I agree. The current bar is always number 0.
But the current bar also has a number starting from the leftmost bar on the chart (bar N1).
I.e. if there are 100 bars on the chart at the current moment, the current (zero bar) will be bar N100
And it is the predefined variable Bars that stores the value of the current (zero bar) 100
In the log (below)the current (zero) bar opened at 21:25 and has the serial number 255.
Exactly the value 255 from 21:25 to 21:28 is stored in the Bars variable.
And at 21:30 the Bars variable will take on a value of 266.
This seems obvious to me.
QUESTION: Why is it that if there is only one variable pY in the code, its value is updated EVERY 5 minutes (at the top)?
And if there are 2 variables in the code
their values are not updated EVERY 5 minutes.
No, Bars gives you the total number of bars to analyse, it is incorrect to count from left to right and from right to left. If you want to analyse a particular bar, you must look for it by its opening time...
And it is the predefined variable Bars that stores the value of 100 of the current (zero bar).
It doesn't store the value, it stores the number of bars in the history....
Lots of standard functions plus not a few in kodobase...
P.S. Once again I strongly recommend, open the log file in Notepad, or any elementary editor....
No, Bars gives you the total number of bars to analyse, it is wrong to count from left to right and from right to left. If you want to analyse a particular bar, you have to search for it by opening time...
And it is the predefined variable Bars that stores the value of 100 of the current (zero bar).
It doesn't store the value, it stores the number of bars in the history....
Lots of standard functions plus not a few in the kodobase...
P.S. Once again I strongly recommend, open the log file in Notepad, or any elementary editors....
That is, if I understood you correctly, the variable Bars does not store every value of the bar, but ONLY the LAST one.
So, when 101 appears value of Bars variable, value 100 of Bars variable should LOSE AND SAVE NOWHERE.
This seems to be true, but then how do we explain the fact that in the Log, the value of the Bars variable increases
by one on each new candle.
The "zero devide" error comes up, does it mean that somewhere in the calculations something is divisible by zero? Or could it mean something else?
Yes, that's right, something is divisible by zero.
Look through your code where there is a division, check if the divisor can be zero. Often if you use MarketInfo(), the value can be zero,
That is, if I understood you correctly, the Bars variable does not store every bar value, but only the last one.
So, when 101 Bars variable value appears, value 100 of Bars variable must LOSE AND NOT SAVE ANYWHERE.
This seems to be true, but then how do we explain the fact that in the Log, the value of the Bars variable increases
by one on each new candle.
For those who are in the tank - the variable Bars stores the number of bars on the chart, with each new bar, if it does not exceed the maximum number of bars on the chart, the variable is incremented by one.
All other variables on the chart (Close, Open, etc.) use the bar number as a pointer in their array,
That is, if I understood you correctly, the Bars variable does not store every bar value, but only the last one.
So, when 101 Bars variable value appears, value 100 of Bars variable must LOSE AND NOT SAVE ANYWHERE.
This seems to be true, but then how do we explain the fact that in the Log, the value of the Bars variable increases
by one on each new candle.
I would like to wait till the opening))) 02:00 Moscow ....
Ok, let's go... Bars stores the number of bars available in the history, not their values!!!!
to get these values, use function iOpen(...), iClose(......)
In general, call skype mike231ko Till 2 a.m. (Moscow time) ....
Eh, I'd like to wait till the opening))) 02:00 Moscow time....