exploring the MC.NET platform I have created a indicator and I have pasted in the file this code:
Code: Select all
using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator{
public class DAY_GAP : IndicatorObject {
public DAY_GAP(object _ctx):base(_ctx){}
private IPlotObject plot_gap;//Plot object for graph drawing
protected override void Create() {
//Adds a graph to the chart
plot_gap = AddPlot(new PlotAttributes("GAP",EPlotShapes.Histogram, Color.Red));
}
protected override void CalcBar(){
// Determines next bar plot value
plot_gap.Set(100*((Bars.Open[0] - Bars.Close[1])/Bars.Open[0]));
}
}
}
At this stage I have tryed to insert it in a chart but the software return me that the indicator isn't compiled.
Trying with installed visual studio 2010 and 2012 the result is the same.
Any one have suggestions?