PDA

View Full Version : DrawRegionProblem


maitreja
06-17-2009, 12:30 AM
Hi all.

I have solved the following problem with DrawRegion Method:

The Indicators functionality is draw region inside the price chart ....

1. draw three region (OK) /see screen1.jpg/
2. draw six region (OK)
3. draw three region and six region inside one price chart within one trading day (Problem)

I want to use this indicator subsequently in this case:

From 15:30 till 17:20 (CET) = draw three region
From 17:20 till 22:00 (CET) = draw six region

/see modified screen2.jpg/

The problem come on at 17:20 when the indicator change three region to six.
The six region doesn't start at 17:20, it starts at 15:30 and REPAINT the first part (15:30 - 17:20)!

/see screen_problem.jpg/

My question is: How to prohibit repainting of the first part (15:30 - 17:20)?

Thank you in advanced!

NinjaTrader_Bertrand
06-17-2009, 06:10 AM
maitreja, you probably access the wrong draw object tag ID and / or start/end bars ago if it does not repaint correctly on your set times - http://www.ninjatrader-support.com/HelpGuideV6/DrawRegion.html

maitreja
06-17-2009, 07:14 AM
Hi Bertrand. Thank you for answer, but I don't think so.
There is condition when daily range of prices are > parameter, change display mode.
I think it is better to join code
maitreja

NinjaTrader_Bertrand
06-17-2009, 08:52 AM
Thanks - how would you plot 6 regions with this? I spot one input related to this and depending on the setting you either plot 3 regions or 2.

maitreja
06-17-2009, 10:02 AM
Yes, please use settings from the attached screenshot. If you will use today's NQ 09-09, you will see the same picture on your monitor.
changes against basic ind. settings:
1. C_middleColor to yellow - to see it on the white background
2. P_divideParts - to true

NinjaTrader_Bertrand
06-17-2009, 10:37 AM
maitreja, thanks - the only DateTime comparison I see is the one where you check for the 15:30 time to start calcuations....unfortunately I don't see where you would make the 6 region swich at 17:20?

maitreja
06-18-2009, 01:03 AM
Yes, I have changed commentaries in code to english, sorry for czech :-)
17:20 time is not exaactly time to change display type.
Upper and lower thirds is dividing to next thirds or halfs, if the basic third is larger than predefined size (third value). In basic settings it means when difference between daily High and Low is larger then 15 points ( parameter P_thirdValue = 5).

NinjaTrader_Bertrand
06-18-2009, 06:31 AM
maitreja, thanks for the translated comments - I would suggest printing out the values you set for the region boundaries in the 'divide thirds in halfs' part...the lower ones appear to be 0.