logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
KTP2  
#1 Posted : Tuesday, November 11, 2008 4:42:56 PM(UTC)
KTP2

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 2/2/2007(UTC)
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

If an indicator can be displayed as a histogram, you can easily plot it with multiple colors using conditional statements. This allows you to specify different colors for different conditions. The following examples demonstrate how this is done with the MACD and the Volume, using MetaStock for Windows.

The first example shows you how to display the MACD as a multi-colored plot. The conditions are; if today's MACD is greater than yesterday's, plot a green histogram, or if today's MACD is less than yesterday's, plot a red histogram. To create the formulas, choose the Indicator Builder from the Tools menu in MetaStock and enter the following formulas. Note: each formula needs to be added as a separate formula.

Name: MACD +
Formula: If(MACD()>=Ref(MACD(),-1),MACD(),0)

Name: MACD -
Formula: If(MACD()<ref(MACD(),-1),MACD(),0)

Name: MACD Signal Line
Formula: Mov(MACD(),9,E)

Then to display the indicators in MetaStock:

    <lI>Drag the MACD + from the Indicator QuickList to a new inner window. <lI>Double-click on it and change the style to a histogram and change the color to green. <lI>Next, drag the MACD - from the Indicator QuickList to the same inner window. <lI>Double-click on it and change the style to a histogram and change the color to red. <lI>Next, drag the MACD Signal Line into same inner window and change the color to black.

The conditions for the second example are; today's volume is greater than yesterday's volume, or today's volume is less than yesterday's volume. Follow the same steps as above to create and plot the formulas.

Name: Volume +
Formula: If(V>=Ref(V,-1),V,0)

Name: Volume -
Formula: If(V<ref(V,-1),V,0)

The conditions for the last example are; today's volume is greater than its 10 day Moving Average, or today's volume is less than its 10 day Moving Average. Again, follow the steps from example one to create and plot the formulas.

Name: Moving Average Volume +
Formula: If(V>=Mov(V,10,S),V,0)

Name: Moving Average Volume -
Formula: If(V<mov(V,10,S),V,0)

Use the above examples and modify them for your favorite indicator and preferred conditions to create your own multi-colored indicators.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.