The PlotIndicator() call below fails to plot a histogram; however, the PlotTimeSeries() call plots a histogram as expected. I'm running WL8 Build 18.
This has something to do with the indicator itself being plotted because there are indicators where PlotIndicator() works as expected.
This has something to do with the indicator itself being plotted because there are indicators where PlotIndicator() works as expected.
CODE:
public override void Initialize(BarHistory bars) { momentum = new Momentum(bars.Close, 12); smoothedMomentum = new EMA(momentum, 5); smoothedMomentum.Description = "Smoothed momentum oscillator"; PlotIndicator(smoothedMomentum, WLColor.Green, PlotStyle.Histogram, paneTag: "smoothedMomentum"); //PlotTimeSeries(smoothedMomentum, smoothedMomentum.Description, "smoothedMomentum", WLColor.Green, PlotStyle.HistogramTwoColor); } IndicatorBase momentum, smoothedMomentum;
Rename
I already reported the bug. I believe Glitch indicated that it would be fixed in build 19.
FYI- WL8 has an optimization so that if an indicator is plotted once, subsequent plots are NO-OPERATIONS. This is a safeguard against people putting plots in the Execute method.
if you really need to plot an indicator twice you'll need to create a copy of it in code.
if you really need to plot an indicator twice you'll need to create a copy of it in code.
QUOTE:
WL8 has an optimization so that if an indicator is plotted once, subsequent plots are NO-OPERATIONS
Interesting. But the code in the original post is only plotting the indicator once. The problem is it appears as a line plot rather than a histogram plot as defined. If this bug has been fixed already, thanks for fixing it.
@superticker, you could've clicked the profile link for @paul1986 and found this on top 🤷♂️
https://www.wealth-lab.com/Discussion/PlotIndicator-not-respecting-PlotStyle-Histogram-8669
https://www.wealth-lab.com/Discussion/PlotIndicator-not-respecting-PlotStyle-Histogram-8669
Your Response
Post
Edit Post
Login is required