Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume Bars

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

    Volume Bars

    Can I make the volume bars colored based on the price action of the bar - green is an up bar or candle, red is a down bar or candle...

    #2
    Hello Ace2231,

    Thanks for your post.

    You could create a custom NinjaScript indicator to accomplish this.

    AddPlot() would be used to add a plot to a custom NinjaScript indicator.

    The value of the Volume indicator (VOL()[0]) could be assigned to the plot.

    PlotBrushes could be used to set the color of the plot when a certain condition occurs.

    To detect if the bar is an up bar, you would create a condition that checks if the Close price (Close[0]) is greater than the Open price (Open[0]). Then, call PlotBrushes inside that condition to change the color of the plot in your script.

    To detect if the bar us a down bar, you would create a condition that checks if the Close price (Close[0]) is less than the Open price (Open[0]). Then, call PlotBrushes inside that condition to change the color of the plot.

    See the help guide documentation below for more information.

    AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm
    VOL(): https://ninjatrader.com/support/help...nt8/volume.htm
    PlotBrushes: https://ninjatrader.com/support/help...lotbrushes.htm

    The C# programming language is used for developing NinjaScript indicators and strategies.

    To create a NinjaScript indicator, open a New > NinjaScript Editor window, select the '+' tab at the bottom of the Editor window, select 'New Indicator'. Then, you could set up as much of the indicator as possible in the Indicator Builder. This will create the framework of the indicator or strategy

    Once you finish setting up as much as possible in the Indicator Builder, you must manually program the rest of the indicator.

    Below is a link to a forum post with helpful information about getting started with NinjaScript.
    https://ninjatrader.com/support/foru...040#post786040

    If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
    https://ninjatrader.com/support/help...g_concepts.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    47 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X