Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

VolumetricsBar data access under Market Analyzer

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

    VolumetricsBar data access under Market Analyzer

    Hi,

    If I create my own indicator which uses volumetrics bar data can I access that indicator data under Market Analyzer ?

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

    I tried to access it and getting Null.

    Basically I would like to see Delta, Min/Max Delta under Market Analyzer. Is it possible to do it?





    #2
    Hello greenhollow803,

    Thank you for your post and welcome to the NinjaTrader forum community!

    You may need to check for null references in your script:


    You should be able to use Order Flow Volumetric Bars in your indicator and set the desired values, such as Delta and Min/Max delta to plots in the indicator with AddPlot():


    Then, in the Market Analyzer, you would select which plot value that you would like to see in the column where you add the indicator. You could add it multiple times to see different plots for each instance of it. I suggest adding Print statements to check the value of the plots as you test the script as an indicator as well as an indicator column in the Market Analyzer. For more info on using prints to debug your scripts:


    Please let us know if we may be of further assistance.

    Comment


      #3
      Thanks for your response.
      I tried with Null checks and Print statements. Then only I realized that VolumetricBar is Null.
      When added this "barType is Null" got printed. Any suggestions on what I am doing wrong here?

      Code Snippet below.

      protected override void OnBarUpdate()
      {
      //Add your custom indicator logic here.
      if (CurrentBar == 0){
      Print(" -Analyzer Delta currentbar is zero");
      Value[0] = 0;

      }else
      {

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

      if (barsType == null){
      Print("barType is Null");
      return;
      }

      Print("Analyzer Delta :"+barsType.Volumes[CurrentBar].BarDelta);
      Value[0] = barsType.Volumes[CurrentBar].BarDelta;

      }

      }​


      Last edited by greenhollow803; 09-28-2023, 10:16 AM.

      Comment


        #4
        Hello greenhollow803,

        Thank you for your reply.

        The way you have this set up would be to use Volumetric Bars as the primary series type; when configuring the indicator on a Market Analyzer, you will need to select Volumetric for the type in the Data Series section of the indicator column settings. For example:
        World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


        Otherwise, you could change the script to add a volumetric series with AddVolumetric() then you would use the code shown in the comment for the snippet on the following page:

        Code:
               // This sample assumes the Volumetric series is the primary DataSeries on the chart, if you would want to add a Volumetric series to a  
        
               // script, you could call AddVolumetric() in State.Configure and then for example use
               // NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = BarsArray[1].BarsType as
        
               // NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
        ​
        Please let me know if I may be of further assistance.

        Comment


          #5
          That worked. Thank you very much for your help

          Comment


            #6
            If I use AddVolumetric()​ do I need to Hard code the Instrument name? I added couple of instruments under Market Analyzer. If I hard code the instrument name AddVolumetric()​ then how can I get all the instrument information?

            Comment


              #7
              Hello greenhollow803,

              Thank you for your reply.

              Yes, calls of AddVolumetric() require you to specify the instrument name. This should be a hard-coded value and not something supplied dynamically. In the case of the Market Analyzer, you will likely need to consider reverting back to using volumetric as the primary series by setting it up in the indicator column's Data Series settings as I previously described:
              when configuring the indicator on a Market Analyzer, you will need to select Volumetric for the type in the Data Series section of the indicator column settings. For example:
              https://www.screencast.com/t/QWdxUkHA
              You would also need to use the following in your code for the volumetric as the primary series:
              Code:
                      NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = Bars.BarsSeries.BarsType as    
                      NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;​
              I had not considered this when previously advising on adding a volumetric series and how that would affect the data in market analyzer columns; I apologize for any inconvenience.

              Please let me know if I may be of further assistance.

              Comment


                #8
                Thanks for the clarification

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                50 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                126 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                69 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                42 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X