Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Shadows created by DrawRegion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Harry
    replied
    Had to go back to the Baloo - Speech Balloon look of DrawRegion().

    Reason: DrawRectangle() covers recklessly all bars and lines, where as DrawRegion() stays politely behind.

    I would like to know why all of these Draw Functions are coded in a different way. There seems to be no logic behind the design, but they just seem to work at random. Some draw behind other indicators, other above. Some react to the initialization with ZOrder = -1, others don't. Some draw on the right margin of the chart, some don't.

    Does this follow any concept?

    Leave a comment:


  • Harry
    replied
    Further strange finding

    Further finding:

    DrawRegion plots behind the lines and text, Draw Rectangle plots above the lines and text. Why is that?

    Leave a comment:


  • Harry
    replied
    Decoration

    And by the way there are other DrawMethods that draw nice and useless pictures on the right margin....

    See chart below.
    Attached Files

    Leave a comment:


  • Harry
    replied
    I had used unique DrawRegions for each day (different tags), did not help at all.

    Originally posted by NinjaTrader_Bertrand View Post
    Great idea, Reset would only apply to the plot for visualization purposes. I believe as workaround a unique DrawRegion for each day would help.

    Leave a comment:


  • Harry
    replied
    There seems to be a bug in DrawRectangle() as it draws over the right margin of the chart.

    DrawRegion() does not draw over the right margin, but has the Baloo look.

    So both have bugs. See chart attached.
    Attached Files

    Leave a comment:


  • Harry
    replied
    New problem:

    Indicator plots text via customized plot and draws a rectangle. How can I convince the indicator not to plot the filled rectangle on top of the text?
    Last edited by Harry; 08-17-2010, 01:08 PM.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Great idea, Reset would only apply to the plot for visualization purposes. I believe as workaround a unique DrawRegion for each day would help.

    Leave a comment:


  • Harry
    replied
    Have now replaced DrawRegion() with DrawRectangle(). The latter method plots properly, as opposed to DrawRegion(). With ZOrder set to -1, rectangles plot nicely behind price.

    Leave a comment:


  • Harry
    replied
    That is correct. How can I draw regions that look correct then?

    If I reset -> does not work
    If I set to zero -> does not work, the speech balloon will point to zero

    So whatever I do, no correct region is drawn between two horizontal lines or even other data series, if these are session related. Reset() should do the trick and tell DrawRegion() not to draw.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Harry, looking at your code this issue seems to be related to pivots plot value being reset on the first bar of the session, hence the DrawRegion would have the Close price value at this point, this is what you see visualized.

    Leave a comment:


  • Harry
    replied
    Problem is independent from Infinite/256 lookback.

    I have coded an indicator by adding just a few lines to the native NinjaTrader pivots indicator. Chart and indicator attached.

    The problem:

    When I reset the two data series that contain the region to be drawn, DrawRegion plots a triangle from the upper and lower border of the region to price (next bar). When the dataseries changes back from Reset() to display a value, DrawRegion draws a reverse triangle from price to the upper and lower border.

    The region gets a convex shape, or in the chart below, an appearance like a speech balloon.
    Attached Files
    Last edited by Harry; 08-17-2010, 10:30 AM.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Harry, can you please share the code so I can look into on my end? Were you using Infinite or 256 for the DataSeries?

    Leave a comment:


  • Harry
    replied
    DrawRegion plotting convex rectangles

    I use DrawRegion to color the opening range and the night session range.

    The fill between the two horizontal lines looks a bit like Baloo, the bear.
    Attached Files

    Leave a comment:


  • Harry
    replied
    Sorry, was my own fault!

    The shadow was my own fault, discoverd this today.

    However, DrawRegion() will not always work correctly with NT7, if Maximum bars look back is set to "TwoHundredFiftySix". This is as expected, and it will display correctly, once you change it to "Infinite". That is due to the trade-off between RAM use and perfection.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    If anybody runs into an unexpected outcome based on the previous info posted here, please either post your code demonstrating the issue or send us a note to support at ninjatrader dot com and reference this thread so we can check into.

    Thanks for the support.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by CarlTrading, 03-31-2026, 09:41 PM
1 response
82 views
1 like
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 04-01-2026, 02:41 AM
0 responses
43 views
0 likes
Last Post CarlTrading  
Started by CaptainJack, 03-31-2026, 11:44 PM
0 responses
64 views
2 likes
Last Post CaptainJack  
Started by CarlTrading, 03-30-2026, 11:51 AM
0 responses
68 views
0 likes
Last Post CarlTrading  
Started by CarlTrading, 03-30-2026, 11:48 AM
0 responses
56 views
0 likes
Last Post CarlTrading  
Working...
X