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 Stanfillirenfro, Today, 07:23 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        2 responses
        22 views
        0 likes
        Last Post cmtjoancolmenero  
        Started by olisav57, Yesterday, 07:39 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cocoescala, 10-12-2018, 11:02 PM
        7 responses
        944 views
        0 likes
        Last Post Jquiroz1975  
        Started by oviejo, Today, 12:28 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X