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

custom bar types

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

    custom bar types

    Hello,

    I have an indicator that plots text based bar types. I turn the actual NT generated bars off (set them transparent). The issue is that scaling is not always good. I also want to now get a little graphical. I think I need to build my own bar type. This would also probably be more efficient that adding the 1000's of text/drawing objects to the chart I do now.

    Is there an example of how to build a custom bar type. I did look around and search as I believe I've seen an official one before, but I cannot find it now.

    My bars are ladder type charts, so mainly text. I want to add some graphical boxes too. If there is any more efficient way you'd recommend I do this, please let me know.

    Thanks.

    #2
    Hello pjsmith,

    Thank you for the post.

    I am gathering some information for you and will be back with a reply shortly.

    I look forward to assisting further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello pjsmith,

      Thank you for your patience.

      To create your own custom bar types, you must understand the BarTypes class as well as the ChartStyle class. The BarsType class allows you to manipulate, organize, and present data that will eventually be drawn to your chart with a ChartStyle class. The ChartStyle class does the actual drawing to the chart and are where you will use SharpDX objects to render bars, and whatever else you would like to accompany the bars (like text).

      You may browse the source code of BarsType and ChartStyle by opening a NinjaScript editor, and on the right, in the folders list, there are folders named BarsTypes and ChartStyles.

      To fully understand SharpDX and how the rendering works and I recommend you look at the SampleCustomRender file inside of the Indicators folder.

      Drawing on the chart will take place in OnRender() within your ChartStyle class.

      Please see the following links for more information:

      Using SharpDX for Custom Chart Rendering - https://ninjatrader.com/support/help..._rendering.htm

      BarsType - https://ninjatrader.com/support/help...?bars_type.htm

      ChartStyle - https://ninjatrader.com/support/help...hart_style.htm

      Please let us know if we may be of any further assistance.
      Chris L.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ghoul, Today, 06:02 PM
      3 responses
      14 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      44 views
      0 likes
      Last Post jeronymite  
      Started by Barry Milan, Yesterday, 10:35 PM
      7 responses
      20 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by AttiM, 02-14-2024, 05:20 PM
      10 responses
      180 views
      0 likes
      Last Post jeronymite  
      Started by DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      13 views
      0 likes
      Last Post DanielSanMartin  
      Working...
      X