(1)I try to get the average of high by getting the summation of high from the first bar of session to the current bar and divides the summation of number of bars from the first bar of session to the current bar.Compiled but not plotting.Where am I wrong?Help needed.
protected override void Initialize()
{
Add(new Plot(Color.Green, "Hiline"));
PriceTypeSupported = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
int bar =Bars.BarsSinceSession;
double mean =SUM(High,bar)[0];
Hi.Set (mean);
pp.Set (bar);
Hiline.Set (Hi[0]/pp[0]);
}
#region Properties
/// <summary>
/// </summary>
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Hiline
{
get { return Values[0]; }
}
(2) If I want to do the same on different time frame(for eg,10 minutes, 23 minutes and so forth),Where should I start?
Comment