Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting the Close of a secondary Bars object

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

    Plotting the Close of a secondary Bars object

    Hello,

    I read the Help files about the Add(), BarsArray and BarsInProgress methods in order to figure out how to plot the Close of a 2097 tick Bars object in a chart of the 233 tick Bars object.
    I wrote this code which does not work
    HTML Code:
        public class Plot2097Ticks : Indicator
        {
            #region Variables
            #endregion
    
            /// <summary>
            /// </summary>
            protected override void Initialize()
            {
                // Add a 2097 tick Bars object - BarsInProgress index = 1 
        		Add(PeriodType.Tick, 2097);
    		Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                CalculateOnBarClose	= false;
                Overlay				= false;
                PriceTypeSupported	= false;
            }
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
               Plot0.Set(Closes[1][0]);
            }
    What did I omit ?

    Gerard

    #2
    Hi grd974,

    Thank you for your post.

    First off, what version of NinjaTrader are you using? Please keep in mind multi-frame code is only available for strategies in NinjaTrader 6.5
    TimNinjaTrader Customer Service

    Comment


      #3
      Hi,
      I use Ninja Trader 6.5.1000.14

      Comment


        #4
        Hi grd974,

        Please see my previous response.

        This must be done in a strategy.

        With NinjaTrader 7, this will be available in indicators as well.
        TimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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