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

get a bar with the Maximum volume over a period of time

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

    get a bar with the Maximum volume over a period of time

    1) get a bar with the Maximum volume over a period of time

    How is it possible to get?

    2) The second question is how you can get the maximum volume bar per day?

    Is there something similar like this

    Code:
     // store the highest bars ago value
    int highestBarsAgo = HighestBar(High, Bars.BarsSinceNewTradingDay);
    //evaluate high price from highest bars ago value
    double valueHigh = High[highestBarsAgo];
    But just for volume?

    Or any other options,
    thanks in advance.

    #2
    Hello memonolog,

    Thanks for your post.

    In your example code, you can replace High with Volume and that would provide you with the Highest bar volume from the beginning of the session.

    For the maximum volume over time (or over the period of your days to load) I would suggest to simply create a double variable to hold the maximum Volume and an int value to hold the bar number of the maximum Volume. Then in code, you could do something like:

    if (Volume[0] > maxVolume) //maxVolume is the double variable
    {
    maxVolume = Volume[0];
    maxVolumeBar = CurrentBar; //maxVolumeBar is the int variable
    }
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello memonolog,
      Let me share a simple code for max vol, you can refer this & modify as required. This marks Price level with max vol everyday.
      Attached Files

      Comment


        #4
        Originally posted by s.kinra View Post
        Hello memonolog,
        Let me share a simple code for max vol, you can refer this & modify as required. This marks Price level with max vol everyday.
        Hello, thanks for sharing, how do I understand this daily POC? - one specific price (price with the maximum volume per day) ??

        Comment


          #5
          Hello memonolog,
          This is not POC but PVP viz. Peak Volume Price as I have already mentioned in name. This will plot the Closing price of the bar with highest volume, its applicable to intra day time frames. So, this will identify the highest volume bar during a session & marks the price, you can print current bar index for better understanding. If you plot this on your chart it would be more clear. I shared it so you can have a clarity for understanding sessions & plot conditions. This is the nearest match to your requirement.

          Comment


            #6
            Originally posted by s.kinra View Post
            Hello memonolog,
            This is not POC but PVP viz. Peak Volume Price as I have already mentioned in name. This will plot the Closing price of the bar with highest volume, its applicable to intra day time frames. So, this will identify the highest volume bar during a session & marks the price, you can print current bar index for better understanding. If you plot this on your chart it would be more clear. I shared it so you can have a clarity for understanding sessions & plot conditions. This is the nearest match to your requirement.
            Thank you.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            9 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            20 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X