What I want to do is mouse click back on NT7 location and get the time and price
I know how to do it in NT8 but I can not find the parameters
private ChartScale chartScale;
private Point clickPoint = new Point();
private double convertedPrice;
private DateTime convertedTime;
if (State == State.Historical)
{
if (ChartControl != null)
{
foreach (ChartScale scale in ChartPanel.Scales)
if (scale.ScaleJustification == ScaleJustification)
chartScale = scale;
ChartControl.MouseLeftButtonDown += MouseClicked;
}
}
else if (State == State.Terminated)
{
if (ChartControl != null)
ChartControl.MouseLeftButtonDown -= MouseClicked;
}
}
protected void MouseClicked(object sender, MouseButtonEventArgs e)
{
// convert e.GetPosition for different dpi settings
clickPoint.X = ChartingExtensions.ConvertToHorizontalPixels(e.Get Position(ChartPanel as IInputElement).X, ChartControl.PresentationSource);
clickPoint.Y = ChartingExtensions.ConvertToVerticalPixels(e.GetPo sition(ChartPanel as IInputElement).Y, ChartControl.PresentationSource);
convertedPrice = Instrument.MasterInstrument.RoundToTickSize(chartS cale.GetValueByY((float)clickPoint.Y));
convertedTime = ChartControl.GetTimeBySlotIndex((int)ChartControl. GetSlotIndexByX((int)clickPoint.X));
bool found = false;
int nPatternIndex = 0;
for(int y = 0; y < this.PatternTextTimeLocation.Count -1; y++)
{
if(convertedTime == this.PatternTextTimeLocation[y].STARTTIME)
{
found = true;
nPatternIndex =this.PatternTextTimeLocation[y].MESSAGENUMBER;
y = this.PatternTextTimeLocation.Count;
}
}
if(found == true)
{
writeDrawFixedTextPattern(nPatternIndex);
found = false;
}
Comment