MetaTrader 4 Build 529 beta released with new compiler - page 39 1...323334353637383940414243444546...161 New comment Renat Fatkhullin 2013.11.11 20:02 #381 Out of range unambiguously indicates an error in the code - going outside the array. The string and error location are indicated there, so look for the error. TheCore 2013.11.11 21:01 #382 Here's the code. datetime prevtime0 = 0; double prevVolume0 =0; double prevClose0 =0; void init() { Print("_______Test init"); prevtime0 = iTime(NULL,PERIOD_M1,0); prevVolume0 = iVolume(NULL,PERIOD_M1,0); prevClose0 = iClose(NULL,PERIOD_M1,0); } void start() { Print(" prevtime0!!!!! = ",prevtime0," iTime(NULL,PERIOD_M1,0) =",iTime(NULL,PERIOD_M1,0) ); Print(" prevVolume0!!!!! = ",prevVolume0," iVolume(NULL,PERIOD_M1,0) =",iVolume(NULL,PERIOD_M1,0) ); Print(" prevClose0!!!!! = ",prevClose0," iClose(NULL,PERIOD_M1,0) =",iClose(NULL,PERIOD_M1,0) ); Print(""); prevtime0 = iTime(NULL,PERIOD_M1,0); prevVolume0 = iVolume(NULL,PERIOD_M1,0); prevClose0 = iClose(NULL,PERIOD_M1,0); } Here is the result of execution in terminal Version 4.0 Build 536 2013.11.11 22:53:08 Test EURJPY,M1: prevClose0!!!!! = 133.02 iClose(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:53:08 Test EURJPY,M1: prevVolume0!!!!! = 133.02 iVolume(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:53:08 Test EURJPY,M1: prevtime0!!!!! = 2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00 2013.11.11 22:52:25 Test EURJPY,M1: 2013.11.11 22:52:25 Test EURJPY,M1: prevClose0!!!!! = 133.02 iClose(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:52:25 Test EURJPY,M1: prevVolume0!!!!! = 133.02 iVolume(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:52:25 Test EURJPY,M1: prevtime0!!!!! =2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00 As you can see neither iClose, nor iVolume, nor iTime changes. I assume so, and so do the other functions that start with i. Also, the iVolume function in this example shows clearly not Volume. At the same time in the tester, everything works and changes except iVolume. It doesn't work there either. Note. question about close[] and Use the iClose() in Help needed - line Алексей Тарабанов 2013.11.11 21:19 #383 thecore: Here's the code. Here is the result of execution in terminal Version 4.0 Build 536 2013.11.11 22:53:08 Test EURJPY,M1: prevClose0!!!!! =133.02 iClose(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:53:08 Test EURJPY,M1: prevVolume0!!!!! =133.02 iVolume(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:53:08 Test EURJPY,M1: prevtime0!!!!! =2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00 2013.11.11 22:52:25 Test EURJPY,M1: 2013.11.11 22:52:25 Test EURJPY,M1: prevClose0!!!!! =133.02 iClose(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:52:25 Test EURJPY,M1: prevVolume0!!!!! =133.02 iVolume(NULL,PERIOD_M1,0) =133.02 2013.11.11 22:52:25 Test EURJPY,M1: prevtime0!!!!! =2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00 As you can see neither iClose, nor iVolume, nor iTime changes. I assume that other functions which start with i do not change either. Also, the iVolume function in this example clearly shows not Volume. At the same time in the tester, everything works and changes except iVolume. It doesn't work there either. Note. Well, I did. What's wrong? TheCore 2013.11.11 21:28 #384 tara: Well, I did. What's wrong? Right... The iTime(NULL,PERIOD_M1,0) function gives the wrong time from the terminal on the left. Terminal gives 2013.11.11 22:53:08, iTime gives 2013.11.11 22:38:00, and should give 2013.11.11 22:53:00 iVolume(NULL,PERIOD_M1,0) should return some integer, for example 1, 2, 3, 100, not as in this example 133.02 iClose should give out 133.02 in the first case, and 133.03 in the second. Saving values OnCalculate called twice in Function iTime or iBarShift Алексей Тарабанов 2013.11.11 21:43 #385 All these functions work a little differently, on a minute-by-minute basis. Your printing works in ticks. Time in MT is counted in seconds. And the second terminal, in general, on the left :) TheCore 2013.11.11 21:57 #386 tara: All these functions work a little differently, on a minute-by-minute basis. Your printing works in ticks. Time in MT is counted in seconds. And the second terminal, in general, on the left :) Look, I understand that you have no one to talk to in the evening. I know that the minutes, that's why in the printout of the result and showed SPECIAL two results at different minutes. And besides, this message was not for you, but for the developers. Errors, bugs, questions Discussion on MQL4 documentation About the feet (for [Deleted] 2013.11.12 04:18 #387 thecore: iVolume(NULL,PERIOD_M1,0) should return an integer, for example 1, 2, 3, 100, but not as in this example 133.02 Looks like iVolume really does return the last price(closing price) instead of volume. But I was quite amused by the description from the help (the first one is from the file, and the second one is taken from the website) 1 datetime iVolume( string symbol, // символ int timeframe, // период int shift // сдвиг ); 2 double iVolume(string symbol, int timeframe, int shift) Any rookie question, so iVolumes average value How to close the Vladimir Pastushak 2013.11.12 04:42 #388 thecore: Right... The iTime(NULL,PERIOD_M1,0) function gives the wrong time from the terminal on the left. Terminal shows 2013.11.11 22:53:08, iTime shows 2013.11.11 22:38:00 and should show 2013.11.11 22:53:00 iVolume(NULL,PERIOD_M1,0) should return some integer, for example 1, 2, 3, 100, not as in this example 133.02 iClose should output 133.02 in the first case, and 133.03 in the second. Try using RefreshRates(), OnTick has the same problem, time and prices are not updated in the tester, but when using RefreshRates() all is ok ... Igor Semyonov 2013.11.12 05:17 #389 Two more problems with the indicators, please see Service Desk! Slava 2013.11.12 08:04 #390 thecore: As you can see, neither iClose, nor iVolume, nor iTime changes. I assume that neither do the other functions that start with i. Also, the iVolume function in this example shows clearly not Volume. Corrected. Thank you 1...323334353637383940414243444546...161 New comment
Here's the code.
Here is the result of execution in terminal Version 4.0 Build 536
2013.11.11 22:53:08 Test EURJPY,M1: prevClose0!!!!! = 133.02 iClose(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:53:08 Test EURJPY,M1: prevVolume0!!!!! = 133.02 iVolume(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:53:08 Test EURJPY,M1: prevtime0!!!!! = 2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00
2013.11.11 22:52:25 Test EURJPY,M1:
2013.11.11 22:52:25 Test EURJPY,M1: prevClose0!!!!! = 133.02 iClose(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:52:25 Test EURJPY,M1: prevVolume0!!!!! = 133.02 iVolume(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:52:25 Test EURJPY,M1: prevtime0!!!!! =2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00
As you can see neither iClose, nor iVolume, nor iTime changes.
I assume so, and so do the other functions that start with i.
Also, the iVolume function in this example shows clearly not Volume.
At the same time in the tester, everything works and changes except iVolume. It doesn't work there either.
Note.
Here's the code.
Here is the result of execution in terminal Version 4.0 Build 536
2013.11.11 22:53:08 Test EURJPY,M1: prevClose0!!!!! =133.02 iClose(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:53:08 Test EURJPY,M1: prevVolume0!!!!! =133.02 iVolume(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:53:08 Test EURJPY,M1: prevtime0!!!!! =2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00
2013.11.11 22:52:25 Test EURJPY,M1:
2013.11.11 22:52:25 Test EURJPY,M1: prevClose0!!!!! =133.02 iClose(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:52:25 Test EURJPY,M1: prevVolume0!!!!! =133.02 iVolume(NULL,PERIOD_M1,0) =133.02
2013.11.11 22:52:25 Test EURJPY,M1: prevtime0!!!!! =2013.11.11 22:38:00 iTime(NULL,PERIOD_M1,0) =2013.11.11 22:38:00
As you can see neither iClose, nor iVolume, nor iTime changes.
I assume that other functions which start with i do not change either.
Also, the iVolume function in this example clearly shows not Volume.
At the same time in the tester, everything works and changes except iVolume. It doesn't work there either.
Note.
Well, I did. What's wrong?
Right...
The iTime(NULL,PERIOD_M1,0) function gives the wrong time from the terminal on the left.
Terminal gives 2013.11.11 22:53:08, iTime gives 2013.11.11 22:38:00, and should give
2013.11.11 22:53:00
iVolume(NULL,PERIOD_M1,0) should return some integer, for example 1, 2, 3, 100, not
as in this example 133.02
iClose should give out 133.02 in the first case, and 133.03 in the second.
All these functions work a little differently, on a minute-by-minute basis. Your printing works in ticks. Time in MT is counted in seconds.
And the second terminal, in general, on the left :)
All these functions work a little differently, on a minute-by-minute basis. Your printing works in ticks. Time in MT is counted in seconds.
And the second terminal, in general, on the left :)
Look, I understand that you have no one to talk to in the evening.
I know that the minutes, that's why in the printout of the result and showed SPECIAL
two results at different minutes.
And besides, this message was not for you, but for the developers.
iVolume(NULL,PERIOD_M1,0) should return an integer, for example 1, 2, 3, 100, but not
as in this example 133.02
Looks like iVolume really does return the last price(closing price) instead of volume.
But I was quite amused by the description from the help (the first one is from the file, and the second one is taken from the website)
1
2
Right...
The iTime(NULL,PERIOD_M1,0) function gives the wrong time from the terminal on the left.
Terminal shows 2013.11.11 22:53:08, iTime shows 2013.11.11 22:38:00 and should show
2013.11.11 22:53:00
iVolume(NULL,PERIOD_M1,0) should return some integer, for example 1, 2, 3, 100, not
as in this example 133.02
iClose should output 133.02 in the first case, and 133.03 in the second.
Try using RefreshRates(), OnTick has the same problem, time and prices are not updated in the tester, but when using RefreshRates() all is ok ...
As you can see, neither iClose, nor iVolume, nor iTime changes.
I assume that neither do the other functions that start with i.
Also, the iVolume function in this example shows clearly not Volume.