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

Plot only on current Candle

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

    Plot only on current Candle

    Hello All,

    I have made a very simple indicator called the Renko candle close line. It plots an object on the chart where the candle would close in both directions. The problem is that it plots on all the candles and I would love it to only plot on the current candle.

    Is there a way to remove plots that are not on the current candle?
    or perhaps code it to only plot on the current candle.

    Thanks in advance!

    AtemiWaza


    Code:
                          if (State == State.SetDefaults)
                          {
    				Bricksize			         		= 2;
    				Highcolour					= Brushes.DarkGreen;
    				Lowcolour					= Brushes.DarkRed;
                                    AddPlot(new Stroke(Highcolour, 2), PlotStyle.Hash, "Upplot");
    				AddPlot(new Stroke(Lowcolour, 2), PlotStyle.Hash, "Dnplot");
    			}
    			else if (State == State.Configure)
    			{
    			}
    		}
    
    		protected override void OnBarUpdate()
    		{
    			//Add your custom indicator logic here.
    			Upplot[0] = (Open[0] + (Bricksize * TickSize)) ;
    			Dnplot[0] = (Open[0] + (-Bricksize * TickSize));
    		}

    #2
    Hello AtemiWaza,

    Thank you for your note.

    Yes, you could remove or reset previous plot values to Transparent so that only the current plot values are visible. The following forum post provides an example of how this can be done,



    I would also suggest seeing the pivot indicator preloaded with NinjaTrader, which only shows current plot values.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    6 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X