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
More detail onmousedown please
Collapse
X
-
More detail onmousedown please
It's a little beyond my current C# skills. I'm having trouble with anything requiring overriding a method, such as onmousedown. I tried pasting the example code from here into my strategy class, but it says 'no suitable method found to override.' I get confused with abstract, override, etc.Tags: None
-
Hello Chippy,
Thank you for the post.
It looks like the link you provided is to the drawing tools list. There is an override for a drawing object for mouse down, was this the page you had seen? https://ninjatrader.com/support/help...nmousedown.htm
If so that would not be able to be used in a strategy, if you take a look at the left side of the help guide that will help to determine which type something is for. In this case its under the drawing tool section.
A strategy does not natively have a mouse down event. You could get the mouse events from the ChartControl however that requires some error handling, you can see a sample of that here: https://ninjatrader.com/support/foru...687#post742687
JesseNinjaTrader Customer Service
-
Hi and thank you. Yes, that was indeed my intended link. The alternate link you provided for ChartControl I don't think will work for what I'm trying to do. There are a few different ways to possibly implement this, but I can't seem to find one that will work.
I would like to be able to place a line to mark as trend/support/resistance on a chart that can be accessed programmatically. I would be happy with drawing the lines from the GUI if there was a way to access the drawn objects collection. The onmousedown was just intended as an event capture that would run code for analyzing the drawn line.
Another way to do this would be if there was a way to dynamically input the anchor coordinates via the keyboard? Is this possible? If I could enter the coordinates, I already know how to draw the lines programmatically.
I hope that made sense?
Comment
-
Also, I can't get the link you provided to work either... I get the same error... method not suitable. I just cut and pasted the code above my strategy.cs namespace, but removed the using statements as they're already applied to the strategy.cs file I'm working with. No joy.
Comment
-
Hello Chippy,
You can use the existing drawing tools for that purpose, there is a sample of accessing tools by name or looping over the collection of tools here: https://ninjatrader.com/support/help...sub=drawobject
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Barry Milan, Yesterday, 10:35 PM
|
6 responses
18 views
0 likes
|
Last Post
by Barry Milan
Today, 06:01 PM
|
||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM | ||
Started by DJ888, 04-16-2024, 06:09 PM
|
4 responses
13 views
0 likes
|
Last Post
by DJ888
Today, 04:28 PM
|
||
Started by terofs, Today, 04:18 PM
|
0 responses
12 views
0 likes
|
Last Post
by terofs
Today, 04:18 PM
|
||
Started by nandhumca, Today, 03:41 PM
|
0 responses
8 views
0 likes
|
Last Post
by nandhumca
Today, 03:41 PM
|
Comment