Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Marking high velocity price

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

    Marking high velocity price

    Hello. I want to mark high intensity (velocity) exact price in a bar.
    I found an indicator with similar concept but I want to apply this concept to enable in 60 second, 3 min etc time based chart.
    Measuring trade intensity with the free Pace of Tape indicator - NinjaTrader Support Forum
    ^^ Pace of Tape Indicator ^^ - NinjaTrader Ecosystem
    The above is marking the bar but I want to mark exact price as I have shown attached in image.​​

    Velociy is calculated based on period (eg, 30 second)
    Speed of velocity will be Base velocity will be average of tick for set velocity period (e,g 5) bars.

    Speed of velocity = average tick voluve during period (30sec) for the past 5 bars
    Threshold (e,g, 2)

    I want to mark exact price for the price where Speed of velocity is above threshold like in image.
    For example, if average 5 bars of 30 sec tick volume is 100, and threshold is set 2. I want to mark the price where 30sec tick volume is above 200.

    Marble


    Attached Files
    Last edited by Marble; 12-14-2024, 05:16 AM.

    #2
    Hello Marble,

    Below I am providing a link to a support article with helpful resources on getting started with C# and NinjaScript.


    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.


    The script you have provided does have a 'Period' input for the number of seconds, so you could change this to 60 or 180.

    I am happy to answer any specific questions you have if you decide to code a custom script or make modifications to the existing script.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Unfortunately the link is not what I am looking for.
      Also
      >The script you have provided does have a 'Period' input for the number of seconds, so you could change this to 60 or 180.

      This does not mean anything.

      The pace of tape is for tick chart only, And it would not work if applied to 60 sec chart,
      where to change code to work for 60 sec chart​
      where to chage code to calculate average for 5 bars for 30 sec period
      How to get exact price where tick exceeds threshold

      to start with.modification of below code.


      Code:
      protected override void OnStateChange()
      
      {
      if (State == State.SetDefaults)
      {
      Name = "PaceOfTapeNT8";
      Description = "Enter the description of your new custom indicator here";
      AddPlot(new Stroke(Brushes.Cyan, 1), PlotStyle.Bar, "POT Normal");
      AddPlot(new Stroke(Brushes.Orange, 1), PlotStyle.Bar, "POT High");
      
      AddPlot(Brushes.Black, "HMAPOT");
      AddPlot(Brushes.Orange, "HMAPLUS");
      paces = new Series<double>(this);
      
      Calculate = Calculate.OnEachTick;
      IsOverlay = false;
      }
      }
      
      protected override void OnBarUpdate()
      {
      int pace = 0;
      int i = 0;
      while(i < CurrentBar)
      {
      TimeSpan ts = Time[0] - Time[i];
      if (ts.TotalSeconds < period) {
      pace += Bars.BarsPeriod.Value;
      //load VMA series
      paces[0] = pace;
      } else {
      break;
      }
      ++i;
      }
      
      //calculate HMA
      Values[2][0] = HMA(paces, volatilityPeriod)[0];
      
      threshold = (int) Values[2][0] + thresholdMin;
      
      Values[3][0] = threshold;
      
      if(pace >= threshold) {
      Values[1][0] = pace;
      } else {
      Values[0][0] = pace;
      Values[1][0] = 0;
      }
      
      
      if (paintbars) {
      if(pace >= threshold) {
      BarBrush = Plots[1].Pen.Brush;
      CandleOutlineBrush = Brushes.Black;
      BackBrushAll = bgColor;
      } else {
      // BarBrush = Brushes.Transparent;
      BarBrush = null;
      BackBrushAll = Brushes.Transparent;
      }
      }​

      Comment


        #4
        Hello Marble,

        I'm not seeing any logic that specifies a bar type.

        The current logic is looking at the number of seconds of the 'period' input. This loops over the bars that are within the specified number of seconds and isn't bar type specific that I can see.

        It appears the 'if(pace >= threshold)' condition is where the threshold is exceeded.

        You may want to consult with the original author for information about how the code works and how to modify the logic.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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