Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cumulative $Tick

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

    Cumulative $Tick

    Hi,

    Attached is the cumulative sum of study from SC. I was wondering if there is anyway to replicate this in NT8. Thank you.


    #2
    Hello Jake Darby,

    Thanks for your post.

    The description of their study is often better than interpreting the chart.

    Publicly available link - https://www.sierrachart.com/index.ph...e_Sum_of_Study

    Reading this, it is just a sum of all of a particular value. We can use the SUM indicator in NinjaTrader to accomplish the same.

    SUM - https://ninjatrader.com/support/help...mation_sum.htm

    The BarsAgo reference for the first bar on the chart would be CurrentBar, or SUM(InputSeries, CurrentBar)[0]. Where InputSeries is an indicator or PriceSeries like Open, High, Low, or Close.

    The BarsAgo reference for the first bar of a session would be CurrentBar - MyFirstBarOfSession, where MyFirstBarOfSession is assigned the current bar index from CurrentBar, when IsFirstBarOfSession is true.

    This result could be assigned to an indicator plot value to make a regular indicator out of the calculation.

    AddPlot - https://ninjatrader.com/support/help...t8/addplot.htm

    Indicator tutorials - https://ninjatrader.com/support/help...indicators.htm

    We look forward to assisting.
    Last edited by NinjaTrader_Jim; 03-21-2022, 12:28 PM.

    Comment


      #3
      Thank you Jim. Would this be done through the wizard? This will be my first attempt at modifying an indicator.

      Comment


        #4
        Hello Jake Darby,

        The New Indicator wizard will generate a template that has the plots added. It cannot create a whole indicator for you and apply the OnBarUpdate code to assign plot values, but the Region portion that maps the friendly named Series<double>'s to the indicator plots will be generated. This is the part where you are having trouble.

        The tutorials will be very beneficial for understanding the procedure to building indicators and can help draw the rest of the picture for building indicators.

        Comment


          #5
          Hi,

          I tried to develop the above indicator. I had it in NT7 but not in NT8. See below my code. Something is not working. Some help would be more than welcome.



          protected override void OnBarUpdate()
          {
          //Add your custom indicator logic here.
          // int firstBarIndex = Math.Max(BarsRequired, this.FirstBarIndexPainted);

          if (Bars.IsFirstBarOfSession)
          {
          MyFirstBarOfSession=CurrentBar;
          }
          else
          {
          value+=SUM(Close,MyFirstBarOfSession)[0];
          }

          AddPlot(new Stroke(Brushes.Red), PlotStyle.Bar,"value");
          }

          Comment


            #6
            Hello mktforecast,

            The first step in making indicators would be know how to create plots and assign values to plots. Plots are created in OnStateChange, most often in State.SetDefaults, and then in OnBarUpdate, the Values[Plot Number][BarsAgo] is assigned with your plot value.

            Our indictor tutorials and AddPlot documentation can help to walk you through creating an indicator, creating plots, and assigning values.

            Have you been able to go through the tutorials and create the indicators there? The information provided in #2 should be every developer's first step in making indicators.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            345 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            558 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X