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
mouse clicked
Collapse
X
-
Hello,
Thanks for your post.
Unfortunately, we do not keep documentation on third-party NinjaScripts. I recommend reaching out to the third-party vendor or writer of that indicator for support on this.
If you have any further NinjaTrader questions please let me know.Josh G.NinjaTrader Customer Service
-
no it is my indicator on mouse clicking which I got the information from you. I was wondering if NT does double mouseclick.
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);Last edited by ballboy11; 09-29-2017, 07:34 AM.
Comment
-
Hello,
Thanks for your note.
To use a double click in your indicator instead of a single click you will use a combination of ChartControl.PreviewMouseLeftButton and ClickCount. You can implement this similar to the snippet of code below.
protected override void OnStateChange(){
if (State == State.SetDefaults)
else if (State == State.Historical){
if (ChartControl != null)
ChartControl.PreviewMouseLeftButtonDown += ChartControl_PreviewMouseLeftButtonDown;
}
else if (State == State.Terminated){
if(ChartControl != null)
ChartControl.PreviewMouseLeftButtonDown -= ChartControl_PreviewMouseLeftButtonDown;
}
}
private void ChartControl_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount == 2){
Print("Double click");
}
}
I also suggest checking out this page on WPF Preview Events:
https://stackoverflow.com/questions/...460266#1460266
If you have any further questions please let me know.Josh G.NinjaTrader Customer Service
- Likes 2
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Tin34, Today, 03:30 AM
|
2 responses
15 views
0 likes
|
Last Post
by Tin34
Today, 04:11 AM
|
||
Started by sastrades, Yesterday, 09:59 AM
|
2 responses
27 views
0 likes
|
Last Post Today, 04:06 AM | ||
Started by ETFVoyageur, Today, 12:52 AM
|
1 response
14 views
0 likes
|
Last Post Today, 03:36 AM | ||
Started by lollers, Today, 03:26 AM
|
0 responses
10 views
0 likes
|
Last Post
by lollers
Today, 03:26 AM
|
||
Started by aliyahany, Today, 03:16 AM
|
0 responses
2 views
0 likes
|
Last Post
by aliyahany
Today, 03:16 AM
|
Comment