Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 436

 
Trader7777:
How can I russify my manual in the meta editor?


Simply russify the MetaEditor

View - Languages-Russian

 
Sepulca:

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.

2014.01.19 21:19:26     2000.01.03 21:28  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:28  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:27  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:27  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:26  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:26  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:25  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:25  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:25  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:24  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:22  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:22  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:22  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:21  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:18  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:16  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:15  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:15  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:15  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:10  БАЗА 30-150 EURUSD,M5: Н Н Н  =  252
2014.01.19 21:19:26     2000.01.03 21:09  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:08  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:06  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:06  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:05  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:05  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:05  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:02  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:02  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:02  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:01  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250

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)?

int start()  
{
int  pY  =  Bars;
Print ( "Н Н Н  =  ",pY);   
}

And if there are 2 variables in the code

int start()  
 {
int pY =  Bars;
int pY1 = Bars+239;
       
Print( "Н Н Н  =  ", pY);   
Print( "НH HН НH  =  ", pY1); 

}

their values are not updated EVERY 5 minutes.

2014.01.19 13:28:08     2000.03.17 12:56  БАЗА 30-150 EURUSD,M5: НH HН НH  =  15738
2014.01.19 13:28:08     2000.03.17 12:56  БАЗА 30-150 EURUSD,M5: Н Н Н  =  15499
2014.01.19 13:28:08     2000.03.17 12:56  БАЗА 30-150 EURUSD,M5: НH HН НH  =  15738
2014.01.19 13:28:07     2000.02.29 18:38  БАЗА 30-150 EURUSD,M5: Н Н Н  =  11856
2014.01.19 13:28:07     2000.02.29 18:38  БАЗА 30-150 EURUSD,M5: НH HН НH  =  12095
2014.01.19 13:28:07     2000.02.29 18:38  БАЗА 30-150 EURUSD,M5: Н Н Н  =  11856
2014.01.19 13:28:07     2000.02.29 18:38  БАЗА 30-150 EURUSD,M5: НH HН НH  =  12095
2014.01.19 13:28:07     2000.02.29 18:38  БАЗА 30-150 EURUSD,M5: Н Н Н  =  11856
2014.01.19 13:28:07     2000.02.29 18:38  БАЗА 30-150 EURUSD,M5: НH HН НH  =  12095
2014.01.19 13:28:07     2000.02.29 18:38  БАЗА 30-150 EURUSD,M5: Н Н Н  =  11856
2014.01.19 13:28:07     2000.02.29 18:37  БАЗА 30-150 EURUSD,M5: НH HН НH  =  12095
2014.01.19 13:28:06     2000.02.10 22:20  БАЗА 30-150 EURUSD,M5: Н Н Н  =  8258
2014.01.19 13:28:06     2000.02.10 22:20  БАЗА 30-150 EURUSD,M5: НH HН НH  =  8497
2014.01.19 13:28:06     2000.02.10 22:20  БАЗА 30-150 EURUSD,M5: Н Н Н  =  8258
2014.01.19 13:28:06     2000.02.10 22:20  БАЗА 30-150 EURUSD,M5: НH HН НH  =  8497
2014.01.19 13:28:06     2000.02.10 22:20  БАЗА 30-150 EURUSD,M5: Н Н Н  =  8258
2014.01.19 13:28:06     2000.02.10 22:19  БАЗА 30-150 EURUSD,M5: НH HН НH  =  8496
2014.01.19 13:28:06     2000.02.10 22:19  БАЗА 30-150 EURUSD,M5: Н Н Н  =  8257
2014.01.19 13:28:06     2000.02.10 22:18  БАЗА 30-150 EURUSD,M5: НH HН НH  =  8496
2014.01.19 13:28:05     2000.01.10 15:42  БАЗА 30-150 EURUSD,M5: Н Н Н  =  1600
2014.01.19 13:28:05     2000.01.10 15:41  БАЗА 30-150 EURUSD,M5: НH HН НH  =  1839
2014.01.19 13:28:05     2000.01.10 15:41  БАЗА 30-150 EURUSD,M5: Н Н Н  =  1600
2014.01.19 13:28:05     2000.01.10 15:41  БАЗА 30-150 EURUSD,M5: НH HН НH  =  1839
2014.01.19 13:28:05     2000.01.10 15:41  БАЗА 30-150 EURUSD,M5: Н Н Н  =  1600
2014.01.19 13:28:05     2000.01.10 15:41  БАЗА 30-150 EURUSD,M5: НH HН НH  =  1839
2014.01.19 13:28:05     2000.01.10 15:41  БАЗА 30-150 EURUSD,M5: Н Н Н  =  1600
2014.01.19 13:28:05     2000.01.10 15:41  БАЗА 30-150 EURUSD,M5: НH HН НH  =  1839


 
Look at the tester logs, not the logbook entries. The log is written in sample entries,
 
solnce600:

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....

 
The error "zero devide" comes up, does it mean that somewhere in the calculations something is divided by zero? Or could it mean something else?
 
Sepulca:


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.


2014.01.19 21:19:26     2000.01.03 21:28  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:28  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:27  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:27  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:26  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:26  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:25  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:25  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:25  БАЗА 30-150 EURUSD,M5: Н Н Н  =  255
2014.01.19 21:19:26     2000.01.03 21:24  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:22  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:22  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:22  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:21  БАЗА 30-150 EURUSD,M5: Н Н Н  =  254
2014.01.19 21:19:26     2000.01.03 21:18  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:16  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:15  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:15  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:15  БАЗА 30-150 EURUSD,M5: Н Н Н  =  253
2014.01.19 21:19:26     2000.01.03 21:10  БАЗА 30-150 EURUSD,M5: Н Н Н  =  252
2014.01.19 21:19:26     2000.01.03 21:09  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:08  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:06  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:06  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:05  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:05  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251
2014.01.19 21:19:26     2000.01.03 21:05  БАЗА 30-150 EURUSD,M5: Н Н Н  =  251значение переменной BARS
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:04  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:03  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:02  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:02  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:02  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250
2014.01.19 21:19:26     2000.01.03 21:01  БАЗА 30-150 EURUSD,M5: Н Н Н  =  250 значение переменной BARS
 
Trader7777:
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,

 
solnce600:

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,

 
solnce600:

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) ....

 
Sepulca:


Eh, I'd like to wait till the opening))) 02:00 Moscow time....


what's the point of opening ? ... :-))) if you've closed properly, you won't care about any opening ... :-)))
Reason: