View Full Version : MACDBBLines
Gumphrie
08-12-2007, 04:13 PM
This is an indicator that plots the MACD and Bollinger bands worked out as a standard deviation from the MACD. It also highlights zero line crosses of the MACD line (displayed as dots).
Any comments or strategy suggestions welcome.
http://www.acuclick.net/MACDBBLines.jpg
ChangeLog :
Updated 21st August - Vers 0.2 - removed superfluous MACD dot plotted on the zero line for the current bar.
To import:
- Download the file contained in this thread to your desktop
- From the Control Center window select the menu File > Utilities > Import NinjaScript
- Select the downloaded file
crisscruiser
08-17-2007, 08:31 PM
This is an indicator that plots the MACD and Bollinger bands worked out as a standard deviation from the MACD. It also highlights zero line crosses of the MACD line (displayed as dots).
Any comments or strategy suggestions welcome.
http://www.acuclick.net/MACDBBLines.jpg
Gumphrie,
Thanks for the indy. I have been using a similar indicator for awhile now on a different charting platform. My entries are either on ZLB [Zero Line Break], ZLR [Zero Line Reject], and a couple of others. You may find this video by Nexgen (http://www.nss-t3.com/Nexgen%20Videos%20Download/Nexgen%20Macd%20BB%20lines%20Education/Nexgen%20Macd%20BB%20lines%20Education.html) helpful. I am new to the forum and do not know yet where the proper topic is to post trade setups.
ENJOY!
crisscruiser
Gumphrie
08-18-2007, 04:27 AM
I have been using a similar indicator for awhile now on a different charting platform. My entries are either on ZLB [Zero Line Break], ZLR [Zero Line Reject], and a couple of others. You may find this video by Nexgen (http://www.nss-t3.com/Nexgen%20Videos%20Download/Nexgen%20Macd%20BB%20lines%20Education/Nexgen%20Macd%20BB%20lines%20Education.html) helpful. I am new to the forum and do not know yet where the proper topic is to post trade setups.
Wow, thanks for the info.
dwalls
08-18-2007, 11:52 AM
Gumphrie,
Here are some more info video's on the T3 MACDBBLines. I found them very interesting. http://www.nss-t3.com/guide.htm
Maybe they can help you as well.
Good Day
garciaal
08-18-2007, 09:40 PM
When I unzipped file I noticed 3 standard Ninja indicators and the MACDBBlines.cs file. Is it really necessary to import those?
I would usually just copy MACDBBlines.cs to \My documents\ninjatrader 6\bin\custom\indicators and then compile indicator with Ninja Script Editor.
Is there a particular reason that importing is different? Or do they accomplish the same think?
Thanks,
Al
NinjaTrader_Ray
08-18-2007, 11:02 PM
It is required since the indicator uses those system indicators. The import process will not replace indicators if they exist on your system and they are the version.
Thomas
08-20-2007, 03:42 PM
Do you know what they use as their T3 inputs?
ie: fast T3= .7 velocity with a 3 period
slower T3= .7 with a 5 period
I'm sure the above works fine, but I was just curious as to what their numbers are.
Gumphrie
08-21-2007, 09:20 AM
Note, I've updated MACDBBLines so it doesn't plot the superfluous MACD dot on the zero line for the current bar.
dwalls
08-21-2007, 10:04 AM
Gumphrie
Great job. Thanks for all you are doing here in this forum. Keep it up.
Gumphrie
08-22-2007, 04:36 AM
Gumphrie
Great job. Thanks for all you are doing here in this forum. Keep it up.
Thanks for the encouragement dwalls.
BC5391
08-22-2007, 07:50 AM
Thanks for your work Gumpri, I've been using your indicator for the past few weeks and have noticed a great trade setup when everything is in sync (multiple time frames) the picture shows what I am looking for, it is when the dot drops into the BB channel, red for short, green for long, so far I must say it has worked great, just do not take the opposite side on a pull back.
randyjb
08-23-2007, 07:01 PM
BC.. I am assuming you meant you use that signal as a confirmation to take the trade, as per your chart, Medium was already below its moving average and your squeeze indicator had also already turned darker blue prior to the red dot dropping into the gap between the two lines.
Just curious, have you done much in the way of risk reward statistics on that trade?
Happy Trading
BC5391
08-23-2007, 09:24 PM
Randyjb,
I should have passed along a little more info, I use this stratigy only in premarket hours, usually 2 or 3 hours before the open, it has not let me down in the past 2 weeks. I am usually done and out of the house within a half hour after the session starts. on a slow day i will get 10 ticks without any problems.
The overnight session is usually getting out of thier trades during this period so for me it seems to be easy pickings
This morning was no exception entering short on the ES at 4:40 mountian time 1480.25 with an exit after the open at 7:05 which is 10:05 eastern
at 1468.50,
If you look at the same picture of this morning the dot dropped inside the bands (this is from a 2m chart) and on the mediumthere is a gap between the bars and the ma line, this is also a good clue for either direction.
most days are not like today, and the market moves too fast for me to try it during the regular session, by the time I have lined up all 3 charts everything has changed, but not so in premarket hours, it makes it easy money
BC5391
08-23-2007, 09:29 PM
Randyjb,
I should also add that if you look at the squeeze, yes even this morning the bars were dark blue, but momumten the green line is dropping, John Carter and his partner Hurbert Senters say it is time to exit your position after 2 dark bars, in this case your last trade would have been a buy that you would be exiting (overnight traders leaving thier position) I was picking up the position going short
dwalls
08-23-2007, 10:19 PM
Gumphrie,
Is there any way to use the MACDBBlines indicator, as part of a strategy code to tell me if the (dots) are above or below the upper or lower bands?
I'm not sure what the dots are called, are they the fast (EMA) or something else?
Example: if or && MACDBBLines (dots) is < UpperBand (red)
or...if or && MACDBBLines (dots) is > UpperBand (red)
and visa versa for the LowerBand (blue)
and...if or && the TTMSqueeze (or the BBS) had 2 dark bars in a row
then could enter a short.
Would this be possible somehow?
Thanks
garciaal
08-23-2007, 10:30 PM
BC5391,
What are the KPMRange & KPMedium on the picture of your charts?
Are they an indicator on this forum?
Thanks,
Al
NinjaTrader_Josh
08-23-2007, 11:00 PM
KPM indicators are KwikPop indicators. You can buy them here http://www.kwikpop.com/
Gumphrie
08-24-2007, 04:13 AM
dwalls,
The MACD dots are just the standard MACD, so you would call that to get the dots values. Take a look at the OnBarUpdate code in the indicator, its very simple.
Once you've called the MACD to get the dot values, you can call MACDBBLines directly to get the BB_UpperBand and BB_lowerBand values.
So yes, you should be able to string all that together in a strategy.
BC5391
08-24-2007, 07:16 AM
BC5391,
What are the KPMRange & KPMedium on the picture of your charts?
Are they an indicator on this forum?
Thanks,
Al
yes they are leased indicators from kwikpop.com
Bogan7
08-27-2007, 03:49 AM
I dont get any blue dots only red and green ones which is not right is it? I thought a blue dot represented the moment when the squeeze triggered?
Gumphrie
08-27-2007, 04:05 AM
I dont get any blue dots only red and green ones which is not right is it? I thought a blue dot represented the moment when the squeeze triggered?
Yes, just green dots for a rising MACD and red dots for a falling MACD. Are you sure you don't want a squeeze indicator such as BBS? I've seen white dots before which are suppossed to represent if there is no rising/falling, is that what you mean? If you can define the rules for a blue dot I can look at adding them.
dwalls
09-12-2007, 04:41 PM
dwalls,
The MACD dots are just the standard MACD, so you would call that to get the dots values. Take a look at the OnBarUpdate code in the indicator, its very simple.
Once you've called the MACD to get the dot values, you can call MACDBBLines directly to get the BB_UpperBand and BB_lowerBand values.
So yes, you should be able to string all that together in a strategy.
Gumphrie,
I've tried several ways to get a strategy for this to work but just cant get any of them to compile. I'm just a beginner. I was woundering if you might help me with the basics of the strategy and get it to compile, then I could probably add some things from there.
Put simply: If the Macd dots are below the upper band and then close above the upper band, enter long. Exit when the Macd dot closes below the upper band. If the Macd dots are above the lower band and then close below the lower band, enter short. Exit when the Macd dot closes above the lower band.
Any help would be appreciated.
Thanks
Gumphrie
09-12-2007, 05:14 PM
Gumphrie,
I've tried several ways to get a strategy for this to work but just cant get any of them to compile. I'm just a beginner. I was woundering if you might help me with the basics of the strategy and get it to compile, then I could probably add some things from there.
Put simply: If the Macd dots are below the upper band and then close above the upper band, enter long. Exit when the Macd dot closes below the upper band. If the Macd dots are above the lower band and then close below the lower band, enter short. Exit when the Macd dot closes above the lower band.
Any help would be appreciated.
Thanks
What sort of compile errors are you getting? Can you post or PM me an example?
This may sound funny, but I don't actually use NinjaScript strategies, but instead focus on the indicators and use the ATI for autotrading, linking the two with my own applications, so I don't have any snippets or samples that may help straight away.
dwalls
09-15-2007, 09:39 PM
Gumphrie,
On this indicator it shows the BB_UpperBand and the BB_LowerBand values in the Data Box. I was wondering if you could edit it to also show the MacdBB dots value in the Data Box as well. Just so we can see by the values if the dots accually closed inside or outside the Bands.
Thanks
Gumphrie
09-15-2007, 09:59 PM
On this indicator it shows the BB_UpperBand and the BB_LowerBand values in the Data Box. I was wondering if you could edit it to also show the MacdBB dots value in the Data Box as well. Just so we can see by the values if the dots accually closed inside or outside the Bands.
Thanks
Overlaying a transparent MACD will give you the dot values.
dwalls
09-15-2007, 10:07 PM
Thanks,
I overlayed it but how do I make it transparent?
It shows both lines and the histogram fro the Macd.
Is there anyway to rid of the histogram and the other line and only show the MACD line?
Gumphrie
09-16-2007, 04:35 AM
Thanks,
I overlayed it but how do I make it transparent?
It shows both lines and the histogram fro the Macd.
Is there anyway to rid of the histogram and the other line and only show the MACD line?
Go into the properties for each Plot and change the colour to Transparent. Make sure its on the same panel. You probably also want to set the price markers to false in the general properties. Then save as a template once you're happy with it.
gary9
10-30-2007, 02:49 PM
I'm trying to get the Strategy Wizard to trigger a trade, for backtesting, and for a Order management. I'm haveing problems creating "indicator on indicator" using the wizard. Because I am not familiar with C#, I would prefer to devellop the following strategy for future trading with the wizard and wonder whether this is possible.
Here below is the Easy Language script without all the formatting code:
inputs:
FastLen( 12),
SlowLen( 26),
Length( 10 ),
StDv(1);
VARS:
BB_Macd(0),
Avg(0),
SDev(0),
Upper_band(0),
Lower_band(0);
BB_Macd= MACD( Close, FastLen, SlowLen ) ;
Avg = XAverage(BB_Macd,Length);
SDev = StdDev( BB_Macd, Length ) ;
Upper_Band = Avg + StDv * SDev ;
Lower_Band = Avg - StDv * SDev ;
Plot1(BB_Macd);
Plot2(Upper_Band);
Plot3(Lower_Band);
I am looking forward for any help, please.
NinjaTrader_Ray
10-30-2007, 04:17 PM
This looks like an indicator.
What exact condition are you looking to check for?
For example:
If a 20 period simple moving average of a 20 period RSI crosses above a value of 20 go long.
gary9
10-30-2007, 05:41 PM
i was referring to MACDBBLines indicator. I'm only interested in the MACDBBLines(12,10,26,5,1), when it changes color, for a trigger. red to go short and green to go long
NinjaTrader_Ray
10-30-2007, 07:37 PM
I see. Unfortunately this indicator you speak of is not a NinjaTrader indicator so I can't provide support for it since I don't know how this indicator operates and if you can even check for the condition you speak of. You would need to go back to the author of the indicator and ask them.
gary9
10-30-2007, 08:22 PM
thanks Ray for looking at it, for more infor please look at eSignal Central Forum. that was written using the Formula Wizard.
http://forum.esignalcentral.com/showthread.php?threadid=7271
When I was trying to figure out how MACDBBLines worked, I added a few, sparse comments to it that may help.
It's not up to my usual level of commenting, but it still may help.
I've attached a copy for your perusal.
Bogan7
10-31-2007, 07:25 PM
When I was trying to figure out how MACDBBLines worked, I added a few, sparse comments to it that may help.
It's not up to my usual level of commenting, but it still may help.
I've attached a copy for your perusal.
How do I access the comments as they only show a snippet on the indicator?
Regards
I'm not sure I understand the question.
The comments I was talking about are embedded in the source code. A source code comment in C# (or NinjaScript) begins with "//" and runs to the end of the line.
For instance, the following line shows one of the comments that I added to MACDBBLines.cs:
// Draw a big yellow dot over the zero line intersection.A comment is not understood by the source code compiler and is ignored (has no effect on the operation of the program.)
A comment's only use is for notations by the programmer for later reference by himself/herself or others who are trying to understand the code.
NinjaTrader_Josh
11-01-2007, 01:50 AM
To view the code and see these comments you will need to open up the indicator source file. This can be done by going through the NinjaScript editor.
Tools->Edit NinjaScript->Indicator->select the indicator file->Open
gary9
11-01-2007, 08:17 AM
Hi Josh
I have a no programming experience could you provide a sample script or code with “BB Macd”, so I can incorporate it into my script for backtesting . I tried the wizard with no results.
I would greatly appreciate it
NinjaTrader_Josh
11-01-2007, 01:00 PM
Sorry gary9. I am unfamiliar with how a trader would use the MACDBB to trade so I would not be able to generate a worthwhile sample for its utilization.
Here are some brief examples of how you would call Gumphrie's MACDBBLines indicator though. You will need to figure out workable trading conditions on your own.
if (CrossAbove(MACDBBLines(12, 10, 26, 5, 1).BB_UpperBand, 0, 1))
{
// Do something
}MACDBBLines(12, 10, 26, 5, 1).BB_UpperBand is one of the lines and the other line is [/code]MACDBBLines(12, 10, 26, 5, 1).BB_LowerBand[/code]
To get their individual values and compare them to something you could do something like
if (MACDBBLines(12, 10, 26, 5, 1).BB_UpperBand[0] > someThresholdValue)
{
// Do something
}
Hope that helps.
Gumphrie
11-02-2007, 04:23 AM
thanks Ray for looking at it, for more infor please look at eSignal Central Forum. that was written using the Formula Wizard.
http://forum.esignalcentral.com/showthread.php?threadid=7271
I think the code here is virtually identical, if not the same, to the code I used to create MACDBBLines.
dwalls
11-03-2007, 02:39 PM
Josh or Gumphrie,
How would I code the MACD (dots) for when they were (started) inside the upper and lower bands and then closed above the .BB_UpperBands? to enter a long and then exit the long when it closed back inside the .BB_UpperBands?. Visa versa for a short?
I tried using your examples below but just cant figure out how to code the MACD cross above/below or the greater/less than the BB_UpperBands or BB_LowerBands.
if (CrossAbove(MACDBBLines(12, 10, 26, 5, 1).BB_UpperBand, 0, 1))
{
// Do something
}
OR
if (MACDBBLines(12, 10, 26, 5, 1).BB_UpperBand[0] > someThresholdValue)
{
// Do something
}
I tried some things like:
if (bbMacd[0] > MACDBBLines(12, 10, 26, 5, 1).BB_UpperBand[0])
{
// Do something
}
and cant get anything to compile.
Any help would be apreciated.
Thanks
Gumphrie
11-03-2007, 04:06 PM
I tried some things like:
if (bbMacd[0] > MACDBBLines(12, 10, 26, 5, 1).BB_UpperBand[0])
{
// Do something
}
and cant get anything to compile.
bbMacd is an internal Dataseries variable to the indicator, to get that value in your code you would call the MACD directly.
And here's how you'd do that.
Try this equivalent code...
double UpperBand = EMA(MACD(10,26,5),12)[0]
+ StdDev(MACD(10,26,5),12)[0];
if (MACD(10, 26, 5)[0] > UpperBand)
{
// Do something
}
gary9
11-05-2007, 09:54 AM
Error on generating Strategy
Copy and paste into: NinjaTrader.Strategy
'NinjaTrader.Indicator.MACD' does not contain a definition for 'MACD'
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
///
/// </summary>
[Description("")]
[Gui.Design.DisplayName("bbm")]
public class bbm : Strategy
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
SetProfitTarget("", CalculationMode.Ticks, 8);
SetStopLoss("", CalculationMode.Ticks, 8, false);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
double UpperBand = EMA(MACD(10,26,5).Macd,12)[0]
+ StdDev(MACD(10,26,5).Macd,12)[0];
if (MACD(10, 26, 5)[0] > UpperBand)
{
// Do something
EnterLong(DefaultQuantity, "");
}
}
#region Properties
#endregion
}
}
My apologies, I was a little too quick with the solution there.
Check it again, I've corrected the error in my earlier post. (And this time I test-compiled it.)
gary9
11-05-2007, 01:08 PM
Hi KBJ
Thanks for the code.
I'm trying to duplicate the MACDBB in the MACDBBLines indicator.
i added
&& MACD(10, 26, 5)[1] < UpperBand)
but the action was off. Apreciate further progress in making this a automated trading strategy.
Why would you use "[1]" which is 1 bar ago, insead of "[0]" meaning the bar that just completed?
Check to make sure the parameters are correct. I noticed when I converted the code snippet that dwalls wrote that the parameters were backwards. What I did earlier was just to convert the posted code, which does not match the defaults for MACDBBLines.
You probably want MACD(12,26,5) which would match the defaults of the MACDBBLines indicator.
gary9
11-06-2007, 12:56 PM
Hi dwalls
How's it going, look like you're futher along in this project than me. Did you have any luck on getting anything to complie?
If you get some spare time, could you please elaborate a little on the process. thanks.
dwalls
11-06-2007, 05:57 PM
Hello,
Yes, I used Gumphrie's advice. This will work:
// Condition set 1
if (MACD(12, 26, 9)[0] > MACDBBLines(12, 9, 26, 5, 1).BB_UpperBand[0])
{
EnterLong(DefaultQuantity, "");
}
dwalls
01-27-2008, 10:59 PM
Hello Gumphrie,
I noticed that when I try to edit the "Smooth" Parameter in your "MacdBBLines" indicator it doesnt do anything. I dont know why.
Could you take a look please.
Also I found this version that someone made for eSignal last December.
I thought I would include it for you to review to see if theres anything in there that may help to improve yours (not that it needs improvement).
It does include the Macd value in the Data Box (cursor window) along with the upper and lower bands which is nice.
Thanks
var gUpperBoll = null;
var gLowerBoll = null;
var gMACD = null;
var gTagID = null;
function preMain() {
setPriceStudy(false);
setStudyTitle("DW_MACD_BB");
setCursorLabelName("DW_MACD_UB",0);
setCursorLabelName("DW_MACD",1);
setCursorLabelName("DW_MACD_LB",2);
setDefaultBarFgColor(Color.blue,0);
setDefaultBarFgColor(Color.red,1);
setDefaultBarFgColor(Color.blue,2);
setPlotType(PLOTTYPE_LINE,0);
setPlotType(PLOTTYPE_LINE,1);
setPlotType(PLOTTYPE_LINE,2);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
setDefaultBarThickness(1,2);
fp1 = new FunctionParameter( "MACD_FL", FunctionParameter.NUMBER);
with(fp1) {
setName("MACD Fast Length");
setDefault(12);
}
fp2 = new FunctionParameter( "MACD_SL", FunctionParameter.NUMBER);
with(fp2) {
setName("MACD Slow Length");
setDefault(26);
}
fp3 = new FunctionParameter( "MACD_SM", FunctionParameter.NUMBER);
with(fp3) {
setName("MACD Smoothing");
setDefault(9);
}
fp4 = new FunctionParameter("Source", FunctionParameter.STRING);
with(fp4) {
fp4.setName("Source");
fp4.addOption("Close");
fp4.addOption("High");
fp4.addOption("Low");
fp4.addOption("Open");
fp4.addOption("HL/2");
fp4.addOption("HLC/3");
fp4.addOption("OHLC/4");
fp4.setDefault("Close"); //Edit this value to set a new default
}
fp5 = new FunctionParameter( "Boll_Length", FunctionParameter.NUMBER);
with(fp5) {
setName("Bollinger Length");
setDefault(20);
}
fp6 = new FunctionParameter( "Boll_STD", FunctionParameter.NUMBER);
with(fp6) {
setName("Bollinger Standard Deviation");
setDefault(2);
}
}
function main(MACD_FL,MACD_SL,MACD_SM,Source,Boll_Length,Bo ll_STD){
var dblMACD = null; // MACD value @ current bar
var dblMACD_1 = null; // MACD value @ previous bar
var dblUpperBoll = null; // Upper BB value
var dblLowerBoll = null; // Lower BB value
var strBasisColor = null; // Basis color
var strCircleColor = null; // Circle Color
// Instantiations of studies (done once)
if (gMACD == null) {
gMACD = macd(MACD_FL,MACD_SL,MACD_SM);
gUpperBoll = upperBB(Boll_Length,Boll_STD,gMACD);
gLowerBoll = lowerBB(Boll_Length,Boll_STD,gMACD);
}
// Rounding required to enable proper white circle assessment
dblMACD = Math.round((gMACD.getValue(0))*10000)/10000;
dblMACD_1 = Math.round((gMACD.getValue(-1))*10000)/10000;
dblUpperBoll = Math.round((gUpperBoll.getValue(0))*10000)/10000;
dblLowerBoll = Math.round((gLowerBoll.getValue(0))*10000)/10000;
// MACD plot
if (dblMACD > dblMACD_1) strCircleColor = "Color.green";
else if (dblMACD == dblMACD_1) strCircleColor = "Color.white";
else if (dblMACD < dblMACD_1) strCircleColor = "Color.red";
drawShapeRelative(0, dblMACD, Shape.CIRCLE, null, eval(strCircleColor), Shape.ONTOP );
// changes the color of the band based on the value of the MACD
if (dblMACD >= 0) strBasisColor = "Color.green"; else strBasisColor = "Color.red";
drawLineRelative(-1,0,0,0, PS_SOLID, 2, eval(strBasisColor),fnGetTagID());
addBand(0,PS_SOLID,2,eval(strBasisColor),"0line");
return new Array (dblUpperBoll,dblMACD,dblLowerBoll);
}
function fnGetTagID() {
gTagID += 1;
return gTagID;
}
Gumphrie
01-28-2008, 12:04 PM
Hi dwalls,
Good point, the smooth parameter does effectively nothing / is unused because it is only used in the MACD call. The MACD itself uses it plot the 'Avg' plot, but as we don't have that in MACDBBLines, there is no use for it.
So we can remove the parameter entirely if need be.
dwalls
01-28-2008, 04:28 PM
Hello,
Here is an eSignal code that plots a diamond on the chart above or below a bar (candlestick) when the MacdBB close above or below the bollinger bands. Its called MacdBB Trendpoints.
If someone has time could they please convert it to Ninjascript.
It goes along with the eSignal code for the MacdBBLines below.
Included is a snapshot of the parameters for both the MacdBB Trendpoints and the MacdBBLines. They are the same parameters. You would adjust the parameters of each one to match up with each other.
Thanks
var gUpperBoll = null;
var gLowerBoll = null;
var gMACD = null;
var gbUP = false;
var gbDOWN = false;
function preMain() {
setPriceStudy(true);
setStudyTitle("DW_MACD_TrendPoints");
setShowTitleParameters(false);
setShowCursorLabel(false);
fp1 = new FunctionParameter( "MACD_FL", FunctionParameter.NUMBER);
with(fp1) {
setName("MACD Fast Length");
setDefault(12);
}
fp2 = new FunctionParameter( "MACD_SL", FunctionParameter.NUMBER);
with(fp2) {
setName("MACD Slow Length");
setDefault(26);
}
fp3 = new FunctionParameter( "MACD_SM", FunctionParameter.NUMBER);
with(fp3) {
setName("MACD Smoothing");
setDefault(9);
}
fp4 = new FunctionParameter("Source", FunctionParameter.STRING);
with(fp4) {
fp4.setName("Source");
fp4.addOption("Close");
fp4.addOption("High");
fp4.addOption("Low");
fp4.addOption("Open");
fp4.addOption("HL/2");
fp4.addOption("HLC/3");
fp4.addOption("OHLC/4");
fp4.setDefault("Close"); //Edit this value to set a new default
}
fp5 = new FunctionParameter( "Boll_Length", FunctionParameter.NUMBER);
with(fp5) {
setName("Bollinger Length");
setDefault(20);
}
fp6 = new FunctionParameter( "Boll_STD", FunctionParameter.NUMBER);
with(fp6) {
setName("Bollinger Standard Deviation");
setDefault(2);
}
}
function main(MACD_FL,MACD_SL,MACD_SM,Source,Boll_Length,Bo ll_STD){
var dblMACD = null; // MACD value @ current bar
var dblUpperBoll = null; // Upper BB value
var dblLowerBoll = null; // Lower BB value
// Instantiations of studies (done once)
if (gMACD == null) {
gMACD = macd(MACD_FL,MACD_SL,MACD_SM);
gUpperBoll = upperBB(Boll_Length,Boll_STD,gMACD);
gLowerBoll = lowerBB(Boll_Length,Boll_STD,gMACD);
}
dblMACD = gMACD.getValue(0);
dblUpperBoll = gUpperBoll.getValue(0);
dblLowerBoll = gLowerBoll.getValue(0);
// MACD plot
if (dblMACD > dblUpperBoll) fnAlert("UP");
else if (dblMACD < dblLowerBoll) fnAlert("DOWN");
return null;
}
function fnAlert(pstrAlert) {
if ((pstrAlert == "UP") && (gbUP == false)) {
gbUP = true;
gbDOWN = false;
drawShape(Shape.DIAMOND,AboveBar1,Color.cyan);
} else if ((pstrAlert == "DOWN") && (gbDOWN == false)) {
gbDOWN = true;
gbUP = false;
drawShape(Shape.DIAMOND,BelowBar1,Color.magenta);
}
return null;
}
Money Tree
02-01-2008, 02:37 PM
This is an indicator that plots the MACD and Bollinger bands worked out as a standard deviation from the MACD. It also highlights zero line crosses of the MACD line (displayed as dots).
Any comments or strategy suggestions welcome.
http://www.acuclick.net/MACDBBLines.jpg
ChangeLog :
Updated 21st August - Vers 0.2 - removed superfluous MACD dot plotted on the zero line for the current bar.
To import:
- Download the file contained in this thread to your desktop
- From the Control Center window select the menu File > Utilities > Import NinjaScript
- Select the downloaded file
I did what it says here and then realized that I have to unzip the file, I believe. I unzipped the file and saved it to a folder. Went to NT import script and tried to select the file. I have a file called attachment, open it to a file called indicator. That is as far as I can go. Clicking on it does nothing. Did I do this wrong? If I was successful, how would it appear in the list of NT indicators?
Gumphrie
02-01-2008, 02:43 PM
I did what it says here and then realized that I have to unzip the file, I believe. I unzipped the file and saved it to a folder. Went to NT import script and tried to select the file. I have a file called attachment, open it to a file called indicator. That is as far as I can go. Clicking on it does nothing. Did I do this wrong? If I was successful, how would it appear in the list of NT indicators?
Are you running that odd 6.5 beta version that uses ".ntns" file extensions?
If so you can juts rename as .ntns files are really just zip files. Shouldn't have to unzip...
Money Tree
02-01-2008, 10:13 PM
Are you running that odd 6.5 beta version that uses ".ntns" file extensions?
If so you can juts rename as .ntns files are really just zip files. Shouldn't have to unzip...
The problem was solved. But thanks for the prompt reply. I think it was there all along but I didn't see or know what name to look for. I thought it replaced the old MACD. It looks pretty neat and I have seen some good reports on it.
Mike
JOHNF1
09-01-2008, 12:03 PM
New to NT, I like to try out the MACDbb indicator, can you provide a file with instructions?
Thanks
Gumphrie
09-01-2008, 12:40 PM
Have you tried the first post?
paco99
09-05-2008, 11:23 AM
This is a great indicator! Has anyone tried to change this to a strategy? it would be interesting to see how it performs as a strategy that you can automate.
Thanks.
SteveM
11-15-2008, 11:23 AM
I was looking to download Macd BB Lines on my computer. I downloaded the zip files on my computer but am unable to unzip it. It says that I do not have the software programme that has created this indicator file. Can some one tell me what I need to do to be able to download this indicator. Thanks in advance.
Gumphrie
11-15-2008, 12:37 PM
I was looking to download Macd BB Lines on my computer. I downloaded the zip files on my computer but am unable to unzip it. It says that I do not have the software programme that has created this indicator file. Can some one tell me what I need to do to be able to download this indicator. Thanks in advance.
Is that using the import procedure? :
- Download the file contained in this thread to your desktop
- From the Control Center window select the menu File > Utilities > Import NinjaScript
- Select the downloaded file
Which NT version you using?
ripple
01-21-2009, 04:28 AM
Hi, I have a meta trader platform, can somebody advise where can I get MACD BB lines indicator for meta trader. Thnaks
Hooya
01-31-2009, 02:20 PM
Been looking at macd BB lines and have come across two different files on here. When I compared them visually they look quite different. On one the macd tracks the bb line quite closely. The other has an extra "period" parameter. I was wondering if anyone knows what the difference is between them?
New to exporting indicators. Have done it as one file but can do it as two if need be.
Thanks
LeoGuy
02-01-2009, 05:39 AM
Hi,
i'm kind of new to this & just wondering if some one really can help me please. i have downloaded indicator on my desktop & tried to go in Utilities,Import NinjaScript & then clicked on MacdBBlines, But nothing happend. indicator is not showing on list.
i tried to call my broker as well & ask his help, but no success
can some one PLEASE help me adding indicator to chart ?
Thanks a million in advance
NinjaTrader_Ben
02-01-2009, 12:10 PM
Hello,
Look over this link:
http://www.ninjatrader-support.com/HelpGuideV6/Import1.html
If you still cannot import the indicator, please provide me with the steps you are taking exactly and post the indicator file you are using.
LarryS
03-06-2009, 03:47 PM
Gumphrie,
Here are some more info video's on the T3 MACDBBLines. I found them very interesting. http://www.nss-t3.com/guide.htm
Maybe they can help you as well.
Good Day
All links to the videos are dead. Anyone know where to find more info about using this indicator?
dwalls
03-06-2009, 03:59 PM
Hi,
Try this link and scroll down to the "Videos and Links" area.
There you will find one called "Nexgen Macd BB Lines"...among others.
http://www.nexgent3.com/index.php?mod=trading
See if that will help you.
BobTN
12-02-2009, 05:01 PM
I like this indicator but I would like to add something to it. I am trying to draw a line connecting the BBs. I thought I could just add a new plot and plot the bbMacd as a line but I can't get it to work. Can some show me how to add this to the indicator?
fxcatty
01-31-2010, 06:37 PM
Hi, I was curious how hard it would be to use CCI with the BB instead of this indicator with the MACD and BB.. Has anyone seen that done yet or know how to do it? Thanks
NinjaTrader_Bertrand
02-01-2010, 07:12 AM
fxcatty, as starting point please look into the
bbMacd.Set(MACD(Input, fast, slow, smooth)[0]);
portion of code and try for example -
bbMacd.Set(CCI(Input, smooth)[0]);
The smooth input would then be your CCI Period....
winJR
05-05-2010, 06:22 PM
Great work on this indicator...very nice! Can someone write this up for Ninja 7? would be awesome. thanks for all the hard work.
GeorgeO
07-12-2010, 07:45 AM
I am trying to get the round dots on the MACDBB indicator to be a bit bigger. Is there some place in the code that I can modify to get this done?
SawDr
09-29-2010, 08:44 PM
I'd also like to make the dots a little larger AND have a line attaching the dots (similar to the eSignal version shown a few posts ago).
Silversea
06-30-2011, 02:46 PM
The MACD is being displayed outside and opposite of the BBLine and NOT following the price action trend. Unable to find the culprit. Indicator Settings are the same as in NinjatTrader 6.5.
This NT 7 is NOT dispaying the Indicator correctly !
Please Advice,