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

How to set up a dataseries of volume of first 5 minutes ?

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

    How to set up a dataseries of volume of first 5 minutes ?

    I am wondering if I can setup a dataseries of the volume traded in first 5 minutes everyday such that I can compare those volumes to see, say, if today first 5 minutes volume is bigger than the average volume traded of previous 5 days?
    Last edited by randomwalker; 05-29-2010, 11:33 PM.

    #2
    randomwalker, you could set a dataseries for exmaple for the first bar on the 5 minute chart only and then average those datapoints, however I think it would be easier to just store the first 5 min bar volume from the prior days in a double value and then compare as needed in your code.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I tried to code as follows(suppose I have already setup dataseries fbv):

      if (Bars.BarsSinceSession == 0){fbv.Set(Volume[0]);}
      else {fbv.Set(0);}

      However, by coding like above, I think I get dataseries of Volume[0],0,0,....0. Is there any way to only store the first 5 minutes volume for everyday?

      Comment


        #4
        randomwalker, unfortunately not as a value had to be stored for each bar a dataseries is synched to. You could try storing those values in a custom ArrayList for example.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          randomwalker, unfortunately not as a value had to be stored for each bar a dataseries is synched to. You could try storing those values in a custom ArrayList for example.
          I am not familiar with ArrayList. Can you give a example of how to create a custom ArrayList to store values?

          Comment


            #6
            I suggest you check into threads on this more general C# topic here in the forums, since this is unfortunately outside of the scope we can support here - http://www.ninjatrader.com/support/f...ad.php?t=24801
            BertrandNinjaTrader Customer Service

            Comment


              #7
              [QUOTE=NinjaTrader_Bertrand;169800]randomwalker, you could set a dataseries for exmaple for the first bar on the 5 minute chart only and then average those datapoints, however I think it would be easier to just store the first 5 min bar volume from the prior days in a double value and then compare as needed in your code.[/QUOTE


              How to set up a dataseries for first-30-minute-volume? For example, if the whole 30-minute-volume data for two days are 1 2 3 4 5 6 7 8 9 10 11 12 13(for the first day) and 13 12 11 10 9 8 7 6 5 4 3 2 1 (for the second day), and the dataseries I want to set up only stores 1 and 13, 1 is the first-30-minute-volume for the first day and 13 is the first- 30 - minute-volume for the second day.

              Comment


                #8
                Hello,

                I am jumping in here, but maybe I can help.
                Set up a DataSeries per this link:


                Then filter time (Time[0]) to determine when you should record the value in the DataSeries.
                DenNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by PaulMohn, Today, 05:00 AM
                0 responses
                6 views
                0 likes
                Last Post PaulMohn  
                Started by ZenCortexAuCost, Today, 04:24 AM
                0 responses
                6 views
                0 likes
                Last Post ZenCortexAuCost  
                Started by ZenCortexAuCost, Today, 04:22 AM
                0 responses
                3 views
                0 likes
                Last Post ZenCortexAuCost  
                Started by SantoshXX, Today, 03:09 AM
                0 responses
                16 views
                0 likes
                Last Post SantoshXX  
                Started by DanielTynera, Today, 01:14 AM
                0 responses
                5 views
                0 likes
                Last Post DanielTynera  
                Working...
                X