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

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 maybeimnotrader, Yesterday, 05:46 PM
    1 response
    18 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Perr0Grande, Yesterday, 08:16 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by f.saeidi, Yesterday, 08:12 AM
    3 responses
    25 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by algospoke, Yesterday, 06:40 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by quantismo, Yesterday, 05:13 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X