Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Volume bar color coding

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

    Volume bar color coding

    How can I get the volume bars painted different colors based on the volume of the bar? I would like say 3 values, where the lowest value would paint a green candle, in between the lowest and middle yellow, between the last 2 values orange and above the 3rd value red candle. Is that possible?

    #2
    Hello axjurado,

    For bars you can color them using an indicator.



    An indicator could process the bar information and color the bars based on your condition. To check the volume in a condition you can do that like the following:

    Code:
    if(Volume[0] > 0 && Volume[0] < 100)
    {
    
    }
    That would check for a range of volume between 0 and 100 You could repeat this type of condition to make the lowest/middle values you wanted. For the upper end value you can just use a greater than condition.

    Code:
    if(Volume[0] > 500)
    {
    
    }
    JesseNinjaTrader Customer Service

    Comment


      #3
      thanks i was able to make it work.

      Comment


        #4
        I need to create an indicator based on the current bar volume compared to the previous bar volume. Basically paint Bar 0 if volume Bar1 < 50% of volume Bar 0.

        Thank You, Jamie Stephens

        Comment


          #5
          Hello JamieHendrix,

          Please open a new thread for any new questions you have about your own script. If you are having difficulty making that type of condition please ensure to include that so we know what specifically you needed help with.

          To make a condition comparing volume between bars you would need to use BarsAgo. Every series has brackets at the end [0] which indicates the BarsAgo, 0 meaning the most recent bar. You would need a condition that compares the 0 bars ago volume against the 1 bars ago volume. Because you want to know 50% you also need to use some math there to divide the volume by 2 to get half its value.
          JesseNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by manueldecastro, Yesterday, 10:26 AM
          6 responses
          25 views
          0 likes
          Last Post manueldecastro  
          Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
          24 responses
          75 views
          0 likes
          Last Post cmtjoancolmenero  
          Started by businessman1929, 04-29-2024, 01:28 PM
          3 responses
          32 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by mintos, 04-02-2024, 08:22 PM
          3 responses
          27 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Creamers, 04-27-2024, 05:32 AM
          13 responses
          74 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X