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

Custom DataSeries

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

    Custom DataSeries

    I want to produce a custom data series. In particular, want the VWAPs for a custom-selected volume bar to be stored in this series. As such, these bars will not be triggered by the primary series, nor any secondary series. In reading your documentation for "Series<T>" I don't see how this is possible. So, do you have any suggestions as to how to do this? Should I implement this in C#'s DataTables()?

    #2
    Hello spottysallrite,

    Thank you for your post.

    I'm not sure I exactly follow the use case here. Can you clarify a bit? I'm not sure what you mean by custom-selected volume bar.

    Series<t> variables would have to be synchronized with a data series, whether the primary series or another added series. You can see this example from our help guide on syncing to a secondary series:



    Thanks in advance, I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Ok, I want to have a series that uses a volume size that is a variable that I can optimize in the Strategy Analyzer.

      Comment


        #4
        Hello spottysallrite,

        Thank you for your reply.

        I'm still unclear here. What it's sounding like is that you'd add a secondary Volume data series, and have a user input that controls the size of the Voume series that you can then optimize on. You could then create a custom series synchronized to that secondary series and have a slot for each of those bars to hold the VWAP.

        Am I understanding correctly? If not, can you further clarify?

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Yes, that's what I want to do.

          Comment


            #6
            Hello spottysallrite,

            Thank you for your reply.

            I've created a relatively simple example script that adds a volume series based on user input that can be optimized, and then gets the Order Flow VWAP value for each bar of that series and saves it in a custom series synchronized to the volume series. Keep in mind that since the Order Flow VWAP requires tick data, optimizations using something like this would be expected to take a long time.

            Please let us know if we may be of further assistance to you.
            Attached Files
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Nice code! Thx for sending!

              Would it be possible to have a data collection object that contains a DateTime, VWAP, and standard deviation on a per minute (or Volume) basis ?

              And, would it be possible to produce the VWAP for each bar (whether time-based or custom volume), rather than for the entire day?

              BTW, some of my optimization runs take several hours, so "long runtimes" aren't much of an issue -- indeed, somewhat expected. That is, I almost always use a 1 tick series on the ES, with at 1 minute primary series on the ES, and use several years of data. Just for what it's worth.

              Comment


                #8
                Hello spottysallrite,

                Thank you for your reply.

                You could create an object holding those items and store that in a series, or just have a separate custom series that holds each one per bar, sure.

                It wouldn't be possible to produce a VWAP for just that bar though, those are session only - but the example would hold the current VWAP value as it was at each bar.

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by maybeimnotrader, Yesterday, 05:46 PM
                4 responses
                23 views
                0 likes
                Last Post maybeimnotrader  
                Started by frankthearm, Today, 09:08 AM
                6 responses
                25 views
                0 likes
                Last Post frankthearm  
                Started by adeelshahzad, Today, 03:54 AM
                5 responses
                33 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by stafe, 04-15-2024, 08:34 PM
                7 responses
                32 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by merzo, 06-25-2023, 02:19 AM
                10 responses
                824 views
                1 like
                Last Post NinjaTrader_ChristopherJ  
                Working...
                X