Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

add instrument and dataseries

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

    add instrument and dataseries

    Hello,

    I want to ask please how can I add volumetric dataseries to an indicator so that I dont need to modify always for instruments and dataseries and have it running for same instrument, base period type and base period value as primary dataseries.

    AddVolumetric("???", BarsPeriodType.???, ???, VolumetricDeltaType.BidAsk, 1);

    Thank you!
    Tony
    Last edited by tonynt; 09-13-2022, 03:24 AM. Reason: translation error

    #2
    Hello tonynt,

    The AddVolumetric currently does not have an override to allow for inheriting the primary instrument, you would need to manually enter the instrument name and other details in the code.

    Comment


      #3
      Hi Jesse,

      I recall there was something with "null"....isnt this referring to the instrument on the chart? And how can be the base type and period used same as in chart?

      Thank you!
      Tony

      Comment


        #4
        Hello tonynt,

        With AddDataSeries you can do that for just the instrument name but its not suggested because AddDataSeries already has an overload set to inherit the primary instrument name. None of the Add data methods have the ability to inherit the primary bar information like the period or type. In general AddVolumetric is not intended to be dynamic, you need to hard code it as the help guide mentions.

        Comment


          #5
          Hello,

          working on another indicator and searching in my codes I found a script where there is in an indicator that is working ok:

          AddVolumetric(null, BarsPeriodType.Range, valuedataseries, VolumetricDeltaType.BidAsk, 1);

          Whats wrong with this as I do not understand from your reply why this is not possible?

          Thank you!
          Tony

          Comment


            #6
            Hello tonynt,

            Whats wrong with this as I do not understand from your reply why this is not possible?

            Because that won't work in all tools and is not a reliable way to make sure the correct data is loaded, this is specifically noted in all Add help guide pages:

            •Arguments supplied to AddVolumetric() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided.
            https://ninjatrader.com/support/help...ightsub=addvol

            By not hard coding it you run the risk of the script working incorrectly or providing incorrect results. If you plan to use this in a live trade situation you may find that the information you are basing trades off of is unreliable or incorrect. We do not suggest trying to work around that for this reason. That is why it is specifically mentioned in the help guide to avoid doing that.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X