I only had a quick look at the original code but it seemed to be working. Barry posted a one way for you to look at you results, another way would be to EXPLORE and dissect what your code is doing.
So I added some columns to an exploration. Maybe if you look at it this, it will help you see if your code is calculating what you intended.
///Calculate # of Bars Since MACD 50-100 Crossed ABOVE (UP) or BELOW (DN) 0///
DN_MAXD = BarsSince(Cross(0, MACD(50,100))); ///Bars SINCE MACD50-100 Crossed BELOW 0///
UP_MAXD = BarsSince(Cross(MACD(50,100), 0 )); ///Bars SINCE MACD50-100 Crossed ABOVE 0///
///Insure that MACD 50-100 is at it's HIGHEST/LOWEST Value since Crossing the ZERO Line///
MAXDUP = HHV(MACD(50, 100), UP_MAXD);
MAXDDN = LLV(MACD(50, 100), DN_MAXD);
Filter=1;
AddColumn(Cross(MACD(50,100), 0),"cross over");
AddColumn(Cross(0, MACD(50,100)),"cross under");
AddColumn(MACD(50, 100),"MACD");
AddColumn(DN_MAXD, "DN_MAXD");
AddColumn(UP_MAXD, "UP_MAXD");
AddColumn(MAXDUP, "MAXDUP");
AddColumn(MAXDDN, "MAXDDN");
__._,_.___
Posted by: portfoliobuilder99@gmail.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
.
__,_._,___
EmoticonEmoticon