Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw a candle in an indicator

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

    Draw a candle in an indicator

    Hello all
    I'm looking to draw a candle on an indicator in a separate window, but I've searched here (https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?candleoutlinebrushes .htm) and nowhere do I see the option to draw a candle.
    My goal would be to "flatten" the bollinger bands, draw two horizontal lines, the top one representing the upper bollinger band and the bottom one representing the lower bollinger band. I'd like to position a candlestick on this horizontal band "relative" to its position between the bands, with the difference between the two bands representing 100%. I have no problem with the calculation, but I don't know how to draw the candlestick.
    Thanks for your help.​

    #2
    Hello RookyNT8,

    Drawing a candle would require using OnRender and custom rendering so you can draw a rectangle with the high and low price of the bar.

    You can see the chart style folder inside the NinjaScript editor and open the CandleStyle chart style for an example of drawing candles from OnRender. You would only need to view the OnRender portion of the code to see how to get the prices and use them for X/Y coordinates in OnRender.

    In that script it uses the bar data to render with, you can change that to use the indicator plots by using the indicators plots GetValueAt method. https://ninjatrader.com/support/help...sub=getvalueat

    Bollinger(2, 20).Upper.GetValueAt(index)
    Bollinger(2, 20).Lower.GetValueAt(index)

    Comment


      #3
      Thank you for your reply.
      I'll look into it and get back to you if I have a problem with the X/Y coordinates of the bars.​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      596 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X