- ago
In my extension-coded strategy, I am plotting two additional bar history objects along with the primary bar history. I am trying to set the bar colors for the additional plots.

Here is the primary bar history (without the strategy, additional bars, and colors)


The strategy code that adds additional bar histories (nothing special here)
CODE:
PlotBarHistory(_callBars, _callBars.Symbol); PlotBarHistory(_putBars, _putBars.Symbol); SetBarColors(_callBars); SetBarColors(_putBars);


The strategy code that applies colors to the bars (called by the above code) is
CODE:
protected void SetBarColors(BarHistory bars, WLColor? bullBarColor = null, WLColor? bearBarColor = null, WLColor? neutralBarColor = null) {    // Color defaults    bullBarColor ??= WLColor.Green;    bearBarColor ??= WLColor.Red;    neutralBarColor ??= WLColor.Black;    // Update colors    for (var idx = 0; idx < bars.Count; ++idx)    {       SetBarColor(bars, idx, bars.Close[idx] > bars.Open[idx]          ? bullBarColor          : bars.Close[idx] < bars.Open[idx]          ? bearBarColor          : neutralBarColor);    } }


After applying this strategy, the chart looks like this (primary and two additional plots)


Observations
1. The red color used for the primary plot changed after applying the strategy. The original one was a bit darker while after applying the strategy the color has become bright. Note that no colors are being applied to the primary bars object in the code.
2. In the second plot (the first additional plot), some bars are filled in green, some are filled in red, and others (green and red) are just outlined without fill.
3. In the third plot (the second additional plot), some bars are filled in red, and others (green and red) are just outlined without fill.
4. The additional plot panes do not show timestamp, OHLC, and volume values on mouse hover similar to the primary price pane. They only show the close price.

Is this a bug or am I doing something wrong?
0
131
4 Answers

Reply

Bookmark

Sort
- ago
#1
If this is a bug, pls get it fixed.
0
Cone7
- ago
#2
I'll add it to the list for investigation.
0
- ago
#3
Thanks
0
- ago
#4
Confirmed Dion's fix for the bug in B17.
0

Reply

Bookmark

Sort