In the first way of requesting a new column line, I don't understand how the number of new columns can be directly assigned to 1. Please advise;
//--- Check for new column lines.if(m_lastbar_time<newbar_time)
{
m_new_bars=1; // Number of new column lines
m_lastbar_time=newbar_time; // Remember the last bar timereturn(true);
}
//--- //--- Check for new column lines.if(m_lastbar_time<newbar_time)
{
m_new_bars=1; // Number of new column lines
m_lastbar_time=newbar_time; // Remember the last bar timereturn(true);
}
//---
There are so many code variations in the article, but in the end it is still not clear, what function is more correct to use on MT4 to increase at least a little bit the correspondence of what the tester draws with the trade. Give me a hint!
Pavel Komarovsky: There are so many code variations in the article, but in the end it is still not clear, what function is more correct to use on MT4 to increase at least a little bit the correspondence of what the tester draws with the trade. Give me a hint!
datetime counted_bar = 0;
intOnInit()
{
counted_bar = 0; // if you want the last bar to be analysed on restart
...
voidOnTick()
{
// If there is a new barif ( iTime( _Symbol, _Period, 0 ) > counted_bar )
{
counted_bar = iTime( _Symbol, _Period, 0 );
// Analyse indicators
...
}
This article is so good that it is even used in MQL5 programming classes, including comments and collaborations and bug fixes. Congratulations to all of you.
Good article, thanks for sharing! All that was very useful!
Anyway, I have taken your isNewBar function and it throws the following message when compiling: "possible loss of data due to type conversion".
So I have changed the var types from datetime to long this way:
Now it compiles without any notice and seems to work ok. Thank you!
It's probably clearer to change it this way :
In the first way of requesting a new column line, I don't understand how the number of new columns can be directly assigned to 1. Please advise;
According to the rules of object modelling, it's a misnomer to call it CIsNewBar.
Let's see, if car is a class I can create/have a car object. However, if my class is "ÉUmCarroNovo", we can have or own an "ÉUmCarroNovo".
The author should have called it CNewBarChecker. Someone could invent a New Car Checker and create it (our class would be NewCarChecker.
There are so many code variations in the article, but in the end it is still not clear, what function is more correct to use on MT4 to increase at least a little bit the correspondence of what the tester draws with the trade. Give me a hint!
Andrey, thank you. Tell me why iTime is used now, earlier I remember in all functions and examples, most of them were based on iBars.
DoesiTime work more accurately?
Andrey, thank you. Tell me why iTime is used now, earlier I remember in all functions and examples, most of them were based on iBars.
DoesiTime work more accurately?
This article is so good that it is even used in MQL5 programming classes, including comments and collaborations and bug fixes. Congratulations to all of you.