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 burtoninlondon, Today, 12:38 AM
        0 responses
        4 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        12 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,982 views
        3 likes
        Last Post jhudas88  
        Working...
        X