Пример #1
0
def make_dur_state(sym, dur, threshold, indlist):
    ##    print sym,dur
    rpInd.create_states_filesWboost(sym, dur, today, threshold, indlist)
    for ind in indlist:
        mode = 'boost'
        state = rpInd.ShowRecentState(sym, dur, ind, mode)
        stateAge = rpInd.ShowRecentAge(sym, dur, ind, mode)
        val = rpInd.ShowRecentStateValue(sym, dur, ind, mode)
        crxtime = rpInd.ShowRecentCRXTime(sym, dur, ind, mode)
        price = rpInd.ShowRecentClPrice(sym, dur, ind, mode)

        print state, stateAge, val, ind, crxtime, price, sym, dur, threshold
Пример #2
0
def snapshot_sym(sym, today, durslist):
    ##    print 'got her'
    text = []
    barlist = ['1min', '3mins', '5mins', '15mins', '1hour']
    basisfile = DataDown + today + '.' + sym + '.' + '5secs' + '.both.csv'
    TicksUtile.assemble_dur_bars(today, sym, '1hour', 'initial', basisfile)
    posstate = rpInd.ShowRecentPositionState(sym)
    text.append(posstate + sym)
    threshold = 0.0
    indlist = ['mcross', 'kupper']
    ##    print posstate,sym,'recentstate age val | lastcrosstime| name USING THRESH ', threshold
    textline = 'recentstate age val name USING THRESH ' + str(threshold)
    text.append(textline)
    for dur in barlist:
        ##        print dur
        threshold = 0.0
        if dur == '1min':
            threshold = 0.1
##        print sym,dur
##        make_dur_state(sym,dur,threshold,indlist)
        basisdur = '5secs'
        startmode = 'initialize'
        basisfile = DataDown + today + '.' + sym + '.' + basisdur + '.both.csv'
        TicksUtile.assemble_dur_bars(today, sym, dur, startmode, basisfile)
        ### this relys on the sig creator to assemble each time
        rpInd.create_states_files(sym, dur, today, threshold, indlist)
        indlist = ['mcross']
        for ind in indlist:
            mode = 'noboost'
            state = rpInd.ShowRecentState(sym, dur, ind, mode)
            stateAge = rpInd.ShowRecentAge(sym, dur, ind, mode)
            val = rpInd.ShowRecentStateValue(sym, dur, ind, mode)
            crxtime = rpInd.ShowRecentCRXTime(sym, dur, ind, mode)
            price = rpInd.ShowRecentClPrice(sym, dur, ind, mode)
            if ind == 'mcross':
                textline = []
                tlist = [
                    state, dur, stateAge, val, price, crxtime, threshold, sym,
                    ind
                ]
                for t in tlist:
                    textline.append(str(t))
                text.append(str(textline))

                print state, dur, stateAge, val, price, crxtime, threshold, sym, ind
##        Triggers = rpInd.Trigger_from_states(sym,dur,'kupper')
##        lasttwo = rpu_rp.tail_array_to_array(Triggers,2)
##        for l in lasttwo:
##            print l[0],l[1],l[7],l[5],l[8],l[11],'kupperflips'
    print recenttick(sym)
    print '======================='
    return text
def make_dur_state(sym, dur, threshold, indlist):
    ##    print sym,dur, crxcode
    rpInd.create_states_files(sym, dur, today, threshold, indlist)
    for ind in indlist:
        state = rpInd.ShowRecentState(sym, dur, ind)
        stateAge = rpInd.ShowRecentAge(sym, dur, ind)
        val = rpInd.ShowRecentStateValue(sym, dur, ind)
        crxtime = rpInd.ShowRecentCRXTime(sym, dur, ind)
        crxcode = rpInd.ShowRecentCRXCode(sym, dur, ind)
        price = rpInd.ShowRecentClPrice(sym, dur, ind)

        ##        print  state, stateAge,val,ind, crxtime,price , sym, dur, threshold, crxcode
        print crxcode, sym