Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volumetric data for custom bar

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

    Volumetric data for custom bar

    Hi, I would like to know how to extract volumetric data for a custom type bar.
    The NT built-in volumetric data only shows the data for tick, second, minute, range, and a few limited more options.
    My other bar type is similar to regular bars with time, and OHLC, a combination of time and volume bar type. Thanks.

    #2
    Hello Photon66,

    Thank you for your post.

    This would be outside of what is supported by NinjaTrader Support.

    However, it may be possible and this thread will remain open for any community members that would like to assist.

    Below I am providing a public link to the help guide on VolumetricBars that may give you pointers about what would need to be recreated in the custom bar type.
    https://ninjatrader.com/support/help...tric_bars2.htm

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon, Thank you for the reply. Just curious: is it possible to use Custom Bar in the following command?

      AddVolumetric(null, BarsPeriodType.MyCustomBarType, ParamtersOfMyCustomBar, VolumetricDeltaType.BidAsk, 1);


      Thank you

      Comment


        #4
        Hello Photon66,

        Thank you for your note.

        As stated in the Warnings section of the AddVolumetric() help guide documentation, arguments supplied to AddVolumetric() should be hardcoded. Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided.

        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. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner.

        See the help guide documentation below for more information.
        AddVolumetric() - https://ninjatrader.com/support/help...volumetric.htm

        Let us know if we may further assist.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi Brandon, Thank you for the reply. I am confused about the notion of dynamic and being hard coded. Here MyCustomBar is hard coded; for example, it can be Alan Percent Bars (could not think of a better example that is free) which is installed as an add-on Bar Type and I would like to see Volumetric display for this type. Thank you.

          Comment


            #6
            Hello Photon66,

            Thank you for your note.

            With custom bar types a unique ID must be chosen. If two scripts use the same ID, only one of them will show in the 'Type' list of a bar type.

            The first 14 IDs for BarsPeriodType are reserved by NinjaTrader.

            As stated in the Tips section of the AddDataSeries() help guide documentation, You can add a custom BarsType which is installed on your system by casting the registered enum value for that BarsPeriodType. For example: AddDataSeries((BarsPeriodType)14, 10); This means that you would need to use the id of the custom bar type.

            (BarsPeriodType)14 would be considered Volumetric bars, for example.

            Below is a publicly available link to a helpful script that lists the IDs for each bar type.
            https://ninjatraderecosystem.com/use...pe-identifier/

            See the help guide documentation for more information.
            BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm
            AddDataSeries() - https://ninjatrader.com/support/help...dataseries.htm

            Let us know if we may assist further.

            The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Great. Thank you for the suggestions. What I got from the Bar ID are:

              ROE Bars - 1342
              BarsTypeIdentifier(ES 06-21 ( 20, 1000, 200 ROE))


              ROE is a paid BarsType that is closed source. ROE bar needs 3 parameters, for example (20, 1000, 200).

              When I try this

              AddVolumetric(null, (BarsPeriodType)1342, ( 20, 1000, 200), VolumetricDeltaType.BidAsk, 1);

              I get errors that that expression is invalid. I do not know how to enter the 3 parameters into the above code.

              Thank you.




              Comment


                #8
                Hello Photon66,

                Thank you for your note.

                You can specify optional BarsPeriod values (such as Value2) of a custom BarsType in the BarsPeriod object initializer. For example: AddDataSeries(new BarsPeriod() { BarsPeriodType = (BarsPeriodType)14, Value = 10, Value2 = 20 }); This is seen in the AddDataSeries() help guide documentation.

                That said, unfortunately, this will only work with some base bar types. BarsPeriodType Value would be available but not Value2.

                I have submitted a feature request to the Development team regarding having an overload method that allows you to set multiple values for a BarsPeriod. I will follow up with an internal tracking number for your reference as soon as it is created.

                Let us know if we may assist further.
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  That would be great. Thank you very much.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by yodaler, Today, 06:12 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post yodaler
                  by yodaler
                   
                  Started by op1031, Today, 05:16 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post op1031
                  by op1031
                   
                  Started by fscabrera03, Today, 01:18 PM
                  1 response
                  12 views
                  0 likes
                  Last Post fscabrera03  
                  Started by BottomShark77, Today, 12:20 PM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_ShawnB  
                  Started by bowling, Today, 06:16 AM
                  3 responses
                  30 views
                  0 likes
                  Last Post NinjaTrader_ShawnB  
                  Working...
                  X