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 futtrader, 04-21-2024, 01:50 AM
    4 responses
    41 views
    0 likes
    Last Post futtrader  
    Started by Option Whisperer, Today, 09:55 AM
    1 response
    11 views
    0 likes
    Last Post bltdavid  
    Started by port119, Today, 02:43 PM
    0 responses
    7 views
    0 likes
    Last Post port119
    by port119
     
    Started by Philippe56140, Today, 02:35 PM
    0 responses
    7 views
    0 likes
    Last Post Philippe56140  
    Started by 00nevest, Today, 02:27 PM
    0 responses
    7 views
    0 likes
    Last Post 00nevest  
    Working...
    X