Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BuySell Volume Plots Question

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

    BuySell Volume Plots Question

    Hi guys, I've attached a small indicator that shows BuySellVolume difference. It works fine, except I made a modification. Here's a pic of the result I get https://www.screencast.com/t/d0eIFCIDe7U

    The problem is the Sell Volume keeps plotting even when it's time for the BuyVolume to plot. The original code
    Code:
     BuySellDiff[1] = buys - sells;
    works fine, So I tried to add 2 separate plots, if you can look at the indicator and see what is going on. Very small code.
    Code:
     if (BuySellDiff[1] > 0)
    {
    PlotBrushes[0][1] = Brushes.Green;
    //DGMOD
    BuyVol[1] = BuySellDiff[1] ;
    SellVol[1] = 0;
    }
    else
    {
    PlotBrushes[0][1] = Brushes.Red;
    //DGMOD
    BuyVol[1] = 0;
    SellVol[1] = BuySellDiff[1] ;
    }
    Please help if you can. I literally can't see anything wrong with this, yet I can't get SellVol[plot] to stay @ 0 value whenever the BuySellDiff[plot] > 0;
    Attached Files

    #2
    Hello ginx10k,

    Thank you for your post.

    Your issue doesn't appear to be in that section of the code, but rather this part:

    Code:
     if (BuySellDiff[0] > 0) // update intrabar
    {
    PlotBrushes[0][0] = Brushes.Green;
    
    //DGMOD:
    BuyVol[0] = BuySellDiff[0] ;
    [B]SellVol[1] = 0;[/B]
    }
    else
    {
    PlotBrushes[0][0] = Brushes.Red;
    
    //DGMOD:
    [B]SellVol[1] = BuySellDiff[1] ;[/B]
    BuyVol[0] = 0;
    }
    When you're updating intrabar, you're updating the previous bar's SellVol the the previous bar's BuySellDiff if the current bar's BuySellDiff is negative and setting it to 0 if the current BuySellDiff is negative. Changing this to the following should yield the behavior you're expecting:

    Code:
     if (BuySellDiff[0] > 0) // update intrabar
    {
    PlotBrushes[0][0] = Brushes.Green;
    
    //DGMOD:
    BuyVol[0] = BuySellDiff[0] ;
    [B]SellVol[0] = 0;[/B]
    }
    else
    {
    PlotBrushes[0][0] = Brushes.Red;
    
    //DGMOD:
    [B]SellVol[0] = BuySellDiff[0] ;[/B]
    BuyVol[0] = 0;
    }
    Please let us know if we may be of further assistance to you.

    Comment


      #3
      . NinjaTrader_Kate, thank you so much, I can't believe I didn't see that. It works now. Much appreciated!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      560 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      325 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X