NexusFi: Find Your Edge


Home Menu

 





Accessing selected manually drawn chart drawing tag


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Xav1029 with 8 posts (4 thanks)
    2. looks_two vvhg with 5 posts (3 thanks)
    3. looks_3 Jaba with 1 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 7,704 views
    2. thumb_up 9 thanks given
    3. group 3 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
Xav1029's Avatar
 Xav1029 
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
Posts: 1,375 since Dec 2011
Thanks Given: 1,452
Thanks Received: 3,378

Need some help with a new idea. I want to access the tag of selected manually drawn chart drawing. I know how to create the button events and button, write the message, and everything else except how to extract the tag of the selected drawing:
1) Click a button
2) Message: "Select upper TL"
3) User clicks on a manually drawn TL
4) Get the tag of the selected chart drawing
...

Any one know if and how this is possible?
Thanks


Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Hormuz Surges From 14% to 26.5% Intraday as Irans Answer …
Prediction Markets & Event Contracts
Beijing Summit Closes: Xi Pledges Hormuz Help -- $1.14B …
Prediction Markets & Event Contracts
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
Wood Mackenzie Drops $200 Oil Forecast -- Airspace Expir …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,826



Xav1029 View Post
Need some help with a new idea. I want to access the tag of selected manually drawn chart drawing. I know how to create the button events and button, write the message, and everything else except how to extract the tag of the selected drawing:
1) Click a button
2) Message: "Select upper TL"
3) User clicks on a manually drawn TL
4) Get the tag of the selected chart drawing
...

Any one know if and how this is possible?
Thanks

I'm not in front of my computer right now, but have you had a look at ChartControl? Or maybe there is sth like GetSelectedDrawObject or similar....

Vvhg


Sent from my iPad using Tapatalk HD


Hic Rhodos, hic salta.
Reply With Quote
Thanked by:
  #4 (permalink)
 
Xav1029's Avatar
 Xav1029 
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
Posts: 1,375 since Dec 2011
Thanks Given: 1,452
Thanks Received: 3,378


vvhg View Post
I'm not in front of my computer right now, but have you had a look at ChartControl? Or maybe there is sth like GetSelectedDrawObject or similar....

Vvhg


Sent from my iPad using Tapatalk HD

Never used ChartControl before, but looks like there are a lot of useful tools in that. I will play around with it when I get home.


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
Xav1029's Avatar
 Xav1029 
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
Posts: 1,375 since Dec 2011
Thanks Given: 1,452
Thanks Received: 3,378

So I figured out how to extract the tags using DrawObjects, now I just need to access the selected drawing only...any ideas?


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #6 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,826


Xav1029 View Post
So I figured out how to extract the tags using DrawObjects, now I just need to access the selected drawing only...any ideas?

Is there maybe a way of checking if the object is active/selected? Like a flag or event or so?

Vvhg


Sent from my iPad using Tapatalk HD


Hic Rhodos, hic salta.
Reply With Quote
  #7 (permalink)
 
Xav1029's Avatar
 Xav1029 
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
Posts: 1,375 since Dec 2011
Thanks Given: 1,452
Thanks Received: 3,378


vvhg View Post
Is there maybe a way of checking if the object is active/selected? Like a flag or event or so?

Vvhg


Sent from my iPad using Tapatalk HD

Wish I knew, but I can't find any way. I could draw the tags on the chart automatically, and then have an input box for a mini buy program or sell program. Do you know if a dynamic input box would be possible?


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #8 (permalink)
 
vvhg's Avatar
 vvhg 
Northern Germany
 
Experience: Intermediate
Platform: NT
Trading: FDAX, CL
Posts: 1,580 since Mar 2011
Thanks Given: 1,016
Thanks Received: 2,826


Xav1029 View Post
Wish I knew, but I can't find any way. I could draw the tags on the chart automatically, and then have an input box for a mini buy program or sell program. Do you know if a dynamic input box would be possible?

Theoretically there are very few limits...but I think that would be more complicated than neccessary. When you access a drawobject, is there no way to get its state? If there were you could simply loop through them...
I'll have a look tomorrow morning, maybe four eyes see more than two...


Vvhg


Sent from my iPad using Tapatalk HD


Hic Rhodos, hic salta.
Reply With Quote
Thanked by:
  #9 (permalink)
 
Xav1029's Avatar
 Xav1029 
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
Posts: 1,375 since Dec 2011
Thanks Given: 1,452
Thanks Received: 3,378


vvhg View Post
Theoretically there are very few limits...but I think that would be more complicated than neccessary. When you access a drawobject, is there no way to get its state? If there were you could simply loop through them...
I'll have a look tomorrow morning, maybe four eyes see more than two...


Vvhg


Sent from my iPad using Tapatalk HD

It has to be in ChartControl somewhere, question is where


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #10 (permalink)
 
Xav1029's Avatar
 Xav1029 
Tampa, FL
 
Experience: Beginner
Platform: NinjaTrader, Sierra Chart
Broker: Mirus Futures/Zen-Fire
Trading: 6E, M6E, 6J
Posts: 1,375 since Dec 2011
Thanks Given: 1,452
Thanks Received: 3,378


@vvhg

Someone sent me the solution to this a couple minutes ago, thought you might want to look at it.

 
Code
FieldInfo fi = typeof(ChartControl).GetField("selectedObject", BindingFlags.NonPublic | BindingFlags.Instance);
			if (fi != null)
			{
  				if (base.ChartControl != null)
    			        if (fi.GetValue(base.ChartControl) != null)
      			        Print(fi.GetValue(base.ChartControl).ToString());
			}
This will give you something like:
Name='Ray' Time='9/25/2012 4:32:28 PM', StartBar='2995' StartY='91.10' EndTime='9/25/2012 5:00:00 PM' EndBar='3034' EndY='90.99'

So now I just have to add it to a mouse event, and get to coding.


Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:




Last Updated on October 7, 2012


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts