Exemplo n.º 1
0
# our "callables" for date parsing our datasets


def nyfed_dp(input):
    s = str(input).split(":")[0].split("T")[0]
    return parse("year-month-day", s, normalize=True)


def yahoofin_dp(input):
    return parse("year-month-day", str(input), normalize=True)


P.parse_indexes_as_date([[1, yahoofin_dp], [2, yahoofin_dp]])

# Meta-creators
mid = P.index([2], by=1)
mid = P.clean(mid)
mid = P.meta_derive(mid, "dislocation", lambda r: abs(
    ((r[2] - r[1]) / r[1]) * 100))

P.meta_line_chart(
    "./../bridges/nav-dislocation.bridge.json", {
        "use":
        mid,
        "bottom":
        0,
        "left": [3],
        "right": [2],
        "names": [
            "string:Date", "number:NDQ ETF", "ignore:NDQ MARKET PRICE",
            "number:Absolute Dislocation"
Exemplo n.º 2
0

def nyfed_dp(input):
    s = str(input).split(":")[0].split("T")[0]
    return parse("year-month-day", s, normalize=True)


def yahoofin_dp(input):
    return parse("year-month-day", str(input), normalize=True)


P.parse_indexes_as_date([[1, nyfed_dp], [2, yahoofin_dp], [3, yahoofin_dp],
                         [4, yahoofin_dp]])

# Meta-creators
mid = P.index([2, 3, 4], by=1)
mid = P.clean(mid)

P.meta_line_chart(
    "./../bridges/recession_probability_vix.bridge.json", {
        "use":
        mid,
        "bottom":
        0,
        "left": [1],
        "right": [2],
        "random": [3, 4],
        "names": [
            "string:Date", "number:Recession Probability", "number:VIX",
            "number:S&P", "number:NASDAQ"
        ]
Exemplo n.º 3
0
# our "callables" for date parsing our datasets


def nyfed_dp(input):
    s = str(input).split(":")[0].split("T")[0]
    return parse("year-month-day", s, normalize=True)


def yahoofin_dp(input):
    return parse("year-month-day", str(input), normalize=True)


P.parse_indexes_as_date([
    [1, nyfed_dp],
    [2, yahoofin_dp],
])

# Meta-creators
mid = P.index([1], by=2)
mid = P.clean(mid)

P.meta_line_chart(
    "./../bridges/recession_probability_bitcoin.bridge.json", {
        "use": mid,
        "bottom": 0,
        "left": [1],
        "right": [2],
        "names":
        ["string:Date", "number:Bitcoin", "number:Recession Probability"]
    })
Exemplo n.º 4
0
def gold(input):
    # print(input)
    s = str(input).split("T")[0]
    return parse("year-month-day", s, normalize=True)


def yahoofin_dp(input):
    # print(input)
    return parse("year-month-day", str(input), normalize=True)


P.parse_indexes_as_date([[1, gold], [2, yahoofin_dp], [3, yahoofin_dp]])

# Meta-creators
mid = P.index([1, 3], by=2)
mid = P.clean(mid)
# mid = P.meta_derive(mid, "dislocation", lambda r: abs(((r[2]-r[1])/r[1])*100))

P.meta_line_chart(
    "./../bridges/gold.bridge.json", {
        "use":
        mid,
        "bottom":
        0,
        "left": [1],
        "right": [2],
        "random": [3],
        "names": [
            "string:Date", "number:NYSE-GOLD", "number:Gold Spot",
            "number:Dollar Index"