Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 zstheorist, Today, 07:52 PM
      0 responses
      3 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      149 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Working...
      X