Hello,

I have a script (irrelevant is it indicator or strategy) that have a few lines of code in OnBarUpdate method:

Code:
if (IsFirstTickOfBar)
{
Print(string.Format("{0} {1} {2} {3} {4}",
Time[0].ToString("yyyyMMdd HH:mm"),
Open[0].ToString("0.##"),
High[0].ToString("0.##"),
Low[0].ToString("0.##"),
Close[0].ToString("0.##")));

return;
}
Suppose i have last one month data on a daily chart (2021.11.08 - 2021.12.09). And i add an script on a chart and...

1. If I set calculate property to Calculate.OnBarClose Output window shows below data:
20211108 19:00 ......
20211109 19:00 ......
20211110 19:00 ......
.
.
.
20211208 19:00 ......

Because today/current day is 2021.12.09 and bar not closed yet if statement code block not working for the current day. This is nice and what i wanted/expected.

2.If I set calculate property to Calculate.OnPriceChange Output window shows below data:
20211108 19:00 ......
20211109 19:00 ......
20211110 19:00 ......
.
.
.
20211208 19:00 ......
20211209 19:00 ......

If statement is working also for current day bar which is not yet closed. Shortly i dont want to work if statement block for the current day even if i set calculate property to OnPriceChage. So how can i prevent that?

Best Regards,
AA