NexusFi: Find Your Edge


Home Menu

 





Range in Ticks indicator help


Discussion in NinjaTrader

Updated
    1. trending_up 1,552 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Range in Ticks indicator help

  #1 (permalink)
 ceramictilepro 
Roseville CA
 
Experience: Advanced
Platform: N7
Broker: Amp Futures/CQG
Trading: ES
Posts: 124 since Jun 2009
Thanks Given: 32
Thanks Received: 21

Hello,

I have an indicator that compiles fine but isn't quite what I was looking for.

It seems that it will have two prices markers (wanted just one) once both conditions are met. Below is the code and thanks for any help

 
Code
public class AVGTickRangeES : Indicator
    {
		#region Variables

		private int spike = 4;
		
		#endregion
		
        protected override void Initialize()
        {
			Add(new Plot(new Pen(Color.Red, 2), PlotStyle.Bar, "BigBar"));
			Add(new Plot(Color.Blue, PlotStyle.Bar, "StdBar"));
			CalculateOnBarClose = false;
        }
        protected override void OnBarUpdate()
        {
			
			double value = (( High[0] - Low[0]) / TickSize);
			if((High[0] - Low[0]) / TickSize > spike)
			{
			BigBar.Set(value);
			}	
			else
			{
			 StdBar.Set(value);
			}
		}	 
		#region Properties
        [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public DataSeries BigBar
        {
            get { return Values[0]; }
        }
		[Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public DataSeries StdBar
        {
            get { return Values[1]; }
        }

		[Description("")]
        [GridCategory("Parameters")]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public int Spike
        {
            get { return spike; }
            set { spike = Math.Max(1, value); }
			 //get { return Values[3]; }
        }
       
        
        #endregion

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
 
  #3 (permalink)
 
iPipper427's Avatar
 iPipper427 
Atlanta + GA/USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Forex
Posts: 34 since Jul 2012
Thanks Given: 57
Thanks Received: 14


It looks like if ( value > spike) should be your condition to me...just glancing at your code.... both statements should be same tho
Also you need to use the public property Spike not spike..caps makes a difference....


Also u want one marker when which 2 conditions are met....I only see 1 condition??

Reply With Quote
Thanked by:




Last Updated on August 17, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts