Beispiel #1
0
def create_extreme_node(nm, from_name, days = 10, capacity = 15):
    extreme_name = "%s_Extreme_%d" % (from_name, days)

    if not extreme_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        extreme = ExtremeNode(nm, from_name, days)
        nm.nodes[extreme_name] = extreme

        return extreme
    else:
        return nm.nodes[extreme_name]
Beispiel #2
0
def create_extreme_node(nm, from_name, days=10, capacity=15):
    extreme_name = "%s_Extreme_%d" % (from_name, days)

    if not extreme_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        extreme = ExtremeNode(nm, from_name, days)
        nm.nodes[extreme_name] = extreme

        return extreme
    else:
        return nm.nodes[extreme_name]
Beispiel #3
0
def create_ema_node(nm, from_name, days = 6, capacity = 15):
    _name = "%s_EMA_%d" % (from_name, days)

    if not _name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        n = EMANode(nm, from_name, days)
        n.capacity = capacity

        nm.nodes[_name] = n
        return n
    else:
        return nm.nodes[_name]
Beispiel #4
0
def create_k_line_node(nm, capacity):
    price_node.create_price_node(nm, capacity)

    _name = "K_Line"

    if not _name in nm.nodes:
        n = KLineNode(nm)
        n.capacity = capacity

        nm.nodes[_name] = n
        return n
    else:
        return nm.nodes[_name]
def create_trough_node(nm, from_name, days = 3, capacity = 7):
    name = "%s_Trough_%d" % (from_name, days)

    if not name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        trough = TroughNode(nm, from_name, days)
        trough.capacity = capacity
        nm.nodes[name] = trough

        return trough
    else:
        return nm.nodes[name]
Beispiel #6
0
def create_ema_node(nm, from_name, days=6, capacity=15):
    _name = "%s_EMA_%d" % (from_name, days)

    if not _name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        n = EMANode(nm, from_name, days)
        n.capacity = capacity

        nm.nodes[_name] = n
        return n
    else:
        return nm.nodes[_name]
Beispiel #7
0
def create_crest_node(nm, from_name, days=3, capacity=7):
    name = "%s_Crest_%d" % (from_name, days)

    if not name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        crest = CrestNode(nm, from_name, days)
        crest.capacity = capacity
        nm.nodes[name] = crest

        return crest
    else:
        return nm.nodes[name]
def create_crest_node(nm, from_name, days = 3, capacity = 7):
    name = "%s_Crest_%d" % (from_name, days)

    if not name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        crest = CrestNode(nm, from_name, days)
        crest.capacity = capacity
        nm.nodes[name] = crest

        return crest
    else:
        return nm.nodes[name]
Beispiel #9
0
def create_roc_node(nm, from_name, days=12, capacity=15):
    _name = "%s_ROC_%d" % (from_name, days)

    if not _name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        n = ROCNode(nm, from_name, days)
        n.capacity = capacity

        nm.nodes[_name] = n
        return n
    else:
        return nm.nodes[_name]
Beispiel #10
0
def create_trough_node(nm, from_name, days=3, capacity=7):
    name = "%s_Trough_%d" % (from_name, days)

    if not name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        trough = TroughNode(nm, from_name, days)
        trough.capacity = capacity
        nm.nodes[name] = trough

        return trough
    else:
        return nm.nodes[name]
Beispiel #11
0
def create_k_line_node(nm, capacity):
    price_node.create_price_node(nm, capacity)

    _name = "K_Line"

    if not _name in nm.nodes:
        n = KLineNode(nm)
        n.capacity = capacity

        nm.nodes[_name] = n
        return n
    else:
        return nm.nodes[_name]
Beispiel #12
0
def create_rsi_node(nm, from_name, days, capacity = 15):
    rsi_name = "%s_RSI_%d" % (from_name, days)

    if not rsi_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        rsi = RSINode(nm, from_name, days)
        rsi.capacity = capacity

        nm.nodes[rsi_name] = rsi

        return rsi

    else:
        return nm.nodes[rsi_name]
Beispiel #13
0
def create_kama_node(nm, from_name, days, capacity = 9):
    kama_name = "%s_KAMA_%d" % (from_name, days)

    if not kama_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        kama = KAMANode(nm, from_name, days)
        kama.capacity = capacity

        nm.nodes[kama_name] = kama

        return kama

    else:
        return nm.nodes[kama_name]
Beispiel #14
0
def create_ma_node(nm, from_name, days, capacity=15):
    ma_name = "%s_MA_%d" % (from_name, days)

    if not ma_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        ma = MANode(nm, from_name, days)
        ma.capacity = capacity

        nm.nodes[ma_name] = ma

        return ma

    else:
        return nm.nodes[ma_name]
Beispiel #15
0
def create_ma_node(nm, from_name, days, capacity = 15):
    ma_name = "%s_MA_%d" % (from_name, days)

    if not ma_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        ma = MANode(nm, from_name, days)
        ma.capacity = capacity

        nm.nodes[ma_name] = ma

        return ma

    else:
        return nm.nodes[ma_name]
Beispiel #16
0
def create_rsi_node(nm, from_name, days, capacity=15):
    rsi_name = "%s_RSI_%d" % (from_name, days)

    if not rsi_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        rsi = RSINode(nm, from_name, days)
        rsi.capacity = capacity

        nm.nodes[rsi_name] = rsi

        return rsi

    else:
        return nm.nodes[rsi_name]
Beispiel #17
0
def create_r_node(nm, from_name, days, capacity = 15):
    r_name = "%s_R_%d" % (from_name, days)

    if not r_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        create_extreme_node(nm, from_name, days, capacity)

        r = RNode(nm, from_name, days)
        r.capacity = capacity

        nm.nodes[r_name] = r

        return r
    else:
        return nm.nodes[r_name]
Beispiel #18
0
def create_r_node(nm, from_name, days, capacity=15):
    r_name = "%s_R_%d" % (from_name, days)

    if not r_name in nm.nodes:
        price_node.create_price_node(nm, capacity)

        create_extreme_node(nm, from_name, days, capacity)

        r = RNode(nm, from_name, days)
        r.capacity = capacity

        nm.nodes[r_name] = r

        return r
    else:
        return nm.nodes[r_name]