- ago
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.
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;
0
390
Solved
4 Replies

Reply

Bookmark

Sort
- ago
#1
I already reported the bug. I believe Glitch indicated that it would be fixed in build 19.
2
Best Answer
Glitch8
 ( 9.74% )
- ago
#2
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.
0
- ago
#3
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.
0
- ago
#4
@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
1

Reply

Bookmark

Sort