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

Ticks per minute or Minutes per bar

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

    Ticks per minute or Minutes per bar

    I am using a Tick based chart and would like to know the speed of the market. I have tried volume but it does not tell me what I want to know. I cannot find another indicator on this site or that comes with NT7. I've tried the "AverageTick.zip" indicator. I've also tried "Bar Timer" but this indicator does not work on a tick based chart.

    Basically a simple line graph of the rate of ticks per minute or a graphical representation of how many minutes it took to complete each bar is needed.

    I have no C# coding experience but am willing to learn a bit if someone can push me in the right direction with this project.

    Thanks!

    #2
    Hello BReal,

    Thank you for your post.

    I am unaware of a pre-existing indicator that will perform what you require. However, this can be built with a multi-series script that adds the 1 Tick period type to the code to count the ticks per minute. The count would need to be an int added to the code.

    For information on multi-series script please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm

    Comment


      #3
      Diy ?

      Originally posted by BReal View Post
      I am using a Tick based chart and would like to know the speed of the market. I have tried volume but it does not tell me what I want to know. I cannot find another indicator on this site or that comes with NT7. I've tried the "AverageTick.zip" indicator. I've also tried "Bar Timer" but this indicator does not work on a tick based chart.

      Basically a simple line graph of the rate of ticks per minute or a graphical representation of how many minutes it took to complete each bar is needed.

      I have no C# coding experience but am willing to learn a bit if someone can push me in the right direction with this project.

      Thanks!
      Using the indicator shell create and empty indicator, with no input and one plot.
      Replace the OnBarUpdate() code, where indicated, with the following. It should be self-explanatory: it shows the time elapsed per bar.

      Code:
      if (CurrentBar < 1) return;
      Plot0.Set((Time[0] - Time[1]).TotalMinutes);
      You can use TotalSeconds, or TotalMilliseconds if that gives you a more sensible output for your purposes.

      Comment


        #4
        Hey Koganam!

        Thanks for the reply! I'm not sure I understand though. Here is the code I have from the shell indicator.

        Code:
        public class TimePerBar : Indicator
            {
                #region Variables
                // Wizard generated variables
                // User defined variables (add any user defined variables below)
                #endregion
        
                /// <summary>
                /// This method is used to configure the indicator and is called once before any bar data is loaded.
                /// </summary>
                protected override void Initialize()
                {
                    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                    Overlay				= false;
                }
        
                /// <summary>
                /// Called on each bar update event (incoming tick)
                /// </summary>
                protected override void OnBarUpdate()
        From what you said it sounds like I replace that last part "OnBarUpdate()" with what you gave me below. I tried that but it won't compile. Here's what it looks like. I'm getting "Class member declaration expected." and "] expected." errors.

        Code:
         public class TimePerBar : Indicator
            {
                #region Variables
                // Wizard generated variables
                // User defined variables (add any user defined variables below)
                #endregion
        
                /// <summary>
                /// This method is used to configure the indicator and is called once before any bar data is loaded.
                /// </summary>
                protected override void Initialize()
                {
                    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                    Overlay				= false;
                }
        
                /// <summary>
                /// Called on each bar update event (incoming tick)
                /// </summary>
                if (CurrentBar < 1) return;
        	Plot0.Set((Time[0] - Time[1]).TotalMinutes);

        Comment


          #5
          google "ninjatrader bar speed timer" it free and it counts how long it takes to form a tick or range candle.

          Comment


            #6
            Originally posted by BReal View Post
            Hey Koganam!

            Thanks for the reply! I'm not sure I understand though. Here is the code I have from the shell indicator.

            Code:
            public class TimePerBar : Indicator
                {
                    #region Variables
                    // Wizard generated variables
                    // User defined variables (add any user defined variables below)
                    #endregion
            
                    /// <summary>
                    /// This method is used to configure the indicator and is called once before any bar data is loaded.
                    /// </summary>
                    protected override void Initialize()
                    {
                        Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                        Overlay                = false;
                    }
            
                    /// <summary>
                    /// Called on each bar update event (incoming tick)
                    /// </summary>
                    protected override void OnBarUpdate()
            From what you said it sounds like I replace that last part "OnBarUpdate()" with what you gave me below. I tried that but it won't compile. Here's what it looks like. I'm getting "Class member declaration expected." and "] expected." errors.

            Code:
             public class TimePerBar : Indicator
                {
                    #region Variables
                    // Wizard generated variables
                    // User defined variables (add any user defined variables below)
                    #endregion
            
                    /// <summary>
                    /// This method is used to configure the indicator and is called once before any bar data is loaded.
                    /// </summary>
                    protected override void Initialize()
                    {
                        Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                        Overlay                = false;
                    }
            
                    /// <summary>
                    /// Called on each bar update event (incoming tick)
                    /// </summary>
                    if (CurrentBar < 1) return;
                Plot0.Set((Time[0] - Time[1]).TotalMinutes);
            You must not have modified the code correctly. I do not see an OnBarUpdate() event handler in your code.

            Comment


              #7
              That's perfect! Thanks!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by hurleydood, 09-12-2019, 10:45 AM
              14 responses
              1,091 views
              0 likes
              Last Post Board game geek  
              Started by cre8able, Yesterday, 04:16 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by cre8able, Yesterday, 04:22 PM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by stafe, 04-15-2024, 08:34 PM
              5 responses
              28 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by StrongLikeBull, Yesterday, 04:05 PM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X