I already have the mouse click working and even the time of where I click registers. The indicator does actually update with the new time of origin but only if I do "Reload NinjaScript" manually.
What will force the indicator to replot everything after clicking?
Update(), ForceRefresh(), or resetting the Values arrays will not do it. What will it take?
protected void MouseClicked(object sender, MouseButtonEventArgs e)
{
// If not "Anchored" duration type, skip this function
if(Duration!=DurationType.Anchored) { return; }
// Is either Shift key pressed down? If so, proceed
if((!Keyboard.IsKeyDown(Key.LeftShift)) && (!Keyboard.IsKeyDown(Key.RightShift))) { return; }
else { Print("Hello"); }
// Get XY click point
clickPoint.X = ChartingExtensions.ConvertToHorizontalPixels(e.Get Position(ChartControl as IInputElement).X,ChartControl.PresentationSource);
clickPoint.Y = ChartingExtensions.ConvertToVerticalPixels(e.GetPo sition(ChartControl as IInputElement).Y,ChartControl.PresentationSource);
convertedPrice = Instrument.MasterInstrument.RoundToTickSize(chartS cale.GetValueByY((float)clickPoint.Y));
convertedTime = ChartControl.GetTimeBySlotIndex((int)ChartControl. GetSlotIndexByX((int)clickPoint.X));
AnchoredDate = convertedTime; // AnchoredDate right now is a user input and a datetime
Print(AnchoredDate);
Update(); // Does not work
ForceRefresh(); // Does not work
}
Comment