Beispiel #1
0
def reader(symbol, action, market, tdxdir, output):
    client = Reader.factory(market=market, tdxdir=tdxdir)

    try:
        feed = getattr(client, action)(symbol=symbol)
        to_file(feed, output) if output else None
        print(feed)
    except Exception as e:
        raise e
Beispiel #2
0
class TestReader(unittest.TestCase):
    reader = None

    # 初始化工作
    def setUp(self):
        self.reader = Reader(tdxdir='./tests/data')

    # 退出清理工作
    def tearDown(self):
        pass

    # 具体的测试用例,一定要以test开头
    def testDaily(self):
        self.assertTrue(self.reader.daily(symbol='600036') is not None)

    def testMinbar(self):
        self.assertTrue(self.reader.minute(symbol='600036') is not None)

    def fzlineMinbar(self):
        self.assertTrue(self.reader.fzline(symbol='600036') is not None)
Beispiel #3
0
 def setUp(self):
     self.reader = Reader.factory(market='std', tdxdir='../fixtures')
Beispiel #4
0
# -*- coding: utf-8 -*-
from mootdx.reader import Reader

# 初始化通达信文件读取类
reader = Reader.factory(market='std', tdxdir='../fixtures')  # 标准市场
# reader = Reader.factory(market='ext', tdxdir='../fixtures') # 扩展市场

# 读取分钟数据
minute = reader.minute(symbol='600000')

# 读取时间线数据
fzline = reader.fzline(symbol='600000')

# 读取日数据
daily = reader.daily(symbol='600000')

print(minute, fzline, daily)
Beispiel #5
0
from mootdx.reader import Reader

# 初始化通达信文件读取类
reader = Reader(tdxdir='./tests/data')

# 读取分钟数据
minute = reader.minute(symbol='600036')

# 读取时间线数据
fzline = reader.fzline(symbol='600036')

# 读取日数据
daily = reader.daily(symbol='600036')

print(minute, fzline, daily)
Beispiel #6
0
 def setUp(self):
     self.reader = Reader(tdxdir='./tests/data')
Beispiel #7
0
from mootdx.reader import Reader

# 初始化通达信文件读取类
reader = Reader.factory(market='std', tdxdir='./tests/data') # 标准市场
# reader = Reader.factory(market='ext', tdxdir='./tests/data') # 扩展市场

# 读取分钟数据
minute = reader.minute(symbol='600036')

# 读取时间线数据
fzline = reader.fzline(symbol='600036')

# 读取日数据
daily = reader.daily(symbol='600036')

print(minute, fzline, daily)
Beispiel #8
0
 def setUp(self):
     self.reader = Reader.factory(market='ext', tdxdir='./tests/data')