Beispiel #1
0
def create_previous_state_array(btestmode,sym,barnum):
    indlist = partindlist
    durlist = barlistRecent
    currentstates =[]
    last1minbar = rpInd.ShowABarofInd(sym,'1min','mcross',barnum)
    timeofbar = last1minbar[0]
##    print timeofbar
    for dur in durlist:
        for ind in indlist:
            lastbar = rpInd.ShowABarofIndByTime(sym,dur,ind,timeofbar,barnum)
            currentstates.append(lastbar)
    return currentstates,timeofbar
Beispiel #2
0
def create_previous_state_array(sym, barnum):
    indlist = ['mcross', 'stochD', 'kupper']
    durlist = ['1min', '3mins', '5mins', '15mins']
    currentstates = []
    last1minbar = rpInd.ShowABarofInd(sym, '1min', 'mcross', barnum)
    ##    print last1minbar
    timeofbar = last1minbar[0]
    print timeofbar
    for dur in durlist:
        for ind in indlist:
            lastbar = rpInd.ShowABarofIndByTime(sym, dur, ind, timeofbar)
            currentstates.append(lastbar)
    return currentstates
def create_previous_state_array(btestmode, sym, barnum, backtestdur):
    durlist = barlist_Recent
    currentstates = []
    last1minbar = rpInd.ShowABarofInd(
        sym, backtestdur, 'mcross',
        barnum)  ## was 1min ### this controls the backtester!!
    timeofbar = last1minbar[0]
    for dur in durlist:
        for ind in indlist:
            lastbar = rpInd.ShowABarofIndByTime(sym, dur, ind, timeofbar,
                                                barnum)
            currentstates.append(lastbar)
    return currentstates, timeofbar
def create_previous_state_array(btestmode, sym, barnum):
    durlist = barlist_Recent
    currentstates = []
    last1minbar = rpInd.ShowABarofInd(sym, '15mins', 'mcross',
                                      barnum)  ## was 1min
    timeofbar = last1minbar[0]
    ##    print timeofbar
    for dur in durlist:
        ##        print dur
        for ind in indlist:
            ##            print ind,dur
            lastbar = rpInd.ShowABarofIndByTime(sym, dur, ind, timeofbar,
                                                barnum)
            ##            print lastbar
            currentstates.append(lastbar)
    return currentstates, timeofbar