MACD with colours wanted - futures io
futures io futures trading



MACD with colours wanted


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one alright with 4 posts (0 thanks)
    2. looks_two marker with 3 posts (0 thanks)
    3. looks_3 futurestrader1 with 3 posts (0 thanks)
    4. looks_4 eDanny with 2 posts (7 thanks)
      Best Posters
    1. looks_one eDanny with 3.5 thanks per post
    2. looks_two Markus with 2 thanks per post
    3. looks_3 max-td with 0.5 thanks per post
    4. looks_4 mahlonhersh with 0.5 thanks per post
    1. trending_up 6,718 views
    2. thumb_up 12 thanks given
    3. group 8 followers
    1. forum 21 posts
    2. attach_file 6 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

MACD with colours wanted

(login for full post details)
  #1 (permalink)
Italy
 
 
Posts: 11 since Nov 2009
Thanks: 0 given, 1 received

Hello. I hope this is the right section to ask. I wonder if it would be possible to have a modified MACD for Ninja to show green bars above zero/red bars below zero, looking like in the pic. I suppose it shouldn't be hard to code. I looked everywhere and couldn't find it. Thank you in advance

Attached Thumbnails
Click image for larger version

Name:	MACD.png
Views:	352
Size:	63.8 KB
ID:	4355  
Reply With Quote

Can you help answer these questions
from other members on futures io?
NT8 indicator to simulate a Funding Evaluation where to …
NinjaTrader
Indicators for pair trading MES and M2K
Platforms and Indicators
SimplerOptions
Trading Reviews and Vendors
Neurological explanations for trading Success
Psychology and Money Management
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
 
 
(login for full post details)
  #2 (permalink)
Arizona
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 155 since Jun 2009
Thanks: 709 given, 175 received

Alright,

Here is a MACD with a 4 color histogram that may work for you.

Mahlon

Attached Files
Register to download File Type: zip MACD_4color_hist.zip (4.3 KB, 198 views)
Reply With Quote
The following user says Thank You to mahlonhersh for this post:
 
(login for full post details)
  #3 (permalink)
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 924 received


lol -where you got this from ?
i made this script a year ago or so
my tag is still inside the code ....
small world

max-td
Reply With Quote
 
(login for full post details)
  #4 (permalink)
Italy
 
 
Posts: 11 since Nov 2009
Thanks: 0 given, 1 received

Than you very much, mahlonhersh. Thats perfect. And thank you as well, max-td, for coding it.

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Arizona
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 155 since Jun 2009
Thanks: 709 given, 175 received


max-td View Post
lol -where you got this from ?
i made this script a year ago or so
my tag is still inside the code ....
small world

Probably from NT support forum. Thanks!!

Reply With Quote
 
(login for full post details)
  #6 (permalink)
PH
 
 
Posts: 2 since Jan 2010
Thanks: 0 given, 0 received

Hi, that indicator was the nice, but is there any way to modify it to have green bars only if macd line is above the 0 line and red if below 0 line. . ?

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Italy
 
 
Posts: 11 since Nov 2009
Thanks: 0 given, 1 received

I'm definitely not a coder, but this seems quite an easy task. Here you are...

Attached Files
Register to download File Type: zip MACD_Histo_2C.zip (4.2 KB, 98 views)
Reply With Quote
 
(login for full post details)
  #8 (permalink)
PH
 
 
Posts: 2 since Jan 2010
Thanks: 0 given, 0 received

Hi alright, its not what im looking for exactly, but thanks for the thought. . ,

What i want was something like MT4's macd, i think on ninja its the PP0 indicator. . but with able to do 4 colors like the macd indies here. . .


alright View Post
I'm definitely not a coder, but this seems quite an easy task. Here you are...


Reply With Quote
 
(login for full post details)
  #9 (permalink)
Italy
 
 
Posts: 11 since Nov 2009
Thanks: 0 given, 1 received


xtclove View Post
Hi alright, its not what im looking for exactly, but thanks for the thought. . ,

What i want was something like MT4's macd, i think on ninja its the PP0 indicator. . but with able to do 4 colors like the macd indies here. . .

I'm sorry but you've lost me here. I don't understand what you're looking for. As I said I'm not a coder and it would probably be hard for me to do any better than this. Maybe if you could post a picture of what you need here...

Reply With Quote
 
(login for full post details)
  #10 (permalink)
Las Vegas, NV
 
Experience: None
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL
 
Posts: 102 since Jun 2010
Thanks: 115 given, 105 received


how do you get the signal line to plot?

Reply With Quote
 
(login for full post details)
  #11 (permalink)
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 924 received

hello marker,
welcome to BigMikeTrading - forum !

if you have questions, please provide as much explaination of your topic as you can. if folks dont understand what you mean you will get no answers.
so the best way is to post a screenshot of chart with the indicator and explain it with some more words.

sorry, but with questions like :

where is the line ?
OR
please i need 4 colors !

noone really knows what people are talking about.

hope that makes sense.

looking forward to hear from you !



max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
(login for full post details)
  #12 (permalink)
Texas
 
 
Posts: 113 since Jun 2010

I'm just wondering how to get the ccs file into ninja trader? Anyone Anyone?

Reply With Quote
 
(login for full post details)
  #13 (permalink)
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,030 since Jun 2009
Thanks: 845 given, 7,894 received

we get this question one a month

Reply With Quote
The following user says Thank You to cory for this post:
 
(login for full post details)
  #14 (permalink)
Bellingham, WA
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: 6E, CL
 
Dragon's Avatar
 
Posts: 494 since Aug 2009
Thanks: 747 given, 258 received

wiki much?

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #15 (permalink)
New York City, USA
 
Experience: Advanced
Platform: NinjaTrader
Trading: ES, CL, 6E
 
futurestrader1's Avatar
 
Posts: 149 since Jul 2010
Thanks: 81 given, 42 received

Here is what i want...

Based on a MACD with only the AVERAGE line plotting as the line and the histogram bars.

This one has a neutral plot on the histogram...i don't know how.

easy visible signals on the line is nice to have from green to red based on the zero line.

Attached Thumbnails
Click image for larger version

Name:	MacdPAINTS.png
Views:	191
Size:	12.3 KB
ID:	16418  
Reply With Quote
 
(login for full post details)
  #16 (permalink)
East Rochester, NY
 
Experience: Intermediate
Platform: NT
 
eDanny's Avatar
 
Posts: 329 since Jul 2009
Thanks: 17 given, 423 received

...on for size.


futurestrader1 View Post
Here is what i want...

Based on a MACD with only the AVERAGE line plotting as the line and the histogram bars.

This one has a neutral plot on the histogram...i don't know how.

easy visible signals on the line is nice to have from green to red based on the zero line.


Attached Files
Register to download File Type: zip MACD_Z.zip (3.8 KB, 112 views)
Reply With Quote
The following 7 users say Thank You to eDanny for this post:
 
(login for full post details)
  #17 (permalink)
New York City, USA
 
Experience: Advanced
Platform: NinjaTrader
Trading: ES, CL, 6E
 
futurestrader1's Avatar
 
Posts: 149 since Jul 2010
Thanks: 81 given, 42 received

Thanks eDanny....this is really great!

Reply With Quote
 
(login for full post details)
  #18 (permalink)
Frankfurt am Main
 
 
Posts: 26 since May 2010
Thanks: 2 given, 17 received

Here's the MACD that paints bars when above or below zero line

Attached Files
Register to download File Type: zip MacdZeroLineColorBar.zip (2.3 KB, 95 views)
Reply With Quote
The following 2 users say Thank You to Markus for this post:
 
(login for full post details)
  #19 (permalink)
New York City, USA
 
Experience: Advanced
Platform: NinjaTrader
Trading: ES, CL, 6E
 
futurestrader1's Avatar
 
Posts: 149 since Jul 2010
Thanks: 81 given, 42 received


eDanny View Post
...on for size.

Thanks.... I've been finding that the AVERAGE line, which you supplied above is great but the actual MACD signal line can work even better.

Can you please code it for the Signal line.... or if someone could reply with the code adjustment.


 
Code
 // 
//

#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>
    /// The MACD_Z is a trend following momentum indicator.
    /// </summary>
    [Description("The MACD_Z is a trend following momentum indicator.")]
    public class MACD_Z : Indicator
    {
        #region Variables
        private int                    fast    = 5;
        private int                    slow    = 15;
        private int                    smooth    = 10;
        private MACD Z;
        #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(new Pen(Color.Green, 2), PlotStyle.Line, "Z_Hi"));
            Add(new Plot(new Pen(Color.Red, 2), PlotStyle.Line, "Z_Lo"));
            Add(new Plot(new Pen(Color.Green, 3), PlotStyle.Bar, "Z_Rising"));
            Add(new Plot(new Pen(Color.Red, 3), PlotStyle.Bar, "Z_Falling"));
            Add(new Plot(new Pen(Color.DimGray, 3), PlotStyle.Bar, "Z_Neutral"));

            CalculateOnBarClose = false;
            
        }
        public override string ToString()
        {return Name;}
        /// <summary>
        /// Calculates the indicator value(s) at the current index.
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (CurrentBar == 0)
            {
                Z = MACD(Close, fast, slow, smooth);
                Plots[0].Min = 0;            
                Plots[1].Max = 0;
            }
            else
            {
                ZHi.Set(Z.Avg[0]); ZLo.Set(Z.Avg[0]);
                if(ZHi[0] > 0 && Z.Diff[0] > 0)
                    ZR.Set(Z.Diff[0]);
                else
                if(ZLo[0] < 0 && Z.Diff[0] < 0)
                    ZF.Set(Z.Diff[0]);
                else
                    ZN.Set(Z.Diff[0]);
            }
        }

        #region Properties
        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries ZHi
        {
            get { return Values[0]; }
        }
        
        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries ZLo
        {
            get { return Values[1]; }
        }

        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries ZR
        {
            get { return Values[2]; }
        }
        
        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries ZF
        {
            get { return Values[3]; }
        }
        
        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries ZN
        {
            get { return Values[4]; }
        }

        /// <summary>
        /// </summary>
        [Description("Number of bars, fast")]
        [Category("Parameters")]
        public int Fast
        {
            get { return fast; }
            set { fast = Math.Max(1, value); }
        }

        /// <summary>
        /// </summary>
        [Description("Number of bars, slow")]
        [Category("Parameters")]
        public int Slow
        {
            get { return slow; }
            set { slow = Math.Max(1, value); }
        }

        /// <summary>
        /// </summary>
        [Description("Number of bars, smoothing")]
        [Category("Parameters")]
        public int Smooth
        {
            get { return smooth; }
            set { smooth = Math.Max(1, value); }
        }
        #endregion
    }
}

#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 MACD_Z[] cacheMACD_Z = null;

        private static MACD_Z checkMACD_Z = new MACD_Z();

        /// <summary>
        /// The MACD_Z is a trend following momentum indicator.
        /// </summary>
        /// <returns></returns>
        public MACD_Z MACD_Z(int fast, int slow, int smooth)
        {
            return MACD_Z(Input, fast, slow, smooth);
        }

        /// <summary>
        /// The MACD_Z is a trend following momentum indicator.
        /// </summary>
        /// <returns></returns>
        public MACD_Z MACD_Z(Data.IDataSeries input, int fast, int slow, int smooth)
        {
            checkMACD_Z.Fast = fast;
            fast = checkMACD_Z.Fast;
            checkMACD_Z.Slow = slow;
            slow = checkMACD_Z.Slow;
            checkMACD_Z.Smooth = smooth;
            smooth = checkMACD_Z.Smooth;

            if (cacheMACD_Z != null)
                for (int idx = 0; idx < cacheMACD_Z.Length; idx++)
                    if (cacheMACD_Z[idx].Fast == fast && cacheMACD_Z[idx].Slow == slow && cacheMACD_Z[idx].Smooth == smooth && cacheMACD_Z[idx].EqualsInput(input))
                        return cacheMACD_Z[idx];

            MACD_Z indicator = new MACD_Z();
            indicator.BarsRequired = BarsRequired;
            indicator.CalculateOnBarClose = CalculateOnBarClose;
            indicator.Input = input;
            indicator.Fast = fast;
            indicator.Slow = slow;
            indicator.Smooth = smooth;
            indicator.SetUp();

            MACD_Z[] tmp = new MACD_Z[cacheMACD_Z == null ? 1 : cacheMACD_Z.Length + 1];
            if (cacheMACD_Z != null)
                cacheMACD_Z.CopyTo(tmp, 0);
            tmp[tmp.Length - 1] = indicator;
            cacheMACD_Z = tmp;
            Indicators.Add(indicator);

            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>
        /// The MACD_Z is a trend following momentum indicator.
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.MACD_Z MACD_Z(int fast, int slow, int smooth)
        {
            return _indicator.MACD_Z(Input, fast, slow, smooth);
        }

        /// <summary>
        /// The MACD_Z is a trend following momentum indicator.
        /// </summary>
        /// <returns></returns>
        public Indicator.MACD_Z MACD_Z(Data.IDataSeries input, int fast, int slow, int smooth)
        {
            return _indicator.MACD_Z(input, fast, slow, smooth);
        }

    }
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    public partial class Strategy : StrategyBase
    {
        /// <summary>
        /// The MACD_Z is a trend following momentum indicator.
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.MACD_Z MACD_Z(int fast, int slow, int smooth)
        {
            return _indicator.MACD_Z(Input, fast, slow, smooth);
        }

        /// <summary>
        /// The MACD_Z is a trend following momentum indicator.
        /// </summary>
        /// <returns></returns>
        public Indicator.MACD_Z MACD_Z(Data.IDataSeries input, int fast, int slow, int smooth)
        {
            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.MACD_Z(input, fast, slow, smooth);
        }

    }
}
#endregion

Reply With Quote
 
(login for full post details)
  #20 (permalink)
Las Vegas, NV
 
Experience: None
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL
 
Posts: 102 since Jun 2010
Thanks: 115 given, 105 received

I agree, this looks good and it would be better if it had the option to plot both the signal and average lines or just one of them. Thanks again, I'm not a coder, but would think it would be simple to do. Thanks!

Reply With Quote
 
(login for full post details)
  #21 (permalink)
lagos, Nigeria
 
 
Posts: 1 since Aug 2012
Thanks: 0 given, 0 received


mahlonhersh View Post
Alright,

Here is a MACD with a 4 color histogram that may work for you.

Mahlon

I am unable to download the colour coded macd indicator. Stanley

Reply With Quote
 
(login for full post details)
  #22 (permalink)
Dallas
 
Experience: Intermediate
Platform: ThinkorSwim, Ninjatrader, Multicharts
Broker: Thinkorswim, Ninjatrader Brokerage
 
optionzen's Avatar
 
Posts: 139 since Nov 2010
Thanks: 137 given, 105 received

Hi max is it possible for you to automate this indicator going long or short when macd changes color with a 12 tick fixed stop loss.

Sent from my SAMSUNG-SGH-I727 using Tapatalk 2

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > MACD with colours wanted


Last Updated on September 6, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 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