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
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.Chris L.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Belfortbucks, Today, 09:29 PM
|
0 responses
6 views
0 likes
|
Last Post
by Belfortbucks
Today, 09:29 PM
|
||
Started by zstheorist, Today, 07:52 PM
|
0 responses
7 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
151 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
6 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
Comment