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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      43 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      26 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      163 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      158 views
      2 likes
      Last Post CaptainJack  
      Working...
      X