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

indicator volume

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

    indicator volume

    Hi,
    This is my Sample code i have created
    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 customroc : Indicator
    	{
    		//ChartBars.Count
    		protected override void OnStateChange()
    		{
    			if (State == State.SetDefaults)
    			{
    				Description									= @"";
    				Name										= "customroc";
    				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;
    				Period					= 14;
    				Smooth					= 3;
    				AddPlot(Brushes.Green, "Abovezero");
    				AddPlot(Brushes.OrangeRed, "Belowzero");
    				AddLine(Brushes.Cornsilk, 1, "Zeroline");
    				
    				Plots[0].Min = 0;
    Plots[1].Max = 0;
     
    			}
    			else if (State == State.Configure)
    			{
    			}
    		}
    
    		protected override void OnBarUpdate()
    		{
    			//Add your custom indicator logic here.
    			if (CurrentBar < Period) return;
    		//double Abovezero = CurrentDayOHL().CurrentOpen[0];
    		//	double Belowzero = CurrentDayOHL().CurrentOpen[0];
    		//	Abovezero.Set(ROC(Period)[0]); 
    //Belowzero.Set(ROC(Period)[0]);
    			Abovezero[0] = CurrentDayOHL().CurrentOpen[0]; 
    			Belowzero[0] =  CurrentDayOHL().CurrentHigh[0];
    			Abovezero[0] =ROC(Period)[0];
       Belowzero[0] = ROC(Period)[0];
    			
    		
    
    		}
    
    		#region Properties
    		[NinjaScriptProperty]
    		[Range(1, int.MaxValue)]
    		[Display(Name="Period", Order=1, GroupName="Parameters")]
    		public int Period
    		{ get; set; }
    
    		[NinjaScriptProperty]
    		[Range(1, int.MaxValue)]
    		[Display(Name="Smooth", Order=2, GroupName="Parameters")]
    		public int Smooth
    		{ get; set; }
    
    		[Browsable(false)]
    		[XmlIgnore]
    		public Series<double> Abovezero
    		{
    			get { return Values[0]; }
    		}
    
    		[Browsable(false)]
    		[XmlIgnore]
    		public Series<double> Belowzero
    		{
    			get { return Values[1]; }
    		}
    
    		#endregion
    
    	}
    }
    
    #region NinjaScript generated code. Neither change nor remove.
    
    namespace NinjaTrader.NinjaScript.Indicators
    {
    	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    	{
    		private customroc[] cachecustomroc;
    		public customroc customroc(int period, int smooth)
    		{
    			return customroc(Input, period, smooth);
    		}
    
    		public customroc customroc(ISeries<double> input, int period, int smooth)
    		{
    			if (cachecustomroc != null)
    				for (int idx = 0; idx < cachecustomroc.Length; idx++)
    					if (cachecustomroc[idx] != null && cachecustomroc[idx].Period == period && cachecustomroc[idx].Smooth == smooth && cachecustomroc[idx].EqualsInput(input))
    						return cachecustomroc[idx];
    			return CacheIndicator<customroc>(new customroc(){ Period = period, Smooth = smooth }, input, ref cachecustomroc);
    		}
    	}
    }
    
    namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
    {
    	public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
    	{
    		public Indicators.customroc customroc(int period, int smooth)
    		{
    			return indicator.customroc(Input, period, smooth);
    		}
    
    		public Indicators.customroc customroc(ISeries<double> input , int period, int smooth)
    		{
    			return indicator.customroc(input, period, smooth);
    		}
    	}
    }
    
    namespace NinjaTrader.NinjaScript.Strategies
    {
    	public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
    	{
    		public Indicators.customroc customroc(int period, int smooth)
    		{
    			return indicator.customroc(Input, period, smooth);
    		}
    
    		public Indicators.customroc customroc(ISeries<double> input , int period, int smooth)
    		{
    			return indicator.customroc(input, period, smooth);
    		}
    	}
    }
    
    #endregion
    Click image for larger version

Name:	indicator expand.png
Views:	1
Size:	95.3 KB
ID:	907558
    I need to expand the pointof indicator and after expanding the box will arrive , Need to chnage that box border color what is the method are code please expaline me.

    #2
    Thank you for your question [email protected] . The Stroke argument to AddPlot can be used to control a plot's width.

    Code:
    [FONT=Courier New]
    // http://ninjatrader.com/support/helpGuides/nt8/en-us/addplot.htm
    AddPlot(new Stroke(Brushes.ForestGreen, DashStyleHelper.Solid, [B]/* Your width here */[/B] [B]10.0[/B]), PlotStyle.Line, "ExamplePlot");[/FONT]
    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    8 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,615 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Yesterday, 05:56 PM
    0 responses
    10 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    20 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Working...
    X