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 carnitron, Today, 08:42 PM
            0 responses
            5 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Today, 07:51 PM
            0 responses
            6 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,974 views
            3 likes
            Last Post jhudas88  
            Started by rbeckmann05, Today, 06:48 PM
            0 responses
            8 views
            0 likes
            Last Post rbeckmann05  
            Started by rhyminkevin, Today, 04:58 PM
            4 responses
            58 views
            0 likes
            Last Post dp8282
            by dp8282
             
            Working...
            X