Skip to content

Commit 4a7d59b

Browse files
committed
make it compile and rename indicators
1 parent 71630a3 commit 4a7d59b

File tree

13 files changed

+26082
-8
lines changed

13 files changed

+26082
-8
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from backtrader import bt
2+
3+
class BollingerBandsBandwitch(bt.ind.BollingerBands):
4+
5+
'''
6+
Extends the Bollinger Bands with a Percentage line and a Bandwitch indicator
7+
'''
8+
lines = ('bandwitch',)
9+
plotlines = dict(bandwitch=dict(_name='%Bwtch')) # display the line as %B on chart
10+
11+
def __init__(self):
12+
super(BollingerBandsBandwitch, self).__init__()
13+
self.l.bandwitch = 100 * (self.l.top - self.l.bot) / self.l.mid
14+
pass
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

data/Source 1/EURUSD_M15_2020.csv

Lines changed: 24999 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)