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

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.



    Chris L.NinjaTrader Customer Service

    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()




        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        1 response
        12 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        9 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        387 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X