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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        55 views
        0 likes
        Last Post CarlTrading  
        Working...
        X