Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily,Weekly,Monthly view Indicator

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

    Daily,Weekly,Monthly view Indicator

    I have a Indicator. My task is to add Daily, Weekly, Monthly views for that indicator.
    Anyone please guide and tell me the steps that i need to follow.


    In my Research i found that, 2 events have to be changed
    1. OnstateChange

    2. OnBarUpdate

    This is my OnBarUpdate() code:

    protected override void OnBarUpdate()
    {

    this._price = (this.Open[0] + this.High[0] + this.Low[0] + this.Close[0]) / 4.0;
    if (Bars.IsFirstBarOfSession)
    {
    this._VolumeSUM[0] = this.Volume[0];

    this._VolumePriceSUM[0] = this.Volume[0] * this._price;
    this._VolumePrice2SUM[0] = this.Volume[0] * this._price * this._price;
    }
    else
    {
    this._VolumeSUM[0] = this._VolumeSUM[1] + this.Volume[0];
    this._VolumePriceSUM[0] = this._VolumePriceSUM[1] + this.Volume[0] * this._price;
    this._VolumePrice2SUM[0] = this._VolumePrice2SUM[1] + this.Volume[0] * this._price * this._price;
    }

    this.Values[0][0] = this._VolumePriceSUM[0] / this._VolumeSUM[0];

    this._deviation = Math.Sqrt(Math.Max(0, this._VolumePrice2SUM[0] / this._VolumeSUM[0] - this.Values[0][0] * this.Values[0][0]));
    if (this._std1 > 0)
    {
    this.Values[1][0] = this.Values[0][0] + this._std1 * this._deviation;
    this.Values[2][0] = this.Values[0][0] - this._std1 * this._deviation;
    }
    else
    {
    this.Values[1].Reset();
    this.Values[2].Reset();
    }
    if (this._std2 > 0)
    {
    this.Values[3][0] = this.Values[0][0] + this._std2 * this._deviation;
    this.Values[4][0] = this.Values[0][0] - this._std2 * this._deviation;
    }
    else
    {
    this.Values[3].Reset();
    this.Values[4].Reset();
    }
    }

    If we modify these 2 events,is it enough or to add some more into code


    Please guide
    exactly
    what has to be added.can anyone share sample codes.
    Last edited by [email protected]; 08-17-2017, 12:14 AM.

    #2
    Hello,

    So I can best answer your question, could you please provide more information on what exactly you are attempting to do with the longer term time periods?

    Here are two samples which pull in additional data series, which it sounds like you may be looking for.
    Note: In NinjaTrader 8 It is no longer needed to use an indicator to sync a secondary series. This can be done directly from the Series<T> (https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?seriest.htm) constructor. This post is left for historical purposes. Series objects are useful for



    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      There is a custom Indicator and my task is to add daily,weekly,monthly profile views to it.I am new to Ninja Trader hence I need some help and guidance to implement this.
      Last edited by [email protected]; 08-17-2017, 12:41 AM.

      Comment


        #4
        Hello,

        I suggest looking at the pivots indicator preloaded with NinjaTrader for a reference sample for adding different time options, i.e daily, weekly, and monthly.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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