NexusFi: Find Your Edge


Home Menu

 





Get all draw objects


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one AlBundy with 7 posts (2 thanks)
    2. looks_two ratfink with 6 posts (2 thanks)
    3. looks_3 Koepisch with 2 posts (0 thanks)
    4. looks_4 bukkan with 1 posts (0 thanks)
    1. trending_up 12,692 views
    2. thumb_up 4 thanks given
    3. group 8 followers
    1. forum 18 posts
    2. attach_file 1 attachments




 
Search this Thread

Get all draw objects

  #1 (permalink)
 
dimkdimk's Avatar
 dimkdimk 
Melbourne
 
Experience: Advanced
Platform: NinjaTrader
Broker: IB, ThinkOrSwim, Kinetic
Trading: Options, Forex
Posts: 38 since Dec 2009
Thanks Given: 0
Thanks Received: 6

Hi All,

I need to enumerate all drawing objects on the chart that were created by some propriatary indicators ( I don't have access to source code). I need to get those strings, their tags and bar numbers.

Anyone knows how to implement this ?
Undocumented solutions will do.

Thank you.

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
23 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 thanks
  #3 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


foreach (ChartObject co in ChartControl.ChartObjects)
{
// do your stuff here
}


cheers

Reply With Quote
  #4 (permalink)
 TimeTrade 
Erfurt Germany
 
Experience: Master
Platform: rtMagic, NinjaTrader
Broker: AMP/CQG, IAB
Trading: ES, 6E, FDAX, FGBL
Posts: 338 since Aug 2011
Thanks Given: 54
Thanks Received: 461


Koepisch View Post
Hi,

with the above snippit i can't enumerate drawing objects, which were owned by other indicators. I want to enumerate triangles from an other indicator. How can i do that with Ninja 7?

Regards

"owned by other indicators"... without public exported ("strategy enabled") values, you dont have a warranty for stable results or the right sequence change/access on "drawing" only values...

Its work... while the NT7 databox use internal the same mothod to enumerate any indiactor plot values.

Reply With Quote
  #5 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518

I had tried this script, but it will show only my user drawn objects. Do you have another solution or can you share your test script? Can an indicator lock any access from outside?

Reply With Quote
  #6 (permalink)
 
AlBundy's Avatar
 AlBundy 
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 12


bukkan View Post
foreach (ChartObject co in ChartControl.ChartObjects)
{
// do your stuff here
}


cheers

When I run co.ToString() I receive all information regarding the drawn objects. Unfortunately the .ToString() function displays for StartY & EndY only 2 decimal digits and this is not enough - especially for FOREX. Example:

'Line' Time='2/6/2015 12:30:00 PM', StartBar='1722' StartY='1.13' EndTime='2/12/2015 9:00:00 AM' EndBar='1907' EndY='1.13'

In real StartY is 1.12601 and EndY is 1.12685 - as you see the above values are totally useless in case I want to save all user drawn lines into the database and re-draw them once the user opens the chart again. This object is a raising line and the returned information lets believe it is a horizontal line.

Is there any chance how to get a more accurate value [at least 4 digits after comma]?

Thank you!

Reply With Quote
  #7 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


AlBundy View Post
When I run co.ToString() I receive all information regarding the drawn objects. Unfortunately the .ToString() function displays for StartY & EndY only 2 decimal digits and this is not enough - especially for FOREX. Example:

'Line' Time='2/6/2015 12:30:00 PM', StartBar='1722' StartY='1.13' EndTime='2/12/2015 9:00:00 AM' EndBar='1907' EndY='1.13'

In real StartY is 1.12601 and EndY is 1.12685 - as you see the above values are totally useless in case I want to save all user drawn lines into the database and re-draw them once the user opens the chart again. This object is a raising line and the returned information lets believe it is a horizontal line.

Is there any chance how to get a more accurate value [at least 4 digits after comma]?

Thank you!

You could print individual elements and use the standard C# string formatting to get more places.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
AlBundy's Avatar
 AlBundy 
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 12


ratfink View Post
You could print individual elements and use the standard C# string formatting to get more places.

Sorry, but I don't understand how I should do it. In the IChartObject there is not any member for the Y values. Or what did you mean?

Reply With Quote
  #9 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


AlBundy View Post
Sorry, but I don't understand how I should do it. In the IChartObject there is not any member for the Y values. Or what did you mean?

I assume there is a nested access route through the object list, but I haven't used it so may be wrong.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623



AlBundy View Post
Sorry, but I don't understand how I should do it. In the IChartObject there is not any member for the Y values. Or what did you mean?

There is a Y object, try this:
 
Code
foreach (ChartObject co in ChartControl.ChartObjects)
{
    // do your stuff here
    Print(co.Y.ToString());
}

Reply With Quote




Last Updated on February 14, 2015


© 2024 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 - Privacy Policy - Downloads - Top
no new posts