Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 xiinteractive, 04-09-2024, 08:08 AM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Johnny Santiago, 10-11-2019, 09:21 AM
        95 responses
        6,193 views
        0 likes
        Last Post xiinteractive  
        Started by Irukandji, Today, 09:34 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by RubenCazorla, Today, 09:07 AM
        1 response
        6 views
        0 likes
        Last Post RubenCazorla  
        Started by TraderBCL, Today, 04:38 AM
        3 responses
        26 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X