The MACD, Moving Average Convergence/Divergence is a widely used technical analysis indicator, developed by Gerald Appel.
The MACD line is calculated by taking the difference between a security's 26-bar and 12-bar exponential moving averages. The MACD formula in QuantShare is "macd()". You can also calculate the MACD of any other time-series by adding this time-series variable as a parameter to the MACD function. Example: "macd(open)"
The Moving Average Convergence/Divergence signal, which formula is "MacdSignal", is simply the exponential moving average of the MACD line, and the MACD histogram is the difference between the MACD line and the MACD signal line (Formula: MacdHist).
QuantShare allows you to control entirely how the MACD is calculated using three other functions (MacdExt, MacdExtSignal, MacdExtHist).
For example, the MacdExt formula accepts four parameters, which are the fast period, the fast moving average type (Simple, exponential, weighted... moving average), the slow period and the slow moving average type.
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.