NexusFi: Find Your Edge


Home Menu

 





Range in Ticks indicator help


Discussion in NinjaTrader

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




 
Search this Thread
  #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?
May 26 Deadline Dies at 7.5% as US Strikes Iran During C …
Prediction Markets & Event Contracts
More Than Capable: Hegseths War Warning Validates $114M …
Prediction Markets & Event Contracts
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #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


© 2026 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 - Downloads - Top
no new posts