TradersEdgeSystems.com

Consulting | Custom Trading Systems
Built-In Indicators | Custom Indicators

November 2013 Stocks and Commodities Traders Tips


Reversing MACD: The Sequel

AIQ Version:

Original article by Johnny Dough
AIQ Code by Richard Denning

I provide AIQ code for the following functions that were coded by the author in Amibroker code:

  • PMACDsignal returns price where MACD crosses signal line or MACD histogram cross of 0
  • PMACDlevel returns price where MACD is equal to level value
  • PMACDeq returns price where MACD is equal to previous bar MACD

I created some additional rules to show reports that display the price values of the functions:

  • ShowValues rule will display all function values for stocks that are over the minPrice level input.
  • NearXO rule will list only those stocks that are less than or equal to the average range percentage of crossing over on the MACD oscillator.
  • PMACxup rule lists cross ups today on the MACD oscillator using the PMACDsignal price.
  • PMACxdn if rule lists cross downs today on the MACD oscillator using the PMACDsignal price.
The NearXO report is useful if you want to enter a position on a buy or sell stop-on-close when the MACD oscillator crosses over zero. This report sorts by the MACD oscillator. The ones with positive MACD oscillator amounts calculate the price that would be used to go short at the close for a cross down on the oscillator. The ones with negative MACD oscillator amounts calculate the price that would be used to go long at the close for a cross up on the oscillator. I ran the NearXO report on 9/10/2013 using the NASDAQ 100 list of stocks. There were 12 that showed up on the report meaning that they were near to a cross up or cross down on the MACD oscillator. In Figure 1, I show a chart of Qiagen NV (QGEN), which was on the report, and the report showed that a next day’s close price of 20.72 or higher would cause the MACD oscillator to go from negative to positive. On 9/11/2013, QGEN closed at 20.98 and the MACD oscillator moves to a positive number.

Captions:
Figure 1 – QGEN with MACD oscillator, closing price (white line) and price to make a cross up or cross down on the oscillator (dark green line).

EDS Code:
Reversing MACD.EDS
(right click and choose Save As)


 

Traders Studio Version :

Original article by Johnny Dough
Traders Studio Code by Richard Denning

The following code files are contained in the download from the websites:

  • Function: PMACDsignal returns price where MACD crosses signal line or MACD histogram cross of 0
  • PMACDlevel returns price where MACD is equal to level value
  • PMACDeq returns price where MACD is equal to previous bar MACD
Due to time constraints, I did not write any code that uses the functions such as an indicator plot or a trading system.

Traders Studio Code:
Reversing MACD Nov 2013.zip
(right click and choose Save As)

 

 

 

 

 

 

 

 

 

 

 

 

 

Disclaimer | Privacy Policy | Contact Us | Spam Blocker | ©2013 Traders Edge Systems