PDA

View Full Version : Help with MACD strategy


tomonly23
12-11-2009, 09:16 AM
I understand how to program this strategy in the wizzard, but what i can not figure out is how to add a second condition that would only trigger if the MACD line is crosing above the zero line or below the zero line.

1. condition is if the MACD crosses above or below the signal line. (i can do this)
and
2. condition is if the MACD line is crosing above or below the zero line.

any help will be appreciated, thanks in advance Tom

NinjaTrader_Bertrand
12-11-2009, 09:36 AM
Tom, welcome to our forums - you would need to let it Cross Above / Below the numerical value of 0 - you can find this in the Misc category in the wizard.

http://www.ninjatrader-support.com/HelpGuideV6/ConditionBuilder-IndicatorToValueComparisons.html

tomonly23
12-11-2009, 11:39 AM
Thanks for your quick repply Bertrand, I must be doing something wrong.

It is not entering into to trades, I tried to paste the code so you can see but it will not allow me beacause of the size. Can i post the code in some other way, please let me know.
Any help again would be appreciated, thanks Tom

NinjaTrader_Josh
12-11-2009, 11:48 AM
Please attach the code as a zip file and you should be able to put that here. Thanks.

tomonly23
12-11-2009, 02:09 PM
Hi Bertrand,

attached is the code

NinjaTrader_Josh
12-11-2009, 02:58 PM
tomonly23,

Your code does not have any conditions for checking it versus a zero line.

If you want to check MACD versus a zero line you want to select MACD on the left hand side of the Condition Builder and then selecting Misc>Numeric value>0 on the right hand side. Then choose Cross Above/Below.

sjmuk
02-09-2010, 04:18 PM
Hi,

I'm new and i'm trying to create a MACD crossover strategy and wondered why [tomonly23] you use a plot of MACD in time bar 0 but plot .avg in bar -1?

Is it something specific i should consider?

cheers

NinjaTrader_Bertrand
02-09-2010, 04:24 PM
sjmuk, welcome to our forums - you would use this to compare the MACD value to the MACD Avg value, for example for a cross above / below to trigger signals.

http://www.ninjatrader-support.com/HelpGuideV6/ConditionBuilder-CrossOverConditions.html

http://www.ninjatrader-support.com/HelpGuideV6/ConditionBuilder-ComparingPlotValuesOfMultiPlotIndicators.html

sjmuk
02-10-2010, 02:05 AM
ok that makes sense. And very prompt response by the way... thanks