how-to-make-stock-trading-system.dogwood008.com
の続き。
japan-stock-prices_2020_7974.csv
で読めるようにする。
class KabuPlusJPCSVData(bt.feeds.YahooFinanceCSVData): ''' Parses pre-downloaded Yahoo Japan CSV Data Feeds (or locally generated if they comply to the Yahoo format) Specific parameters: - ``dataname``: The filename to parse or a file-like object - ``reverse`` (default: ``True``) It is assumed that locally stored files have already been reversed during the download process - ``adjclose`` (default: ``True``) Whether to use the dividend/split adjusted close and adjust all values according to it. - ``adjvolume`` (default: ``True``) Do also adjust ``volume`` if ``adjclose`` is also ``True`` - ``round`` (default: ``True``) Whether to round the values to a specific number of decimals after having adjusted the close - ``roundvolume`` (default: ``0``) Round the resulting volume to the given number of decimals after having adjusted it - ``decimals`` (default: ``2``) Number of decimals to round to - ``swapcloses`` (default: ``False``) [2018-11-16] It would seem that the order of *close* and *adjusted close* is now fixed. The parameter is retained, in case the need to swap the columns again arose. ''' params = ( ('reverse', True), ('adjclose', True), ('adjvolume', True), ('round', True), ('decimals', 2), ('roundvolume', False), ('swapcloses', False), ) # 未だ途中
ひとまずYahooのパーサを継承して、パラメタもセットしておく。未だ動かないので、ぼちぼちやっていく。