I have looked
https://www.wealth-lab.com/Discussion/MACDEx-Histogram3-7299
https://www.wealth-lab.com/Discussion/Can-classical-MACD-indicator-be-included-5772
I am still confused that in version 6 MACDEx_Histogram (not MACDEx_Histogram3) accepts two period parameters. But in version 8 MACDHist accepts three parameters.
I think there should be an equivalent way to use it.
Please tell me how to use 【MACD, MACDclassic
MACDHist sMACD sMACDSignal】 in version 8 to achieve the equivalent of MACDEx_Histogram
In version 8, I saw that the third parameter:signalLinePeriod accepted by MACDHist defaults to 9. Is this true in the actual algorithm implementation?
max(9, max(period_1, period_2)) * 3
https://www.wealth-lab.com/Discussion/MACDEx-Histogram3-7299
https://www.wealth-lab.com/Discussion/Can-classical-MACD-indicator-be-included-5772
I am still confused that in version 6 MACDEx_Histogram (not MACDEx_Histogram3) accepts two period parameters. But in version 8 MACDHist accepts three parameters.
I think there should be an equivalent way to use it.
Please tell me how to use 【MACD, MACDclassic
MACDHist sMACD sMACDSignal】 in version 8 to achieve the equivalent of MACDEx_Histogram
In version 8, I saw that the third parameter:signalLinePeriod accepted by MACDHist defaults to 9. Is this true in the actual algorithm implementation?
max(9, max(period_1, period_2)) * 3
Rename
WL8:MACDHist is equivalent to WL6:MACDEx_Histogram3.
WL8:MACD is equivalent to WL6:MACDEx.
WL8:MACDClassic is equivalent to WL6:MACD.
WL8:MACD is equivalent to WL6:MACDEx.
WL8:MACDClassic is equivalent to WL6:MACD.
I noticed that if you drag and drop MACDClassic and plot it with it companion indicator, it actually uses MACDHist with the (12, 26, 9) parameters for the histogram.
The difference is negligible (imho), but to get a precise "Classic" histogram you need to subtract the 9-period EMA of MACDClassic from MACDClassic, which you can do with Transformers or like this in code:
The difference is negligible (imho), but to get a precise "Classic" histogram you need to subtract the 9-period EMA of MACDClassic from MACDClassic, which you can do with Transformers or like this in code:
CODE:
namespace WealthScript9 { public class MyStrategy : UserStrategyBase { public override void Initialize(BarHistory bars) { _macdclassic = MACDClassic.Series(bars.Close); _signalline = EMA.Series(_macdclassic, 9); _histclassic = _macdclassic - _signalline; PlotIndicator(_macdclassic); PlotTimeSeries(_histclassic, "Hist", _macdclassic.PaneTag, WLColor.Orange, PlotStyle.HistogramTwoColor); } public override void Execute(BarHistory bars, int idx) { } private IndicatorBase _macdclassic; private IndicatorBase _signalline; private TimeSeries _histclassic; } }
Your Response
Post
Edit Post
Login is required