예제 #1
0
파일: d1ex.py 프로젝트: pophoo/foxengine
def hour2day_s(source,signals):  
    #根据signals选中相应的source,并在合并中以此source值为准
    #!=0相当于有信号
    #用于根据60分钟叉信号选出相应的价格
    ss = nequals(signals,0)
    ss1 = ss.choose(nzeros4(len(source)),source)
    return hour2day(ss1)/hour2day(ss)   #避免出现多个的情况
예제 #2
0
def hour2day_s(source, signals):
    #根据signals选中相应的source,并在合并中以此source值为准
    #!=0相当于有信号
    #用于根据60分钟叉信号选出相应的价格
    ss = nequals(signals, 0)
    ss1 = ss.choose(nzeros4(len(source)), source)
    return hour2day(ss1) / hour2day(ss)  #避免出现多个的情况
예제 #3
0
파일: d1ex.py 프로젝트: pophoo/foxengine
def decover1(source,interval=1):
    ''' 去除间隔期内!=0数值的重复出现,并将信号标准化为1
        新的信号会增强interval. 
        去除效率大于derepeatc
    '''
    nsource = nequals(source,0)
    ms = msum2(nsource,interval+1)  #间隔0为本位和,间隔1位本左邻和
    return gand(equals(ms,1),nsource)
예제 #4
0
def decover1(source, interval=1):
    ''' 去除间隔期内!=0数值的重复出现,并将信号标准化为1
        新的信号会增强interval. 
        去除效率大于derepeatc
    '''
    nsource = nequals(source, 0)
    ms = msum2(nsource, interval + 1)  #间隔0为本位和,间隔1位本左邻和
    return gand(equals(ms, 1), nsource)
예제 #5
0
파일: d1ex.py 프로젝트: pophoo/foxengine
def derepeatc(source):
    ''' 去除!=0数值的连续出现(只剩下第一个),正规化为1
        c是consecutive的意思
    '''
    t = subd(nequals(source,0))
    return equals(t,1)
예제 #6
0
def derepeatc(source):
    ''' 去除!=0数值的连续出现(只剩下第一个),正规化为1
        c是consecutive的意思
    '''
    t = subd(nequals(source, 0))
    return equals(t, 1)