Пример #1
0
def fetch_cur():
    fname = find_cur()
    name = get_if_name(fname)
    path = get_if_path(fname)
    #print path,wh_path
    ifmap = ifreader.readp(path,name,extractor=extract_if_wh)  # fname ==> BaseObject(name='$name',transaction=trans)
    sif = ifmap[name]
    return fname,sif
Пример #2
0
def wcalc(strategy,functor):
    fname = find_cur()
    name = get_if_name(fname)
    path = get_if_path(fname)
    #print path,wh_path
    ifmap = ifreader.readp(path,name,extractor=extract_if_wh)  # fname ==> BaseObject(name='$name',transaction=trans)
    sif = ifmap[name]
    tradesy =  functor(sif,strategy)    #xfollow作为平仓信号,且去掉了背离平仓的信号
    iftrade.last_actions(tradesy)
Пример #3
0
def fget(strategy, priority=2500):
    fname = find_cur()
    name = get_if_name(fname)
    path = get_if_path(fname)
    #print path,wh_path
    ifmap = ifreader.readp(
        path, name, extractor=extract_if_wh
    )  # fname ==> BaseObject(name='$name',transaction=trans)
    sif = ifmap[name]
    return fname, sif
Пример #4
0
def wcalc(strategy, functor):
    fname = find_cur()
    name = get_if_name(fname)
    path = get_if_path(fname)
    #print path,wh_path
    ifmap = ifreader.readp(
        path, name, extractor=extract_if_wh
    )  # fname ==> BaseObject(name='$name',transaction=trans)
    sif = ifmap[name]
    tradesy = functor(sif, strategy)  #xfollow作为平仓信号,且去掉了背离平仓的信号
    iftrade.last_actions(tradesy)
Пример #5
0
def wxcalc(strategy,functor):
    fname = find_cur()
    name = get_if_name(fname)
    path = get_if_path(fname)
    #print path,wh_path
    ifmap = ifreader.readp(path,name,extractor=extract_if_wh)  # fname ==> BaseObject(name='$name',transaction=trans)
    sif = ifmap[name]
    print 'last updated--%s:%s' % (sif.transaction[IDATE][-1],sif.transaction[ITIME][-1])
    tradesy =  functor(sif,strategy)    #xfollow作为平仓信号,且去掉了背离平仓的信号
    #print tradesy
    iftrade.last_xactions(sif,tradesy)
Пример #6
0
def wxcalc(strategy, functor):
    fname = find_cur()
    name = get_if_name(fname)
    path = get_if_path(fname)
    #print path,wh_path
    ifmap = ifreader.readp(
        path, name, extractor=extract_if_wh
    )  # fname ==> BaseObject(name='$name',transaction=trans)
    sif = ifmap[name]
    print 'last updated--%s:%s' % (sif.transaction[IDATE][-1],
                                   sif.transaction[ITIME][-1])
    tradesy = functor(sif, strategy)  #xfollow作为平仓信号,且去掉了背离平仓的信号
    #print tradesy
    iftrade.last_xactions(sif, tradesy)