Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why newly created indicator is not visible in the chart list?

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

    Why newly created indicator is not visible in the chart list?

    Hi,
    I have created the new indicator ,and compiled there is no error in the file but to apply this indicator to chart in the list my indicator is not showing, please see on code below.
    Code:
    #region Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.DrawingTools;
    #endregion
    
    //This namespace holds Indicators in this folder and is required. Do not change it. 
    namespace NinjaTrader.NinjaScript.Indicators
    {
    	public class Tickreplay : Indicator
    	{
    		int alertBar;
    		int PeriodType=10;
    		int Minute;
     //AddPlot(Brushes.Orange, "SMA");
    			//	Add (PeriodType.Minute, 10);
    		protected override void OnStateChange()
    		{
    			if (State == State.SetDefaults)
    			{
    				Description									= @"acessing the tick replay";
    				Name										= "Tickreplay";
    				Calculate									= Calculate.OnBarClose;
    				IsOverlay									= false;
    				DisplayInDataBox							= true;
    				DrawOnPricePanel							= true;
    				DrawHorizontalGridLines						= true;
    				DrawVerticalGridLines						= true;
    				PaintPriceMarkers							= true;
    				ScaleJustification							= NinjaTrader.Gui.Chart.ScaleJustification.Right;
    				//Disable this property if your indicator requires custom values that cumulate with each new market data event. 
    				//See Help Guide for additional information.
    				IsSuspendedWhileInactive					= true;
    				Price					= 14;
    				Volume					= 4;
    				PeriodType = 10;
    				int Minute=15;
    				BarsRequiredToPlot = 10; // Do not plot until the 11th bar on the chart
             AddPlot(Brushes.Orange, "SMA");
    				//PaintPriceMarkers = true; // Indicator plots values display in the y-axis     
            AddPlot(Brushes.Orange, "SMA");
    				//AddPlot (PeriodType.Minute, 10);
    				double value = CurrentDayOHL().CurrentOpen[0];
    //sAddPlot (PeriodType.Minute, 20);
    
    //CalculateOnBarClose = false;
    			}
    			else if (State == State.Configure)
    			{
    				AddDataSeries("ES 06-17", Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Ask);
    				AddDataSeries("ES 06-17", Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Bid);
    			}
    		}
    
    		protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
    		{
    			
    		}
    
    		protected override void OnBarUpdate()
    		{
    			//Add your custom indicator logic here.
    			if (BarsInProgress != 0)        // all series get the update so we'll use the original chart one only
        return;
    
    if ((int)(SMA(Closes[1],5)[0]) == (int)(SMA(Closes[2],10)[0]))
    {
        if (CurrentBar != alertBar)
        {
            // draw or make a sound here
    
            alertBar = CurrentBar;
    	}
    				
    	}
    		}
    
    		#region Properties
    		[NinjaScriptProperty]
    		[Range(1, int.MaxValue)]
    		[Display(Name="Price", Order=1, GroupName="Parameters")]
    		public int Price
    		{ get; set; }
    
    		[NinjaScriptProperty]
    		[Range(1, int.MaxValue)]
    		[Display(Name="Volume", Order=2, GroupName="Parameters")]
    		public int Volume
    		{ get; set; }
    		#endregion
    
    	}
    }
    
    #region NinjaScript generated code. Neither change nor remove.
    
    namespace NinjaTrader.NinjaScript.Indicators
    {
    	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    	{
    		private Tickreplay[] cacheTickreplay;
    		public Tickreplay Tickreplay(int price, int volume)
    		{
    			return Tickreplay(Input, price, volume);
    		}
    
    		public Tickreplay Tickreplay(ISeries<double> input, int price, int volume)
    		{
    			if (cacheTickreplay != null)
    				for (int idx = 0; idx < cacheTickreplay.Length; idx++)
    					if (cacheTickreplay[idx] != null && cacheTickreplay[idx].Price == price && cacheTickreplay[idx].Volume == volume && cacheTickreplay[idx].EqualsInput(input))
    						return cacheTickreplay[idx];
    			return CacheIndicator<Tickreplay>(new Tickreplay(){ Price = price, Volume = volume }, input, ref cacheTickreplay);
    		}
    	}
    }
    
    namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
    {
    	public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
    	{
    		public Indicators.Tickreplay Tickreplay(int price, int volume)
    		{
    			return indicator.Tickreplay(Input, price, volume);
    		}
    
    		public Indicators.Tickreplay Tickreplay(ISeries<double> input , int price, int volume)
    		{
    			return indicator.Tickreplay(input, price, volume);
    		}
    	}
    }
    
    namespace NinjaTrader.NinjaScript.Strategies
    {
    	public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
    	{
    		public Indicators.Tickreplay Tickreplay(int price, int volume)
    		{
    			return indicator.Tickreplay(Input, price, volume);
    		}
    
    		public Indicators.Tickreplay Tickreplay(ISeries<double> input , int price, int volume)
    		{
    			return indicator.Tickreplay(input, price, volume);
    		}
    	}
    }
    
    #endregion
    please revert me what the problem its not imported one i have created newly.

    #2
    Hello [email protected],

    Thank you for your post.

    Please go to the Log tab of the NinjaTrader Control Center. You should see an error in relation to your indicator on the Log tab. Please detail exactly what this error reports.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X