This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyMFIStrategy(bt.Strategy): | |
def __init__(self): | |
mfi = bt.MFI_Canonical(self.data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MFI_Canonical(bt.Indicator): | |
lines = ('mfi',) | |
params = dict(period=14) | |
def __init__(self): | |
psum = self.data.close + self.data.low + self.data.high | |
tprice = psum / 3.0 | |
mfraw = tprice * self.data.volume | |
... |
NewerOlder