I made a simple indicator that sums total volume of the day
#region Variables // Wizard generated variables // User defined variables (add any user defined variables below) double totalvolume=0.0f; #endregion /// <summary> /// This method is used to configure the indicator and is called once before any bar data is loaded. /// </summary> protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Bar, "VolSum")); Overlay = false; CalculateOnBarClose =false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { //only use historical if (Historical) { if (Bars.SessionBreak) totalvolume=0; totalvolume+= Volume[0]; VolSum.Set(totalvolume); } }
Using very small granularity : 10 ticks, 1000 give the same "correct" volume, but when the granularity increases, some volume seams to disappear.
It's probly an erro in my indicator but it's very simple...
Any clue ?
Comment