H-igh L-ow C-lose bars - NinjaTrader | futures io social day trading
futures io futures trading


H-igh L-ow C-lose bars
Updated: Views / Replies:7,740 / 30
Created: by spx_tdr Attachments:9

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 9  
 
Thread Tools Search this Thread
 

H-igh L-ow C-lose bars

  #21 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, IB TWS
Broker/Data: IB, Kinetic
Favorite Futures: Stocks, Forex
 
Posts: 97 since Nov 2011
Thanks: 47 given, 16 received


cory View Post
after ( note the left bracket)
......
protected override void OnBarUpdate()
{

add this;

if(Close[0]>Open[0])
{
PlotColors[0][0] = Color.Blue;
PlotColors[1][0] = Color.Blue;
PlotColors[2][0] = Color.Blue;
PlotColors[3][0] = Color.Blue;
}
if(Close[0]<Open[0])
{
PlotColors[0][0] = Color.Red;
PlotColors[1][0] = Color.Red;
PlotColors[2][0] = Color.Red;
PlotColors[3][0] = Color.Red;
}
else
{
PlotColors[0][0] = Color.Gray;
PlotColors[1][0] = Color.Gray;
PlotColors[2][0] = Color.Gray;
PlotColors[3][0] = Color.Gray;
}


Hello cory,

Thank you very much for your response/assistance. I have followed your suggestion, however , it's doing doing what I want. Below is the amended code following your suggestion, is there something I have done wrong?

Many thanks
Dan

 
Code
//
// Copyright (C) 2006, NinjaTrader LLC <www.ninjatrader.com>.
// NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
//
// Modified by MrJoe
//   14.may.2011 - first release
//   15.may.2011 - automatic resize of the closing tick line 
//

#region Using declarations
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
using System.Xml.Serialization;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    /// <summary>
    /// HLC Bars for VSA.
    /// </summary>
    [Description("HLC Bars for VSA")]
    public class KayHLCBars : Indicator
    {
        #region Variables
        private Color           savePenColor         = Color.Transparent;
        private Color           savePen2Color        = Color.Transparent;
        private Color           saveDownColor        = Color.Empty;
        private Color           saveUpColor          = Color.Empty;
        private Color           m_barColor           = Color.Red;
        private Pen				m_barPen		     = null;
		private int             m_barWidth           = 0;
        #endregion

		
        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
            Add(new Plot(Color.Red, PlotStyle.Line, "MOpen"));
            Add(new Plot(Color.Red, PlotStyle.Line, "MHigh"));
            Add(new Plot(Color.Red, PlotStyle.Line, "MLow"));
            Add(new Plot(Color.Red, PlotStyle.Line, "MClose"));
			ZOrder				= 1;
            PaintPriceMarkers   = false;
            CalculateOnBarClose = false;
            PlotsConfigurable   = false;
            Overlay             = true;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
			
			if(Close[0]>Open[0])
{
PlotColors[0][0] = Color.Blue;
PlotColors[1][0] = Color.Blue;
PlotColors[2][0] = Color.Blue;
PlotColors[3][0] = Color.Blue;
}
if(Close[0]<Open[0])
{
PlotColors[0][0] = Color.Red;
PlotColors[1][0] = Color.Red;
PlotColors[2][0] = Color.Red;
PlotColors[3][0] = Color.Red;
}
else
{
PlotColors[0][0] = Color.Gray;
PlotColors[1][0] = Color.Gray;
PlotColors[2][0] = Color.Gray;
PlotColors[3][0] = Color.Gray;
}
			
			
		
			MClose.Set(Close[0]);
            MHigh.Set(High[0]);
            MLow.Set(Low[0]);
        }

        #region Properties


        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MOpen
        {
            get { return Values[0]; }
        }

        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MHigh
        {
            get { return Values[1]; }
        }

        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MLow
        {
            get { return Values[2]; }
        }

        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MClose
        {
            get { return Values[3]; }
        }	
		
        [Description("Forced HLC bar width (0 = use Data Series settings).")]
        [Category("Settings")]
        [Gui.Design.DisplayNameAttribute("Bar width")]
        public int HLCBarWidth
        {
            get { return m_barWidth; }
            set { m_barWidth = value; }
        }

        [XmlIgnore]
        [Description("Color of bars.")]
        [Category("Settings")]
        [Gui.Design.DisplayNameAttribute("Color of bars")]
        public Color HLCBarColor
        {
            get { return m_barColor; }
            set { m_barColor = value; }
        }

        [Browsable(false)]
        public string HLCBarColorSerialize
        {
            get { return Gui.Design.SerializableColor.ToString(m_barColor); }
            set { m_barColor = Gui.Design.SerializableColor.FromString(value); }
        }


        #endregion

		private int GetBarWidth()
		{
			if ( m_barWidth != 0 ) {
				return m_barWidth;
			}
			else {
				return Bars.BarsData.ChartStyle.BarWidthUI;
			}
		}
		
        protected override void OnStartUp()
        {
            if (ChartControl == null || Bars == null)
                return;
            savePenColor                        = Bars.BarsData.ChartStyle.Pen.Color;
            savePen2Color                       = Bars.BarsData.ChartStyle.Pen2.Color;
            saveUpColor                         = Bars.BarsData.ChartStyle.UpColor;
            saveDownColor                       = Bars.BarsData.ChartStyle.DownColor;
            Bars.BarsData.ChartStyle.Pen.Color  = Color.Empty;
            Bars.BarsData.ChartStyle.Pen2.Color = Color.Empty;
            Bars.BarsData.ChartStyle.DownColor  = Color.Empty;
            Bars.BarsData.ChartStyle.UpColor    = Color.Empty;
            m_barPen                            = new Pen(m_barColor, GetBarWidth());
       }

        protected override void OnTermination()
        {
            if (ChartControl != null && Bars != null)
            {
                Bars.BarsData.ChartStyle.Pen.Color = savePenColor;
                Bars.BarsData.ChartStyle.Pen2.Color = savePen2Color;
                Bars.BarsData.ChartStyle.UpColor = saveUpColor;
                Bars.BarsData.ChartStyle.DownColor = saveDownColor;
            }

            if (m_barPen != null) m_barPen.Dispose();
       }

        public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
        {
			if (Bars == null || ChartControl == null)
                return;

			if ( GetBarWidth() != m_barPen.Width ) {
				m_barPen.Dispose();
				m_barPen = new Pen(m_barColor, GetBarWidth());
			}
			
			int tickWidth = Math.Max(3, 2 + 3 * (GetBarWidth() - 1));
			
            for (int idx = FirstBarIndexPainted; idx <= LastBarIndexPainted; idx++)
            {
                if (idx - Displacement < 0 || idx - Displacement >= BarsArray[0].Count || (!ChartControl.ShowBarsRequired && idx - Displacement < BarsRequired))
                    continue;
                double valH = MHigh.Get(idx);
                double valL = MLow.Get(idx);
                double valC = MClose.Get(idx);
                int x = ChartControl.GetXByBarIdx(BarsArray[0], idx);
                int y2 = ChartControl.GetYByValue(this, valH);
                int y3 = ChartControl.GetYByValue(this, valL);
                int y4 = ChartControl.GetYByValue(this, valC);

                graphics.DrawLine(m_barPen, x, y2, x, y3);
				graphics.DrawLine(m_barPen, x, y4, x + tickWidth, y4);
            }
        }

    }
}

#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    public partial class Indicator : IndicatorBase
    {
        private KayHLCBars[] cacheKayHLCBars = null;

        private static KayHLCBars checkKayHLCBars = new KayHLCBars();

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public KayHLCBars KayHLCBars()
        {
            return KayHLCBars(Input);
        }

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public KayHLCBars KayHLCBars(Data.IDataSeries input)
        {
            if (cacheKayHLCBars != null)
                for (int idx = 0; idx < cacheKayHLCBars.Length; idx++)
                    if (cacheKayHLCBars[idx].EqualsInput(input))
                        return cacheKayHLCBars[idx];

            lock (checkKayHLCBars)
            {
                if (cacheKayHLCBars != null)
                    for (int idx = 0; idx < cacheKayHLCBars.Length; idx++)
                        if (cacheKayHLCBars[idx].EqualsInput(input))
                            return cacheKayHLCBars[idx];

                KayHLCBars indicator = new KayHLCBars();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                Indicators.Add(indicator);
                indicator.SetUp();

                KayHLCBars[] tmp = new KayHLCBars[cacheKayHLCBars == null ? 1 : cacheKayHLCBars.Length + 1];
                if (cacheKayHLCBars != null)
                    cacheKayHLCBars.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheKayHLCBars = tmp;
                return indicator;
            }
        }
    }
}

// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
    public partial class Column : ColumnBase
    {
        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.KayHLCBars KayHLCBars()
        {
            return _indicator.KayHLCBars(Input);
        }

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public Indicator.KayHLCBars KayHLCBars(Data.IDataSeries input)
        {
            return _indicator.KayHLCBars(input);
        }
    }
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    public partial class Strategy : StrategyBase
    {
        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.KayHLCBars KayHLCBars()
        {
            return _indicator.KayHLCBars(Input);
        }

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public Indicator.KayHLCBars KayHLCBars(Data.IDataSeries input)
        {
            if (InInitialize && input == null)
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

            return _indicator.KayHLCBars(input);
        }
    }
}
#endregion

Reply With Quote
 
  #22 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,215 since Jun 2009
Thanks: 628 given, 6,313 received
Forum Reputation: Legendary


danjuma View Post
Hello cory,

Thank you very much for your response/assistance. I have followed your suggestion, however , it's doing doing what I want. Below is the amended code following your suggestion, is there something I have done wrong?

Many thanks
Dan

what do you see, all red?, all gray? all blue?

Reply With Quote
 
  #23 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, IB TWS
Broker/Data: IB, Kinetic
Favorite Futures: Stocks, Forex
 
Posts: 97 since Nov 2011
Thanks: 47 given, 16 received



cory View Post
what do you see, all red?, all gray? all blue?

Sorry for not getting back in time (in UK and was bed time ). I see all red. Thanks

Reply With Quote
 
  #24 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,215 since Jun 2009
Thanks: 628 given, 6,313 received
Forum Reputation: Legendary

I see, please go back to the original and add these;

---------------------------------------------------------------------------------
protected override void OnBarUpdate()
{

MClose.Set(Close[0]);
MHigh.Set(High[0]);
MLow.Set(Low[0]);


MOpen.Set(Open[0]); // add************

}
----------------------------------------------------------------------------------
{
if (idx - Displacement < 0 || idx - Displacement >= BarsArray[0].Count || (!ChartControl.ShowBarsRequired && idx - Displacement < BarsRequired))
continue;
double valH = MHigh.Get(idx);
double valL = MLow.Get(idx);
double valC = MClose.Get(idx);

double valO = MOpen.Get(idx); // add*************

int x = ChartControl.GetXByBarIdx(BarsArray[0], idx);
int y2 = ChartControl.GetYByValue(this, valH);
int y3 = ChartControl.GetYByValue(this, valL);
int y4 = ChartControl.GetYByValue(this, valC);


// add begin**************

if(valC>valO)
m_barColor = Color.Blue;
else
if(valC<valO)
m_barColor = Color.Red;
else
m_barColor = Color.Gray;

m_barPen = new Pen(m_barColor, GetBarWidth());

// add end****************

graphics.DrawLine(m_barPen, x, y2, x, y3);
graphics.DrawLine(m_barPen, x, y4, x + tickWidth, y4);
}
...

-------------------------------------------------------------------------------------------------------------------

Reply With Quote
 
  #25 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, IB TWS
Broker/Data: IB, Kinetic
Favorite Futures: Stocks, Forex
 
Posts: 97 since Nov 2011
Thanks: 47 given, 16 received

Firstly cory, thank you very much for taking time out to help with this. I have followed your suggestion above ( I did change the text 'Blue' to 'Green', to get green bars). It seems to work, except that for some reason, one of the bars still came out gray. I have attached an image below, as well as a copy of my code.





 
Code
//
// Copyright (C) 2006, NinjaTrader LLC <www.ninjatrader.com>.
// NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
//
// Modified by MrJoe
//   14.may.2011 - first release
//   15.may.2011 - automatic resize of the closing tick line 
//

#region Using declarations
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
using System.Xml.Serialization;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    /// <summary>
    /// HLC Bars for VSA.
    /// </summary>
    [Description("HLC Bars for VSA")]
    public class KayHLCBars : Indicator
    {
        #region Variables
        private Color           savePenColor         = Color.Transparent;
        private Color           savePen2Color        = Color.Transparent;
        private Color           saveDownColor        = Color.Empty;
        private Color           saveUpColor          = Color.Empty;
        private Color           m_barColor           = Color.Gray;
        private Pen				m_barPen		     = null;
		private int             m_barWidth           = 0;
        #endregion

		
        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
            Add(new Plot(Color.Gray, PlotStyle.Line, "MOpen"));
            Add(new Plot(Color.Gray, PlotStyle.Line, "MHigh"));
            Add(new Plot(Color.Gray, PlotStyle.Line, "MLow"));
            Add(new Plot(Color.Gray, PlotStyle.Line, "MClose"));
			ZOrder				= 1;
            PaintPriceMarkers   = false;
            CalculateOnBarClose = false;
            PlotsConfigurable   = false;
            Overlay             = true;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
			MClose.Set(Close[0]);
            MHigh.Set(High[0]);
            MLow.Set(Low[0]);
			
			MOpen.Set(Open[0]); //addition from cory
			
        }

        #region Properties


        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MOpen
        {
            get { return Values[0]; }
        }

        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MHigh
        {
            get { return Values[1]; }
        }

        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MLow
        {
            get { return Values[2]; }
        }

        [Browsable(false)]
        [XmlIgnore]
        public DataSeries MClose
        {
            get { return Values[3]; }
        }	
		
        [Description("Forced HLC bar width (0 = use Data Series settings).")]
        [Category("Settings")]
        [Gui.Design.DisplayNameAttribute("Bar width")]
        public int HLCBarWidth
        {
            get { return m_barWidth; }
            set { m_barWidth = value; }
        }

        [XmlIgnore]
        [Description("Color of bars.")]
        [Category("Settings")]
        [Gui.Design.DisplayNameAttribute("Color of bars")]
        public Color HLCBarColor
        {
            get { return m_barColor; }
            set { m_barColor = value; }
        }

        [Browsable(false)]
        public string HLCBarColorSerialize
        {
            get { return Gui.Design.SerializableColor.ToString(m_barColor); }
            set { m_barColor = Gui.Design.SerializableColor.FromString(value); }
        }


        #endregion

		private int GetBarWidth()
		{
			if ( m_barWidth != 0 ) {
				return m_barWidth;
			}
			else {
				return Bars.BarsData.ChartStyle.BarWidthUI;
			}
		}
		
        protected override void OnStartUp()
        {
            if (ChartControl == null || Bars == null)
                return;
            savePenColor                        = Bars.BarsData.ChartStyle.Pen.Color;
            savePen2Color                       = Bars.BarsData.ChartStyle.Pen2.Color;
            saveUpColor                         = Bars.BarsData.ChartStyle.UpColor;
            saveDownColor                       = Bars.BarsData.ChartStyle.DownColor;
            Bars.BarsData.ChartStyle.Pen.Color  = Color.Empty;
            Bars.BarsData.ChartStyle.Pen2.Color = Color.Empty;
            Bars.BarsData.ChartStyle.DownColor  = Color.Empty;
            Bars.BarsData.ChartStyle.UpColor    = Color.Empty;
            m_barPen                            = new Pen(m_barColor, GetBarWidth());
       }

        protected override void OnTermination()
        {
            if (ChartControl != null && Bars != null)
            {
                Bars.BarsData.ChartStyle.Pen.Color = savePenColor;
                Bars.BarsData.ChartStyle.Pen2.Color = savePen2Color;
                Bars.BarsData.ChartStyle.UpColor = saveUpColor;
                Bars.BarsData.ChartStyle.DownColor = saveDownColor;
            }

            if (m_barPen != null) m_barPen.Dispose();
       }

        public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
        {
			if (Bars == null || ChartControl == null)
                return;

			if ( GetBarWidth() != m_barPen.Width ) {
				m_barPen.Dispose();
				m_barPen = new Pen(m_barColor, GetBarWidth());
			}
			
			int tickWidth = Math.Max(3, 2 + 3 * (GetBarWidth() - 1));
			
            for (int idx = FirstBarIndexPainted; idx <= LastBarIndexPainted; idx++)
            {
                if (idx - Displacement < 0 || idx - Displacement >= BarsArray[0].Count || (!ChartControl.ShowBarsRequired && idx - Displacement < BarsRequired))
                    continue;
                double valH = MHigh.Get(idx);
                double valL = MLow.Get(idx);
                double valC = MClose.Get(idx);
				
				double valO = MOpen.Get(idx); //addition  from cory
				
				
				int x = ChartControl.GetXByBarIdx(BarsArray[0], idx);
                int y2 = ChartControl.GetYByValue(this, valH);
                int y3 = ChartControl.GetYByValue(this, valL);
                int y4 = ChartControl.GetYByValue(this, valC);
				
				
				
				//addition from cory - start
				if(valC>valO)
                m_barColor = Color.Green;
                else
                if(valC<valO)
                m_barColor = Color.Red;
                else
                m_barColor = Color.Gray;

                m_barPen = new Pen(m_barColor, GetBarWidth());

				//addition from cory - end
				

                graphics.DrawLine(m_barPen, x, y2, x, y3);
				graphics.DrawLine(m_barPen, x, y4, x + tickWidth, y4);
            }
        }

    }
}

#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    public partial class Indicator : IndicatorBase
    {
        private KayHLCBars[] cacheKayHLCBars = null;

        private static KayHLCBars checkKayHLCBars = new KayHLCBars();

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public KayHLCBars KayHLCBars()
        {
            return KayHLCBars(Input);
        }

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public KayHLCBars KayHLCBars(Data.IDataSeries input)
        {
            if (cacheKayHLCBars != null)
                for (int idx = 0; idx < cacheKayHLCBars.Length; idx++)
                    if (cacheKayHLCBars[idx].EqualsInput(input))
                        return cacheKayHLCBars[idx];

            lock (checkKayHLCBars)
            {
                if (cacheKayHLCBars != null)
                    for (int idx = 0; idx < cacheKayHLCBars.Length; idx++)
                        if (cacheKayHLCBars[idx].EqualsInput(input))
                            return cacheKayHLCBars[idx];

                KayHLCBars indicator = new KayHLCBars();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                Indicators.Add(indicator);
                indicator.SetUp();

                KayHLCBars[] tmp = new KayHLCBars[cacheKayHLCBars == null ? 1 : cacheKayHLCBars.Length + 1];
                if (cacheKayHLCBars != null)
                    cacheKayHLCBars.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheKayHLCBars = tmp;
                return indicator;
            }
        }
    }
}

// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
    public partial class Column : ColumnBase
    {
        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.KayHLCBars KayHLCBars()
        {
            return _indicator.KayHLCBars(Input);
        }

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public Indicator.KayHLCBars KayHLCBars(Data.IDataSeries input)
        {
            return _indicator.KayHLCBars(input);
        }
    }
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    public partial class Strategy : StrategyBase
    {
        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.KayHLCBars KayHLCBars()
        {
            return _indicator.KayHLCBars(Input);
        }

        /// <summary>
        /// HLC Bars for VSA
        /// </summary>
        /// <returns></returns>
        public Indicator.KayHLCBars KayHLCBars(Data.IDataSeries input)
        {
            if (InInitialize && input == null)
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

            return _indicator.KayHLCBars(input);
        }
    }
}
#endregion

Attached Thumbnails
H-igh L-ow C-lose bars-hlc.jpg  
Reply With Quote
 
  #26 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,215 since Jun 2009
Thanks: 628 given, 6,313 received
Forum Reputation: Legendary


danjuma View Post
Firstly cory, thank you very much for taking time out to help with this. I have followed your suggestion above ( I did change the text 'Blue' to 'Green', to get green bars). It seems to work, except that for some reason, one of the bars still came out gray. I have attached an image below, as well as a copy of my code.

it comes from this line ;
......
else
m_barColor = Color.Gray;
.........


Note: Gray means Open = Close, if you don't like Gray just change it to any color you want.

Reply With Quote
 
  #27 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, IB TWS
Broker/Data: IB, Kinetic
Favorite Futures: Stocks, Forex
 
Posts: 97 since Nov 2011
Thanks: 47 given, 16 received


cory View Post
it comes from this line ;
......
else
m_barColor = Color.Gray;
.........


Note: Gray means Open = Close, if you don't like Gray just change it to any color you want.

Ok, understood. Thank you very much for your assistance; much appreciated.

Reply With Quote
 
  #28 (permalink)
Elite Member
houston texas
 
Futures Experience: Intermediate
Platform: Ninja Trader
Favorite Futures: futures
 
Posts: 7 since Jul 2012
Thanks: 4 given, 0 received

#4 above

I can't get this to work in NT7.
*******************************************
you need to down load ensign for that indicator first
1) import ensign zip
2) import flimbo zip
3) change your chart to HL type

Attached Thumbnails
Click image for larger version Name: YM 12-10 9_27_2010 (1 Min).jpg Views: 231 Size: 61.6 KB ID: 20964
Attached Files
File Type: zip NinjaScript.Ensign.cs.zip (10.4 KB, 68 views)
File Type: zip FLIMBO_HLC.zip (13.6 KB, 56 views)
*******************************************
I downloaded both files and imported via File/Utilities/Import and rebooted.
The Flimbo_HLC shows up as an indicator however the cs file does not show as a Strategy or an indicator.

When I look for the .cs file:

It is located in the folder: NinjaTrader7/bin/custom
Should it be in the folder: NinjaTrader7/bin/custom/Strategy

It is named: NinjaScript.Ensign.02.04.09.cs.cs
Should it be named: NinjaScript.Ensign.02.04.09.cs
There is an additional file named: NinjaScript.Ensign.02.04.09.cs.dll

Thanks for your help.
Arcade

Reply With Quote
 
  #29 (permalink)
Elite Member
houston texas
 
Futures Experience: Intermediate
Platform: Ninja Trader
Favorite Futures: futures
 
Posts: 7 since Jul 2012
Thanks: 4 given, 0 received

#4 NinjaScript.Ensign.cs.zip

I can't get this to work in NT7.
*******************************************
you need to down load ensign for that indicator first
1) import ensign zip
2) import flimbo zip
3) change your chart to HL type

Attached Thumbnails
Click image for larger version Name: YM 12-10 9_27_2010 (1 Min).jpg Views: 231 Size: 61.6 KB ID: 20964
Attached Files
File Type: zip NinjaScript.Ensign.cs.zip (10.4 KB, 68 views)
File Type: zip FLIMBO_HLC.zip (13.6 KB, 56 views)
*******************************************
I downloaded both files and imported via File/Utilities/Import and rebooted.
The Flimbo_HLC shows up as an indicator however the cs file does not show as a Strategy or an indicator.

When I look for the .cs file:

It is located in the folder: NinjaTrader7/bin/custom
Should it be in the folder: NinjaTrader7/bin/custom/Strategy

It is named: NinjaScript.Ensign.02.04.09.cs.cs
Should it be named: NinjaScript.Ensign.02.04.09.cs
There is an additional file named: NinjaScript.Ensign.02.04.09.cs.dll

Thanks for your help.
Arcade

Reply With Quote
 
  #30 (permalink)
Elite Member
Cheltenham
 
Futures Experience: Advanced
Platform: InvestorRT, NinjaTrader
Favorite Futures: ES
 
Posts: 54 since Jan 2012
Thanks: 8 given, 100 received

HLC Chart Style


I have written an add on for NinjaTrader 7 that adds a new High, Low, Close chart style.

You can emulate HLC bars with indicators, but this does not work properly with paint bar studies because such studies colour bars and not other indicators.

This new chart style adds a new bar type and that will work correctly with indicators that colour bars.

Link to download.

Screen shot showing the new HLC chart style, coloured by Better ProAm.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following 3 users say Thank You to pawnbroker for this post:

Reply



futures io > > > > H-igh L-ow C-lose bars

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bankís Deal Means More Will Lose Their Homes kbit News and Current Events 0 July 12th, 2011 02:47 PM
Dollar Could Lose Up to 30% in Value as Yuan Strengthens Quick Summary News and Current Events 1 May 18th, 2011 04:24 AM
NEVER LOSE AGAIN!! - TheRumpledOne TheRumpledOne Trading Journals 288 March 20th, 2011 01:13 PM
How Much Money Are You Willing To Lose Today? hondo69 Psychology and Money Management 3 December 16th, 2009 06:15 AM


All times are GMT -4. The time now is 04:05 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-12 in 0.13 seconds with 20 queries on phoenix via your IP 54.163.210.170