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

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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.

            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,403 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            94 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            6 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X