I would like to create an indicator, that creates a small dot onto the bar upon its close. This dot is to represent the VWAP for the given bar. Thus, I calculate followingly:
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
private double SumPrices;
private double SumVolume;
#endregion
...
protected override void OnMarketData(MarketDataEventArgs e)
{
if ( FirstTickOfBar ){
SumPrices = 0;
SumVolume = 0;
}
SumPrices += e.Price;
SumVolume += e.Volume;
DrawDot( "IntrabarVWAP" + CurrentBar, false, 0, SumPrices / SumVolume, Color.Black);
}
Sincerely,
Daniel.

Comment