Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume Bar Times

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

    Volume Bar Times

    I have written an indicator to create a bar chart of the time durations of each bar (or average over several bars) to use with volume charts (and would probably work for tick charts). This time duration would give a way to watch the speed to volume for constant volume charts.

    The indicator compiles fine but nothing shows up on my charts. I think the time calculations are right, but think I am not specifiying the plot correctly.

    Please help.
    Attached Files

    #2
    If an indicator is not working as expected, see your Log tab for errors. Looking at your code, you are accessing Time[Periods] which for sure will throw an error since you need to make sure you have enough bars on your chart.

    Add something like:

    if (CurrentBar < Periods)
    return;
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks, that got it working great. I know you told me this before and it is sinking in.

      Comment


        #4
        Final code

        In response to a request, I am posting my final indicator code for the Volume Bar Times. Note that the horizontal line level is a personal choice that can be changed in the code.

        It will run as named, but if renamed, all instances of the name must be changed or the code won't work.

        Hope someone else finds this useful.

        Richard v W.
        Attached Files

        Comment


          #5
          Importing the code...

          NT wants to import only zipped files of some sort, how best to get this code into my setup? I tried making a new indicator of the same name and copying/pasting and ran into troubles.

          Comment


            #6
            Save the .cs file in the following folder:

            My Documents\NinjaTrader 6\bin\custom\indicator

            Then open up this file via Tools > Edit NinjaScript and compile.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 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
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X