on the chart from my Unmanaged Strategy.
C# doesn't have Multiple Inheritance, so my Strategy class can't also
inherit from Indicator.
Thanks to earlier support; I've hooked the LeftMouseDown event, and that
delivers a correct Price from the Chart, as follows, but
how to draw the HorizontalLine at that Price?
private Brush myColor = Brushes.Red;
private DashStyleHelper myLineStyle = DashStyleHelper.Solid;
private int myLineThickness = 2;
private string myLineKey = "HLinePrice";
protected void LeftMouseDown(object sender, MouseButtonEventArgs e) {
int Y = ChartingExtensions.ConvertToVerticalPixels(e.GetPo sition(ChartControl as IInputElement).Y,
ChartControl.PresentationSource);
double priceClicked = MyChartScale.GetValueByY(Y);
// price is correct
// try to draw a horizontal line on chart at priceClicked
//if this were an Indicator, which is is not, then I think I could draw like this, or similar
Draw.HorizontalLine(this, myLineKey, false, priceClicked, myColor, myLineStyle, myLineThickness); // pseudocode
}
hyperscalper



Comment