Skip to content

Commit 4f59dac

Browse files
committed
Correct comment for fillalpha and add baralpha for candlestick opacity
1 parent 2b62e71 commit 4f59dac

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

backtrader/plot/plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ def plotdata(self, data, indicators):
692692
colorup=self.pinf.sch.barup,
693693
colordown=self.pinf.sch.bardown,
694694
label=datalabel,
695+
alpha=self.pinf.sch.baralpha,
695696
fillup=self.pinf.sch.barupfill,
696697
filldown=self.pinf.sch.bardownfill)
697698

backtrader/plot/scheme.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ def __init__(self):
122122
self.barupfill = True
123123
self.bardownfill = True
124124

125-
# Wether the candlesticks have to be filled or be transparent
125+
# Opacity for the filled candlesticks (1.0 opaque - 0.0 transparent)
126+
self.baralpha = 1.0
127+
128+
# Alpha blending for fill areas between lines (_fill_gt and _fill_lt)
126129
self.fillalpha = 0.20
127130

128131
# Wether to plot volume or not. Note: if the data in question has no

0 commit comments

Comments
 (0)