Postby Abhi » 22 Jan 2019
If anybody wondering how to get range for previous day on a scanner.
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
[UpdateOnEveryTick(true)]
[SkipIdenticalTicks(false)]
public class AG_Volume_Profile : IndicatorObject
{
public AG_Volume_Profile(object _ctx):base(_ctx)
{
}
private IPlotObject PreviousRange;
protected override void Create()
{
PreviousRange = AddPlot(new PlotAttributes("PrevRange", EPlotShapes.Point,Color.Yellow, Color.Empty, 4,0,true));
}
protected override void StartCalc()
{
ExecInfo.MaxBarsBack = 3;
}
protected override void CalcBar()
{
PreviousRange.Set(Bars.High[1] - Bars.Low[1]);
}
}
}