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
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rhyminkevin, Today, 04:58 PM
        3 responses
        48 views
        0 likes
        Last Post Anfedport  
        Started by iceman2018, Today, 05:07 PM
        0 responses
        5 views
        0 likes
        Last Post iceman2018  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        7 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        50 views
        0 likes
        Last Post futtrader  
        Working...
        X