- ago
If you plot an indicator using method PlotIndicator and use PlotStyle.Histogram then a line is drawn and not a histogram. For example, presume BollWidth is of type BBWidth:

CODE:
PlotIndicator(BollWidth, WLColor.Coral, PlotStyle.Histogram);


Note, for the above example, as expected the indicator is plotted in its own pane without explicity specifying the pane tag.

The plotting problem also occurs for (at least) the ATR indicator.

I'm plotting 13 indicators and/or time series in my code, so if you can't recreate the problem then maybe one of the other plots is indirectly causing the issue.

WL8 build is 17

Workaround is to use PlotTimeSeries.
0
648
Solved
12 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.53% )
- ago
#1
Would love to see some minimal strategy code that can duplicate this, because I have not been able to so far.
0
- ago
#2
Hello, Glitch:

Thanks for the speedy feedback.

I generated a new C# strategy. It does nothing but create a BBWidth and then plot it using PlotIndicator and the same problem occurred (code below). Then, I upgraded to WL8 Build 18 from build 17, including updating extensions as necessary. The same problem occurred. Here are the extensions I am using, and they are all up-to-date as of 2022/10/12. I am using one stock.

AdvancedSmoother
Candlesticks
ChartPatterns
DataExtensions
IchimokuCloud
IndexLab
IndicatorProfiler
NeuroLab
PowerPack
TDAmeritrade
TrendChartStyles

Here's the code

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          BollWidth = BBWidth.Series(bars.Close, 20, 1);          PlotIndicator(BollWidth, WLColor.Aqua, PlotStyle.Histogram); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below       BBWidth BollWidth { get; set; } } }


Also, I changed the BollWidth property to a field, but that didn't matter (didn't think it would, but gave it a shot anyhow.)

Next, I downloaded all of the installed extensions and re-installed them. That made no difference. Changed my scale from one minute to daily and that made no difference.

Chart preferences are set to Dark Theme, all defaults for Colors and Fonts (I am pretty sure I never changed them), Chart Style is Candlestick not customized. Other chart settings where there are dropdowns I'm pretty sure I never changed them. As for chart style other settings the following are checked: Show Volume Pane, Show Event Item Icons, Show Trade Arrows, Size Chart (Vertical) to Indicators, Show Status Bar, Always Show Toolbar, Show Trade Signal lines.

I'm not running a virtual machine. I'm running an AMD 5950x with 64 GB memory with Windows 11.

Maybe this is one of those bugs that is an extreme edge case. There is a workaround (PlotTimeSeries). Perhaps this goes into the bug bucket with a low priority since you can't recreate it.

If you wish to pursue this further and need additional information (such as DLL versions, etc.) please let me know.
0
- ago
#3
Perhaps the issue is specific to the actual symbol(s), bar scale and data provider. What are they?
0
- ago
#4
The symbol is RBLX, scale is one minute (same problem with daily), and data provider is TD Ameritrade. I tried DKNG too, but that made no difference.

So, I switched the symbol to A (Agilent), daily scale, and used WealthData as the data provider. The problem occurred. I made sure WealthData showed up as the provider in the chart (at the bottom). Just to be super sure, I had unchecked TD Ameritrade as a provider, moved its priority down, and made sure symbol A had no data whatsoever before running the test.

Please let me know if you would like additional information.
0
Glitch8
 ( 12.53% )
- ago
#5
Thanks, I was able to duplicate it and it's fixed for Build 19.
1
Best Answer
- ago
#6
Does adding "public" in front of the BollWidth property help? (This is only a guess. I don't know what the underpinning code for PlotIndicator and PlotStyle look like.)
CODE:
public BBWidth BollWidth { get; set; }
0
Glitch8
 ( 12.53% )
- ago
#7
No it was just a flaw in our implementation of PlotIndicator.
1
- ago
#8
Why does the following still result in a Line plot being rendered? It seems as if modifying PlotStyle to anything does not change the rendered output. Rendered output is always a Line. Changing the color parameter DOES change the output so it's clearly looking at changes to this line of code when I modify.

CODE:
ind12 = new Fred(bars, "FEDFUNDS", true, "Levels (No transformation)"); PlotIndicator(ind12, WLColor.CadetBlue, PlotStyle.Histogram, false, "FEDFUNDS");


It does not seem to be only the FRED indicators that have this behavior. I even modifed the code generated RSI indicator to render as Histogram and it still renders as a Line plot.

CODE:
indicator = new RSI(bars.Close, 20); PlotIndicator(indicator, new WLColor(255, 0,0), PlotStyle.Histogram, false, "STRATINDS"); indicator.MassageColors = true;


0
- ago
#9
"Still" because B19 is not yet released.

No need in a duplicate topic, you could've simply replied to the topic I've just appended your post to.
1
- ago
#10
Hi, Glitch:

I had the same problem occur when using PlotStyle.DashedLine with PlotIndicator. Workaround was to use PlotTimeSeries. Maybe its just part of the same bug fix you planned for B19, but I thought you should know just in case the problem is broader than PlotStyle.Histogram. From your other post(s), I get the impression its a problem with PlotIndicator and not just a particular plot style. Hope that helps.

Paul
0
- ago
#11
QUOTE:
I had the same problem occur when using PlotStyle.DashedLine with PlotIndicator.

CODE:
PlotIndicator(vwmaSell, WLColor.Brown,PlotStyle.DashedLine);
I have the same exact problem with PlotIndicator on WL8 Build 21. It plots a solid line for
PlotStyle.DashedLine
PlotStyle.DottedLine
PlotStyle.ThickLine
PlotStyle.ZigZag

However, PlotIndicatorLine() works as expected.
0
Glitch8
 ( 12.53% )
- ago
#12
Thank you, I have it corrected for Build 22.
1

Reply

Bookmark

Sort