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 aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        238 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        4 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        125 views
        0 likes
        Last Post Leeroy_Jenkins  
        Working...
        X