Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Barbara Star's article, “Zero in on the MACD”, presented a trading strategy focused on the main line of the MACD. It uses colors and symbols to alert the trader to the market conditions and trend status. Below are the MetaStock formulas to color the MACD and add the colors and symbols to a chart through and expert advisor: Indicator formula:
Code:base:= OscP(12, 26, E, %);
If(base>=0, base, 0);
If(base<0, base, 0)
After plotting the above formula, you will have two lines in your chart. Select the top line and change the color to blue. Set the bottom line color to red. Change both lines to use the Histogram style. Expert Advisor formulas: Six formulas are used to make the expert. Two are highlights and others are symbols: Blue Highlight
formula:
Red Highlight
formula:
Buy Arrow
Code:formula:
Cross(OscP(12, 26, E, %), 0)
Sell Arrow
formula:
Code:Cross(0, OscP(12, 26, E, %))
Top warning diamond
formula:
Code:C < Mov(C, 34, W) AND H > Mov(C, 55, E)
Bottom warning diamond
formula:
Code:ma1:= Mov(C, 34, W);
ma2:= Mov(C, 55, E);
ma2 > ma1 AND C > ma1
|