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 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 kaywai, Today, 06:26 AM
            1 response
            5 views
            0 likes
            Last Post kaywai
            by kaywai
             
            Started by ct, 05-07-2023, 12:31 PM
            6 responses
            203 views
            0 likes
            Last Post wisconsinpat  
            Started by kevinenergy, 02-17-2023, 12:42 PM
            118 responses
            2,779 views
            1 like
            Last Post kevinenergy  
            Started by briansaul, Today, 05:31 AM
            0 responses
            9 views
            0 likes
            Last Post briansaul  
            Started by traderqz, Yesterday, 12:06 AM
            11 responses
            28 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X