Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use Volumetric stats in a script and display results on non-Volumetric chart

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

    How to use Volumetric stats in a script and display results on non-Volumetric chart

    Hello,

    my indicator use Volumetric bars type to be able to calculate its stats values. Now I want to display results (displayed as a Draw something when condition is true) on standard candlestick chart. Is there a way, how to do it?

    Thank you
    Sincerely,
    emuns

    #2
    Hello emuns, thanks for your post.

    You can use any of the Drawing methods to render a drawing tool. The Draw.TextFixed method can be used to render a large string with the data formatted into it (if you just want to display text). To get maximum flexibility you may override OnRender and do custom rendering. There is an example script on how this works titled "SampleCustomRender". Here is the help guide page on using SharpDX in NinjaScript.

    Kind regards.



    Comment


      #3
      Hello Chris,

      I meant something different. Part of the script is lower:

      NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = Bars.BarsSeries.BarsType as
      NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

      if (barsType == null)
      return;

      I suppose that I can´t do the calculations without that part. It works fine when applying the indicator on Volumetric bar chart. But when I apply the same indicator on Candlestick chart, than I receive an error in a Log:

      Error on calling 'OnBarUpdate' method on bar 0: Object reference not set to an instance of an object.

      Is there a way how to solve it?
      Thank you
      Sincerely,
      emuns

      Comment


        #4
        Hello emuns, thanks for your reply.

        You must make sure that your primary chart bars are volumetric for this to work. If you do not want the volumetric bars to be your primary series then use AddVolumetric()




        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        599 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        344 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
        558 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        557 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X