private ChartScale MyChartScale;
int Y;
double priceHover;
protected void MouseMoved(object sender, MouseEventArgs e)
{
TriggerCustomEvent(o =>
{
Y = ChartingExtensions.ConvertToVerticalPixels(e.GetPosition(ChartControl as IInputElement).Y, ChartControl.PresentationSource);
priceHover = MyChartScale.GetValueByY(Y);
if (priceHover != MyChartScale.GetValueByY(Y))
{
Print(String.Format("{0}", priceHover));
}
}, null);
e.Handled = true;
}
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
base.OnRender(chartControl, chartScale);
MyChartScale = chartScale;
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Updating price variable on mouse hover over price
Collapse
X
-
Updating price variable on mouse hover over price
I am trying to make a dynamic variable capture the price that the mouse is currently hovering over on the chart, but this code seems to completely freeze NT8 when I enable the Strategy:
Code:Tags: None
-
Hi, thanks for your post.
I am not aware of a supported example for a mouse move event in NinjaTrader 8. I found this one for NinjaTrader 7:
This Custom Crosshair will allow you show the horizontal and/or vertical lines. You also have the option to change the colors of the lines and markers. Critical – Specifically for some indicators, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No' Update […]
I have asked my colleague if they know of any examples in NT8. Ill post them if we find any.
Thanks in advance for your patience.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment