18 lines
306 B
Markdown
18 lines
306 B
Markdown
# IsNewBar
|
|
|
|
this is a best way to find is in new bar or not ...
|
|
|
|
```mq4
|
|
bool IsNewBar()
|
|
{
|
|
static datetime lastbar;
|
|
datetime curbar = (datetime)SeriesInfoInteger(_Symbol,_Period,SERIES_LASTBAR_DATE);
|
|
if(lastbar != curbar)
|
|
{
|
|
lastbar = curbar;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
```
|