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 proptrade13, Today, 11:06 AM
    0 responses
    1 view
    0 likes
    Last Post proptrade13  
    Started by kulwinder73, Today, 10:31 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by RookieTrader, Today, 09:37 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by terofs, Yesterday, 04:18 PM
    1 response
    24 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by CommonWhale, Today, 09:55 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X