Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PVP indicator question..

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

    PVP indicator question..

    Hi,

    I had a question about the attached indicator - ( see the code below) . The PVP indicator gives you the closing price for the highest / Maximum volume bar on any given day / session.

    Is there a way to adjust this indicator to get the closing price for the bar that is 20 bars before / ahead of the highest / Maximum volume bar on any given day / session? Thanks for your feedback..

    double MaxVolume = 0;
    double MaxPrice = 0.0;
    for (int x = 0; x <= Bars.BarsSinceSession; x++)
    {
    if (Volume[x] > MaxVolume)
    {
    MaxVolume = Volume[x];
    MaxPrice = Close[x];
    }
    }
    PVPLine.Set(MaxPrice);

    #2
    Hello,

    If I understand what you want, you would like this:
    MaxPrice = Close[x];
    To record 20 bars back in history? If so, I have not tested this, but couldn't you just do this?:
    MaxPrice = Close[x + 20];
    DenNinjaTrader Customer Service

    Comment


      #3
      Feedback

      Hi,

      I tried both of the scripts below. Neither of them worked unfortunately. The scripts produced a blank screen. Any suggestions...

      if (CurrentBar < 20)return;
      double MaxVolume = 0;
      double MaxPrice = 0.0;
      for (int x = 0; x <= Bars.BarsSinceSession; x++)
      {
      if (Volume[x] > MaxVolume)
      {
      MaxVolume = Volume[x];
      MaxPrice = Close[x + 20];
      }}
      Plot0.Set(MaxPrice);


      double MaxVolume = 0;
      double MaxPrice = 0.0;
      for (int x = 0; x <= Bars.BarsSinceSession; x++)
      {
      if (Volume[x] > MaxVolume)
      {
      MaxVolume = Volume[x];
      MaxPrice = Close[x + 20];
      }}
      Plot0.Set(MaxPrice);

      Comment


        #4
        Shawn, please do not double post the same question in different threads. I replied to your other one already this morning, please check into it and reply there if it helped.

        Thanks

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        86 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        48 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        29 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        32 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        67 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X