How to use the xalpha.get_bar function in xalpha

To help you get started, we’ve selected a few xalpha examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github refraction-ray / xalpha / tests / test_universal.py View on Github external
def test_set_handler():
    def alt_get_bar(code, **kws):
        if code == 1:
            return 1
        else:
            return

    xa.set_handler(method="bar", f=alt_get_bar)
    assert xa.get_bar(1) == 1
    assert len(xa.get_bar("PDD")) == 24
    xa.set_handler(method="bar")
github refraction-ray / xalpha / tests / test_universal.py View on Github external
def test_get_bar_xq():
    xa.get_bar("HK00700", interval=60)
    xa.get_bar("SH600000", interval=3600)
    xa.get_bar("commodities/brent-oil", interval=300, prev=20)
github refraction-ray / xalpha / tests / test_universal.py View on Github external
def test_set_handler():
    def alt_get_bar(code, **kws):
        if code == 1:
            return 1
        else:
            return

    xa.set_handler(method="bar", f=alt_get_bar)
    assert xa.get_bar(1) == 1
    assert len(xa.get_bar("PDD")) == 24
    xa.set_handler(method="bar")
github refraction-ray / xalpha / tests / test_universal.py View on Github external
def test_get_bar_xq():
    xa.get_bar("HK00700", interval=60)
    xa.get_bar("SH600000", interval=3600)
    xa.get_bar("commodities/brent-oil", interval=300, prev=20)
github refraction-ray / xalpha / tests / test_universal.py View on Github external
def test_get_bar_xq():
    xa.get_bar("HK00700", interval=60)
    xa.get_bar("SH600000", interval=3600)
    xa.get_bar("commodities/brent-oil", interval=300, prev=20)
github refraction-ray / xalpha / doc / samples / qdiipred.py View on Github external
def cached_get_bar(code, *args, **kws):
    if code.startswith("commodities/"):
        kws["handler"] = False
        return xa.get_bar(code, *args, **kws)
    return None