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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        32 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        12 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        18 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        20 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X