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

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)
    JesseNinjaTrader Customer Service

    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 JoMoon2024, Today, 06:56 AM
      0 responses
      6 views
      0 likes
      Last Post JoMoon2024  
      Started by Haiasi, 04-25-2024, 06:53 PM
      2 responses
      17 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      5 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Started by poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Working...
      X