I'm asking because it does not seem to be happening with MultiCharts .NET64 Version 8.8 Release (Build 8365):
I was too soon in responding; the issue also occurs with MC 8.8, but the issue is not with `Bars.Status` but with the `Bars.LastBarOnChart` property (at least, that's the case in the version I use; don't know if this also affects MidKnight).
According to the chm help file, this property:
Indicates whether current bar is the last bar on the chart.
But on tick charts (as MidKnight showed) this is not the case, because the property is always false even though the bar is the last bar on the chart:
Code: Select all
#3814 - LastBarNum: 3814 - LastBarOnChart? False
#3814 - LastBarNum: 3814 - LastBarOnChart? False
#3814 - LastBarNum: 3814 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3815 - LastBarNum: 3815 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3816 - LastBarNum: 3816 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3817 - LastBarNum: 3817 - LastBarOnChart? False
#3818 - LastBarNum: 3818 - LastBarOnChart? False
Code: Select all
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator
{
public class Forum_BarStatus : IndicatorObject
{
public Forum_BarStatus(object _ctx) : base(_ctx) { }
protected override void StartCalc()
{
Output.Clear();
}
protected override void CalcBar()
{
Output.WriteLine("#{0} - LastBarNum: {1} - LastBarOnChart? {2}",
Bars.CurrentBar,
Bars.FullSymbolData.Count,
Bars.LastBarOnChart);
}
}
}
Edit: MidKnight, as a workaround you can use the `Environment.IsRealTimeCalc` property as a substitute for `Bars.LastBarOnChart` if this issue also affects you. That would give the same behaviour (only executing the code block on the last bar), but does not lead to skipping Bar Status == Open situations (in my case).