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

Indicator to Plot Current Values Only

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

    Indicator to Plot Current Values Only

    Dear Support,

    How to modify an indicator such as the PriorDayOHLC to plot only the most recent PriorDayOHLC values without ploting the history data. This is usefull to reduce chart clutter.

    Thanks.

    #2
    Hello aligator,

    It would be necessary to call <Series>.Reset(barsAgo) on the previous bars.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello aligator,

      It would be necessary to call <Series>.Reset(barsAgo) on the previous bars.
      https://ninjatrader.com/support/help.../nt8/reset.htm
      Thank you Chelsea,

      But the Reset() does not return a value since the value will be set to zero. In the case of PriorDayOHLC, the values are simply constants that will plot horizontal lines on the current day. Any ways to simply delete or clear the historical lines? Or perhaps if there is a sample code that will plot only the most recent line within a certain span of time?

      Thanks

      Comment


        #4
        Hello aligator,

        The lines are plots.

        <Series>.Reset() unsets the plot between bar segments and removes the plot on those bars.

        You could also set the PlotBrushes to transparent for those bars.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello aligator,

          The lines are plots.

          <Series>.Reset() unsets the plot between bar segments and removes the plot on those bars.

          You could also set the PlotBrushes to transparent for those bars.
          Thanks Chelsea,

          Seems like I am not asking the right question since I can not get Reset() to do what I want.

          Let say I want to modify the PriorDayOHLC indicator to ONLY show (plot) values for the current day (Red BG) and does not show values for the past days (Green BG) in this screenshot. How do I do that?

          Many thanks.

          Attached Files

          Comment


            #6
            Hello aligator,

            The lines on the chart are plots added with AddPlot() in State.SetDefaults.

            As long as the plot has a value on a particular bar and the color is not set to transparent, the plot line is going to show on the chart.

            If you don't want the plot showing on the bars on previous days, it would be necessary to loop through those days and unset the plot so that there is no value on those bars (or set the PlotBrushes for each plot on that bar index to transparent).

            Unfortunately, my answer is still to loop through those bar indexes and use Values[plot index].Reset(bar index) to unset the values, or loop through those bar indexes and set the PlotBrushes to transparent.

            If you are trying to ask how to loop from the bar of the previous session to the first bar (bar 0), you can loop from Bars.BarsSinceNewTradingDay to CurrentBar.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            4 responses
            3,281 views
            1 like
            Last Post jgualdronc  
            Started by Option Whisperer, Today, 09:55 AM
            0 responses
            5 views
            0 likes
            Last Post Option Whisperer  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            8 responses
            58 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by halgo_boulder, 04-20-2024, 08:44 AM
            2 responses
            22 views
            0 likes
            Last Post halgo_boulder  
            Started by mishhh, 05-25-2010, 08:54 AM
            19 responses
            6,189 views
            0 likes
            Last Post rene69851  
            Working...
            X