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 f.saeidi, Today, 11:02 AM
        1 response
        1 view
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by geotrades1, Today, 10:02 AM
        4 responses
        12 views
        0 likes
        Last Post geotrades1  
        Started by rajendrasubedi2023, Today, 09:50 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by lorem, Today, 09:18 AM
        2 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Today, 05:20 AM
        4 responses
        30 views
        0 likes
        Last Post geddyisodin  
        Working...
        X