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 Taddypole, 04-26-2024, 02:47 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by futtrader, 04-21-2024, 01:50 AM
        6 responses
        58 views
        0 likes
        Last Post futtrader  
        Started by sgordet, Today, 11:48 AM
        0 responses
        4 views
        0 likes
        Last Post sgordet
        by sgordet
         
        Started by Trader146, Today, 11:41 AM
        0 responses
        5 views
        0 likes
        Last Post Trader146  
        Started by jpapa, 04-23-2024, 07:22 AM
        2 responses
        22 views
        0 likes
        Last Post rene69851  
        Working...
        X