How to create indicator MACD histogram 12,26,9
Author: ayc868
Creation Date: 3/3/2008 1:11 AM
profile picture

ayc868

#1
Wealth-Lab Version 5 (.NET) 5.0


the property do not have those parameters
profile picture

Eugene

#2
There's no need for input: MACD is always created with this standard set of parameters -- 12,26,9.

Should you need to enter your own non-standard parameters for MACD, then use MACDEx instead.
profile picture

fundtimer

#3
Or subtract two emas in ver 5.0.
profile picture

Eugene

#4
Couldn't believe there was the "WL5" tag line in the original post when I replied.

CODE:
Please log in to see this code.
profile picture

ayc868

#5
When I drag & drop MACD from "plot an indicator". It is an curve, but not an histogram. When I move cursor, it shows
MACD(close)=0.26 etc..

when look at the chart, i can not tell what kind of chart it is?
profile picture

Eugene

#6
When I drag & drop MACD from "plot an indicator". It is an curve, but not an histogram.

That's why the code above. There you have complete control of what's on the screen.
profile picture

Cone

#7
There seems to be some confusion here about what the MACD and a MACD Histogram are all about.
CODE:
Please log in to see this code.


In Eugene's code, the MACD should be plotted as a solid line. The Histogram is the difference between the MACD and its signal line. Eugene has corrected the Execute method above to reflect this.
profile picture

Eugene

#8
Robert, thanks, your correction was applied.
profile picture

ayc868

#9
In TC2000, I have the set up MACD histogram and line crossover
in one panel. but don't know how to setup in Wealth-lab 5.0.
In TC2000, to me it is almost a no brain work. I have been spend 5 hours in WL5, just can not get a MACD indicator in the chart. If i call Fidelity, can they help me on this?
profile picture

Eugene

#10
ayc868,

The code above is plotting a histogram with line crossover. What is wrong?
profile picture

Cone

#11
ayc, after you paste code, make sure that you compile it by clicking either "Run the Strategy" (which compiles first) or "Compile" in the Editor toolbar. If you "Compile", you must still run it by clicking a symbol or striking F5.
profile picture

ayc868

#12
I do not compile, will try when home. Thank Cone
Curious, can WL5 show indicators in the chart without write codes? also, any place have large amount of #C source codes
doing all kind of work? (other than sample strategy)
profile picture

ayc868

#13
The MACDEx histogram (codes from Eugene)looks completely different compare with TC2000 weekly chart.
profile picture

Eugene

#14
Which settings? What symbol? A screenshot?
profile picture

ayc868

#15
How do I put in a moving average SMA 3 on signal line?
profile picture

Eugene

#16
How do I put in a moving average SMA 3 on signal line?

1) Either drag and drop the SMA over the signal line (until you see squares all over it, drop only then), 2) or, by including an extra line of code (below the similarly looking lines):

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).