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 FrancisMorro, Today, 03:24 AM
            0 responses
            1 view
            0 likes
            Last Post FrancisMorro  
            Started by Segwin, 05-07-2018, 02:15 PM
            10 responses
            1,769 views
            0 likes
            Last Post Leafcutter  
            Started by Rapine Heihei, 04-23-2024, 07:51 PM
            2 responses
            30 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by Shansen, 08-30-2019, 10:18 PM
            24 responses
            943 views
            0 likes
            Last Post spwizard  
            Started by Max238, Today, 01:28 AM
            0 responses
            10 views
            0 likes
            Last Post Max238
            by Max238
             
            Working...
            X