Thanks to anyone who can help me.
using cAlgo.API;
Code: Select all
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class HighLowOffsetIndicator : Indicator
{
[Parameter("Offset (pips)", DefaultValue = 10, MinValue = 1)]
public int Offset { get; set; }
protected override void Initialize()
{
// Set up the indicator
}
public override void Calculate(int index)
{
var high = MarketSeries.High[index - 1] + Symbol.PipSize * Offset;
var low = MarketSeries.Low[index - 1] - Symbol.PipSize * Offset;
ChartObjects.DrawLine("HighOffsetLine", index.ToString(), index - 1, high, index, high, Colors.Blue);
ChartObjects.DrawLine("LowOffsetLine", index.ToString(), index - 1, low, index, low, Colors.Red);
}
}
}