![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Market Analyzer Support for the NinjaTrader Market Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2011
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
Has anyone programmed an alert for the MACD crossover? It is not availble through the market analyzer so it needs to be programmed. I haven't done any programming so looking for a little help. Thanks! |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,783
Thanks: 160
Thanked 566 times in 557 posts
|
Hello,
If you are not familiar with programming, you might want to try using the Strategy Wizard to create a Cross Over strategy. This is a point and client interface that can help you get started. Instead of buying/selling when these crossover, you can simply tell the strategy to 'Alert'. Please see the Strategy Wizard Help Guide section on ' How to create a cross over condition': http://www.ninjatrader.com/support/h...on_builder.htm
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2011
Posts: 11
Thanks: 1
Thanked 0 times in 0 posts
|
X2
Michael |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Sep 2012
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
I used the wizard to program the strategy for MACD, which initially worked for a couple of days, but then spont quit for the ensuing 2 mos. The support people simply say to simplify the commands into component pieces, then debug.
How much simpler can it be to say IF [condition] K crosses D, or vice versa, THEN [action] play selected alert. I followed Matthew's suggestion from below using the wizard, but still no joy. O/w they say to hire one of their consultants. Contacted 4 of those consultants, but only one responded from UK, who offered to take over my computer to see what is wrong, @ about $60-70/hr. I am quite surprised this has not been perfected by NT or someone and generally available.
Last edited by snakeoil; 10-18-2012 at 04:12 PM.
Reason: add
|
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,187
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
Can you post your code? I and more than a few others could probably pin point the problem pretty easily. |
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Sep 2012
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
I appreciate your offer of assistance, sledge
Having used the wizard, I don't have the code expressed. I do have the screenshot of the formative page, but don't see how to attach it into this thread. Also, I suppose I could unlock the code and copy/paste that whole thing into the thread, if that is allowed. If I had an email address I could send the series of screen shots used in the wizard setup. My address is: coolholder@gmail.com What might you suggest? |
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,187
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
C:\Documents and Settings\YOURUSERNAME\My Documents\NinjaTrader 7\bin\Custom\Strategy and attach the .CS file. I assume it will be there, even it is unlocked. |
|
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Sep 2012
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
Found it: macd.cs. Will paste here:
#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.Gui.Chart; using NinjaTrader.Strategy; #endregion // This namespace holds all strategies and is required. Do not change it. namespace NinjaTrader.Strategy { /// <summary> /// Enter the description of your strategy here /// </summary> [Description("Enter the description of your strategy here")] public class macd : Strategy { #region Variables // Wizard generated variables private int myInput0 = 1; // Default setting for MyInput0 // 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 = false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Condition set 1 if (CrossAbove(MACD(8, 13, 5), MACD(8, 13, 5), 1)) { PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert2.wav"); PrintWithTimeStamp(""); } // Condition set 2 if (CrossBelow(MACD(8, 13, 5), MACD(8, 13, 5), 1)) { PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav"); PrintWithTimeStamp(""); } } |
|
|
|
|
|
#9 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,187
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
the carriage returns got lost in your post |
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Sep 2012
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
Being brand new to this, not seeing "manage attachments" anywhere
|
|
|
|
|
|
#11 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,187
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
OR if you use "REPLY", then choose "GO ADVANCED". |
|
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Sep 2012
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
#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.Gui.Chart; using NinjaTrader.Strategy; #endregion // This namespace holds all strategies and is required. Do not change it. namespace NinjaTrader.Strategy { /// <summary> /// Enter the description of your strategy here /// </summary> [Description("Enter the description of your strategy here")] public class macd : Strategy { #region Variables // Wizard generated variables private int myInput0 = 1; // Default setting for MyInput0 // 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 = false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Condition set 1 if (CrossAbove(MACD(8, 13, 5), MACD(8, 13, 5), 1)) { PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert2.wav"); PrintWithTimeStamp(""); } // Condition set 2 if (CrossBelow(MACD(8, 13, 5), MACD(8, 13, 5), 1)) { PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav"); PrintWithTimeStamp(""); } }
|
|
|
|
|
|
#13 |
|
Junior Member
|
I'm sure you guys all well pass this but I was just wondering.
I just started trying to use the plat "Diff" in the MACD in the Market Analyzer. but I alread see some number accuracy problems that Support has not been able to help me rectify. Now I'm wondering about the accuracy of all indicators, # of look back bars, etc. I'll be checkin' back and try to catch up with your advance methods of MACD crossover using script and strategy builder. Gino |
|
|
|
|
|
#14 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,783
Thanks: 160
Thanked 566 times in 557 posts
|
snakeoil,
I see you have used PrintWithTimeStamp, however there is no text being written. You should edit your strategy to print a message when the condition is true. After you have done this, open the output window under Tools--> Output window and when you enable your strategy, check this window to see if it has found any conditions on historical data. If the output window remains empty, this would mean your condition is never true. If you do see these messages printed, the condition should be valid.
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#15 | |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,783
Thanks: 160
Thanked 566 times in 557 posts
|
Quote:
Matthew
NinjaTrader Customer Service |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MACD Crossover | scartree | Automated Trading | 18 | 12-20-2010 08:50 AM |
| MACD Crossover | nybangali | General Programming | 25 | 10-29-2010 02:11 PM |
| MACD crossover in panel1 | kumaresh11 | Charting | 1 | 02-23-2010 07:20 AM |
| Macd crossover it's Avg | Dope63 | Strategy Development | 1 | 01-31-2010 12:45 AM |
| MACD Crossover question | rmyrick | Strategy Analyzer | 7 | 03-21-2008 01:03 PM |