using TradingPlatform.BusinessLayer;
namespace IndicatorVolumeAnalysis
public class IndicatorVolumeAnalysis : Indicator, IVolumeAnalysisIndicator
public IndicatorVolumeAnalysis()
// Defines indicator's name and description.
Name = "IndicatorVolumeAnalysis";
Description = "My indicator's annotation";
// Defines line on demand with particular parameters.
AddLineSeries("AverageBuySize", Color.CadetBlue, 1, LineStyle.Solid);
AddLineSeries("AverageSellSize", Color.Red, 1, LineStyle.Solid);
// By default indicator will be applied on main window of the chart
public bool IsRequirePriceLevelsCalculation => false;
public void VolumeAnalysisData_Loaded()
// Set value to all previous indicators points
for (int i = 0; i < this.Count; i++)
SetValue(this.HistoricalData[i].VolumeAnalysisData.Total.AverageBuySize, 0, i);
SetValue(this.HistoricalData[i].VolumeAnalysisData.Total.AverageSellSize, 1, i);
protected override void OnUpdate(UpdateArgs args)
// Volume analysis data not loaded yet
if (this.HistoricalData.VolumeAnalysisCalculationProgress == null || this.HistoricalData.VolumeAnalysisCalculationProgress.State != VolumeAnalysisCalculationState.Finished)
// Example of access Volume Analysis data
SetValue(this.HistoricalData[0].VolumeAnalysisData.Total.AverageBuySize, 0);
SetValue(this.HistoricalData[0].VolumeAnalysisData.Total.AverageSellSize, 1);