• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to display values of my Series<> in data box

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

    How to display values of my Series<> in data box

    I have created a series for holding some values among my variables as follows:

    private Series<int> TPO_BLdiff_Series;

    and added the following code in the OnStateChange() method:

    if (State == State.DataLoaded)
    {
    // "this" refers to the NinjaScript object itself. This syncs the Series object to historical data bars
    // MaximumBarsLookBack determines how many values the Series<double> will have access to

    TPO_BLdiff_Series = new Series<int>(this, MaximumBarsLookBack.Infinite);
    }

    For the OnBarUpdate() method, I have calculated values and added them to my series as follows:

    //my code for calculating and storing values

    if(VAt.IsValidDataPoint(0) && POC.IsValidDataPoint(0) && VAb.IsValidDataPoint(0))
    {
    TPO_BLdiff_Series[0] = Convert.ToInt32(100*(POC[0]-VAb[0]));
    }

    Now the hurdle I have been unable to overcome is how to display the values of my series in the data box. I don't know how to code the xml of the Properties region to achieve this so that if I hover my mouse cursor above a bar on the chart, I can see the value of TPO_BLdiff_Series for that bar in the data box. I have reached the limits of my programming know-how and would highly appreciate if someone could kindly help me to accomplish my desired task. Many thanks in advance.

    #2
    Hello mbesha,
    Thanks for your post.

    You need to assign your series to 'Value'. Try this.

    Code:
    if(VAt.IsValidDataPoint(0) && POC.IsValidDataPoint(0) && VAb.IsValidDataPoint(0))
    {
    	TPO_BLdiff_Series[0] = Convert.ToInt32(100*(POC[0]-VAb[0]));
    	Value[0] = TPO_BLdiff_Series[0];
    }
    Help Guide - Value
    JoshNinjaTrader Customer Service

    Comment


      #3
      Thanks JoshG. Does this hold true if I already have other Values[] in the indicator? As it stands, there are already Series<> objects ranging from Values[1] to Values[6] that are plotted on the chart.

      Comment


        #4
        Yes, you would need to assign a Value[] to any series to have it appear in the data box. You can assign as many Values as you like to appear in the data box starting at an index of zero.
        JoshNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hanstanz, Today, 04:44 AM
        0 responses
        9 views
        0 likes
        Last Post Hanstanz  
        Started by juniortut, Today, 04:38 AM
        0 responses
        5 views
        0 likes
        Last Post juniortut  
        Started by rojiinko, Today, 03:58 AM
        0 responses
        5 views
        0 likes
        Last Post rojiinko  
        Started by mreanuzlazx, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post mreanuzlazx  
        Started by xinepev, Today, 12:33 AM
        0 responses
        4 views
        0 likes
        Last Post xinepev
        by xinepev
         
        Working...
        X