![]() |
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Dec 2011
Posts: 6
Thanks: 2
Thanked 0 times in 0 posts
|
I am trying to find a way to code or even use the Strategy Wizard to code if possible just a simple Fast line Crossing above and below the Slow line on the MACD. ALso is there a way to program in if the slow crosses above the slow line at a 45 degree angle buy? The standard default setting are fine for this.
Thank You |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,499
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Thanks for the forum post. Yes this is possible in the strategy wizard. I would recommend watching the following youtube video and replacing the input conditions for the MACD plots that you want to check against. Let me know if you have any questions after watching the below video. http://www.youtube.com/watch?v=fVFqw...ure=plpp_video -Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2011
Posts: 6
Thanks: 2
Thanked 0 times in 0 posts
|
I understand how to set a Fast and Slow Moving Average Cross which only has 2 parameters. When using the MACD the Fast (being 12) and the Slow (being 26) i see where they can be input but what i dont understand is how would you use the 3rd portion of the MACD being the smooth period?
Ryan |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Ryan,
MACD is the difference between the 2 EMAs. The Average is essentially an EMA of the MACD. The Smooth is the EMA period value. Please refer to the MACD indicator (in Control Center menu bar goto Tools>Edit NinjaScript>Indicaors…, in the Indicator dialog select MACD and click on Ok button) that comes with NinjaTrader to get an idea on how exactly MACD is calculated. To create a Macd crossover strategy please see the section “How to compare plot value of multi-Plot indicators” from here http://www.ninjatrader.com/support/h...on_builder.htm Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2011
Posts: 10
Thanks: 2
Thanked 2 times in 2 posts
|
Try:
CrossAbove(MACD(12, 26, 9).Diff, 0, 1) (or CrossBelow for shorts) |
|
|
|
|
The following user says thank you to smatthew for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Code to detect cross above of Stochastics.K/Stochastics.D, MACD.Value/MACD.Avg? | qfweiwei | General Programming | 5 | 07-20-2011 10:42 PM |
| MACD cross | tanou_us | Strategy Development | 6 | 07-26-2010 08:04 AM |
| Macd smooth cross indicator | ericgood | Indicator Development | 0 | 04-21-2010 08:32 PM |
| MACD Cross | suitguy1 | ATM Strategies (Discretionary Trading) | 1 | 08-04-2008 07:38 AM |
| How to write second cross over of MACD? | Jenny | Strategy Development | 2 | 07-18-2007 06:23 AM |