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 judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            59 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Today, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Started by olisav57, Today, 07:39 PM
            0 responses
            7 views
            0 likes
            Last Post olisav57  
            Started by trilliantrader, Today, 03:01 PM
            2 responses
            21 views
            0 likes
            Last Post helpwanted  
            Started by cre8able, Today, 07:24 PM
            0 responses
            10 views
            0 likes
            Last Post cre8able  
            Working...
            X