Trading Articles
Article Categories
Article Tools
MACD with colours wanted
Updated September 6, 2012
Top Posters
looks_one
alright
with 4 posts (0 thanks)
looks_two
marker
with 3 posts (0 thanks)
looks_3
futurestrader1
with 3 posts (0 thanks)
looks_4
max-td
with 2 posts (1 thanks)
Best Posters
looks_one
eDanny
with 3.5 thanks per post
looks_two
Markus
with 2 thanks per post
looks_3
cory
with 1 thanks per post
looks_4
max-td
with 0.5 thanks per post
trending_up
6,715 views
thumb_up
12 thanks given
group
8 followers
forum
21 posts
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)
(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
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(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
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
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
(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.
(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
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!!
(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. . ?
(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...
(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
I'm definitely not a coder, but this seems quite an easy task. Here you are...
(login for full post details)
#9 (permalink )
Italy
Posts: 11 since Nov 2009
Thanks: 0 given,
1
received
xtclove
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...
(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?
(login for full post details)
#11 (permalink )
Frankfurt
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
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 !
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?
(login for full post details)
#13 (permalink )
the coin hunter
virginia
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,030 since Jun 2009
Thanks: 845 given,
7,894
received
we get this question one a month
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
Posts: 494 since Aug 2009
Thanks: 747 given,
258
received
(login for full post details)
#15 (permalink )
New York City, USA
Experience: Advanced
Platform: NinjaTrader
Trading: ES, CL, 6E
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.
(login for full post details)
#16 (permalink )
East Rochester, NY
Experience: Intermediate
Platform: NT
Posts: 329 since Jul 2009
Thanks: 17 given,
423
received
...on for size.
futurestrader1
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.
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
Posts: 149 since Jul 2010
Thanks: 81 given,
42
received
Thanks eDanny....this is really great!
(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
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
Posts: 149 since Jul 2010
Thanks: 81 given,
42
received
eDanny
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
(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!
(login for full post details)
#21 (permalink )
lagos, Nigeria
Posts: 1 since Aug 2012
Thanks: 0 given,
0
received
mahlonhersh
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
(login for full post details)
#22 (permalink )
Dallas
Experience: Intermediate
Platform: ThinkorSwim, Ninjatrader, Multicharts
Broker: Thinkorswim, Ninjatrader Brokerage
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
Last Updated on September 6, 2012
Right now
Ongoing
Right now
March
Register to Attend
Elite only
Coming soon
April