I am trying to use next code for testing OnMouseEvent Method
Code: Select all
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Linq;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator{
public class _test_onMouseEvent : IndicatorObject {
public _test_onMouseEvent(object _ctx):base(_ctx){}
private IPlotObject plot1;
protected override void Create() {
// create variable objects, function objects, plot objects etc.
plot1 = AddPlot(new PlotAttributes("", EPlotShapes.Line, Color.Red));
}
protected override void StartCalc() {
// assign inputs
}
protected override void CalcBar(){
// indicator logic
plot1.Set(Bars.Close[0]);
}
protected override void OnMouseEvent(MouseClickArgs args)
{
if (Keys.ShiftKey == args.keys && MouseButtons.Left == args.buttons)
{
MessageBox.Show("Triggered !!! "+args.bar_number.ToString());
}
}
}
}
Whats wrong?