How I get know if user clicked mouse button on the chart?
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
NT8 OnMouseDown
Collapse
X
-
Hello ren37,
Below I am providing a link to the NinjaTrader 8 Beta section of the forums (for future reference).
http://ninjatrader.com/support/forum...splay.php?f=59
To find if a user has clicked with the mouse, an event handler (method) will need to be added to the mouse down event.
Attached is an example that demonstrates.Attached FilesChelsea B.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_ChelseaB View PostHello ren37,
Below I am providing a link to the NinjaTrader 8 Beta section of the forums (for future reference).
To find if a user has clicked with the mouse, an event handler (method) will need to be added to the mouse down event.
Attached is an example that demonstrates.
Comment
-
Hello Antny,
Are you trying to create a drawing tool?
With the example I have provided, the y value comes from the mouse click, and is used to draw the dot as a rendered sharpdx object (not a drawing tool) from the indicator. This is not a drawing object script.
To convert a y value to a price use:
<theChartsScale>.GetValueByY();
There is no documented code that provides a way to create anchors in an indicator. The anchors are created automatically by the drawing tool script that is being called from the indicator (like Draw.Dot()).
Anchors from a drawing object would come from a drawing object script (for example when you clicking a drawing object from the drawing object menu on the chart toolbar) using the CreateAnchor() method from within the DrawingTool namespace.
http://ninjatrader.com/support/helpG...eateanchor.htmLast edited by NinjaTrader_ChelseaB; 08-31-2016, 08:54 AM.Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello Antny,
Are you trying to create a drawing tool?
With the example I have provided, the y value comes from the mouse click, and is used to draw the dot as a rendered sharpdx object (not a drawing tool) from the indicator. This is not a drawing object script.
To convert a y value to a price use:
<theChartsScale>.GetValueByY();
There is no documented code that provides a way to create anchors in an indicator. The anchors are created automatically by the drawing tool script that is being called from the indicator (like Draw.Dot()).
Anchors from a drawing object would come from a drawing object script (for example when you clicking a drawing object from the drawing object menu on the chart toolbar) using the CreateAnchor() method from within the DrawingTool namespace.
http://ninjatrader.com/support/helpG...eateanchor.htmLast edited by Antny; 08-31-2016, 05:26 PM.
Comment
-
Hello Antny,
There are methods that can give you the time and price of where you mouse have clicked. One of these I have mentioned in my previous post.
The mouse click returns x and y values.
To convert a y value to a price use:
<theChartsScale>.GetValueByY();
To convert an x value to a time use:
<theChartsControl>.GetSlotIndexByX();
Chelsea B.NinjaTrader Customer Service
Comment
-
How can I access ChartScale from within a custom function?
It seems I can only access it from within OnRender()
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
26 views
0 likes
|
Last Post Today, 05:17 AM | ||
Started by MaupinFinche, Today, 05:08 AM
|
0 responses
2 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
||
Started by Enkidu, Yesterday, 06:40 AM
|
9 responses
35 views
0 likes
|
Last Post
by Enkidu
Yesterday, 01:11 PM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
12 responses
307 views
0 likes
|
Last Post
by z.franck
Today, 04:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
32 responses
268 views
0 likes
|
Last Post
by f.saeidi
Yesterday, 06:49 AM
|
Comment