Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

rectangle height in pixel?

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

    rectangle height in pixel?

    Hello,

    I would like to draw a colored box with text into a chart that stretches from the first bar on which certain conditions apply to the last bar where this is the case. I would like for this box to have a FIXED height.

    DrawText provides a fixed height, but doesn't allow me to define something like "endBarsAgo". It will only draw a colored textbox starting at "startBarsAgo" that ends when the text ends.

    DrawRectangle allows me to specify "startBarsAgo" end "endBarsAgo", so I reckon I could just put a DrawText box on top of it. The only thing I couldn't figure out so far is how to assign a fixed height to the rectangle. Unlike the DrawText box it scales (even when I set autoscale = false, since I have to assign a certain "endY" value) which looks rather ugly on the chart and I would like for it to have the same fixed height as the text box.

    How do I accomplish that? Is there maybe a different work-around that I'm not aware of?

    Cheers, Greg

    #2
    Thought I just mention that using the same "startBarsAgo" and "startY" values for DrawText and DrawRectangle when trying to put one on top of the other does NOT do what I would have expected. Neither do the two draw objects start at the same bar nor at the same y value but with certain offsets. Any ideas why that's the case?

    Comment


      #3
      Hi greg814,

      Unfortunately, beyond the setting that the overloads offer, there is no supported way for accomplishing this.

      There may however be some unsupported ways.
      Some helpful resources...
      1. NinjaScript Consultants - http://www.ninjatrader.com/webnew/pa...injaScript.htm
      2. Unsupported section of our forum - http://www.ninjatrader-support2.com/...ad.php?t=22435
      3. Using the intellisense, see what ChartControl offers you - http://www.ninjatrader-support.com/H...l?Intellisense
      4. Take a look at the PowerVolume indicators for more unsupported material - http://www.ninjatrader-support.com/H...lumeIndicators
      5. And finally, at "Tools>Edit NS>Indicators>CustomPlotSample" can offer you some ideas.
      TimNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      607 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      353 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      560 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      561 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X