How to reproduce:
Check the attached project
Workaround:
Create a separate custom MACD indicator and add it to the chart, uncomment the commented code in the attached project
Friend Class MacdCustomIndicator
Inherits MacdIndicator
Private customBorderColor As Color
Public Property BorderColor() As Color
Get
Return customBorderColor
End Get
Set(ByVal value As Color)
customBorderColor = value
Me.ChildIndicator.BorderColor = value
End Set
End Property
Sub New()
Dim customMacdInnerIndicator = New CustomMacdInnerIndicator(Me)
Me.GetType().BaseType.GetField("childIndicator", BindingFlags.Instance Or BindingFlags.NonPublic).SetValue(Me, customMacdInnerIndicator)
End Sub
End Class
Friend Class CustomMacdInnerIndicator
Inherits MacdInnerIndicator
Public Sub New(owner As MacdIndicator)
MyBase.New(owner)
End Sub
Public Overrides Function GetProcessedValue(currentIndex As Integer) As Double
Dim macd As Double = Me.CalculateMacdValue(currentIndex, LongPeriod, ShortPeriod)
Me.Cache(macdValues).Add(currentIndex, macd)
Return macd
End Function
End Class