![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jun 2007
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
|
How to write second cross above of MACD? And the second cross over is higher than the first one?
Thanks a lot
Last edited by Jenny; 07-17-2007 at 08:03 PM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
This is not exactly ninjascript code, but it gives you a general outline of how to write the code.
Code:
double macdvalue
int firstcross
if macd crossabove signal line <--or whatever condition you were trying for
{
if firstcross == 1 && current macd's value > macdvalue
{
blah blah do something
macdvalue = 0
firstcross = 0
}
else
{
macdvalue = macd's crossover value
firstcross = 1
}
}
|
|
|
|
|
|
#3 |
|
Member
Join Date: Jun 2007
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
|
Thank you!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hull MA of Macd Historigram | Learning1 | Indicator Development | 11 | 07-07-2007 01:25 PM |
| How to write a time period in wizard? | Jenny | Strategy Development | 19 | 06-18-2007 07:04 AM |
| Alert on cross over/under | scjohn | Market Analyzer | 5 | 05-25-2007 07:21 AM |
| Using MACD.avg vs. MACD | Jim-Boulder | Strategy Development | 1 | 05-23-2007 07:41 AM |
| RSI MACD trade system | zelli | Strategy Development | 3 | 11-28-2006 05:03 AM |