def get_info(date): todayhyphen = rpu_rp.todaysdatehypens(date) ## Mod_Mod_Mod_Mod_RP_Snapshot.snapshot_sym(sym,date,['5mins']) ## need this to create good both bars ## btime = '15:30:0' Mod_RP_Snapshot.show_one_bar('ES', '1min', btime, date) ############### ############ regionlist = ['USA', 'EUROPE', 'ASIA'] for r in regionlist: for tag in tag_list: ctag = r + tag startbartime = tagsstartdict[ctag] endbartime = tagsenddict[ctag] ## print r,tag,ctag,startbartime,endbartime rangehilos = BarUtiles.show_hi_lo_bar_range( sym, '5mins', startbartime, endbartime, date) LOW = rangehilos[0] HIGH = rangehilos[1] HIGHTIME = rangehilos[3].replace(bla, '') LOWTIME = rangehilos[2].replace(bla, '') CLOSE = rangehilos[4] OPEN = rangehilos[6] ## closetime is in 5 print('%8s %8s %8s %8s %8s %8s %8s %8s %8s %8s' % (r, tag, LOW, HIGH, CLOSE, LOWTIME, HIGHTIME, startbartime, endbartime, OPEN))
def get_info(date): print 'DAILY PIVOT = 2000.2 | WEEKLY = 2046.6' todayhyphen = rpu_rp.todaysdatehypens(date) ## RP_Snapshot.snapshot_sym(sym,date,['5mins']) ## need this to create good both bars ## btime = '15:30:0' RP_Snapshot.show_one_bar('ES','1min',btime,date) ############### regionlist = ['USA','EUROPE','ASIA'] for r in regionlist: finfostring = '%9s %9s %9s %9s %9s %9s %9s %9s %9s %9s' aheader = ['r','tag','LOW','HIGH','CLOSE','LOWTIME','HIGHTIME','startbt','endb','OPEN'] ## print ', '.join(aheader) print (finfostring % ('r','tag','LOW','HIGH','CLOSE','LOWTIME','HIGHTIME','startbt','endb','OPEN')) ## print (finfostring % (str(aheader).strip('[]'))) ## ', '.join(mylist) for tag in tag_list: ctag = r+tag startbartime = tagsstartdict[ctag] endbartime = tagsenddict[ctag] ## print r,tag,ctag,startbartime,endbartime #test rangehilos = BarUtiles.show_hi_lo_bar_range(sym,'5mins',startbartime,endbartime,date) print rangehilos LOW = rangehilos[0] HIGH = rangehilos[1] HIGHTIME = (rangehilos[3].replace(bla,'')).replace(' ','') LOWTIME = (rangehilos[2].replace(bla,'')).replace(' ','') CLOSE = rangehilos[4] OPEN = rangehilos[6] ## closetime is in 5 CLOSETIME = rangehilos[5] ## closetime is in 5 print(finfostring % (r,tag,LOW,HIGH,CLOSE,LOWTIME,HIGHTIME,startbartime,endbartime,OPEN))
def get_info(date): todayhyphen = rpu_rp.todaysdatehypens(date) ## RP_Snapshot.snapshot_sym(sym,date,['5mins']) ## need this to create good both bars ## ## btime = '15:30:0' ## RP_Snapshot.show_one_bar('ES','1min',btime,date) ############### pmLines = RP_Snapshot.show_bar_range(sym,'5mins','21:20:00','22:05:00',date) for line in pmLines: print line
def show_one_bar(sym, dur, bartime, date): stem = '.' + dur + '.both.csv' datehyphen = rpu_rp.todaysdatehypens(date) if dur == 'RTicks': stem = '.RTticks.csv' barfile = DataDown + date + '.' + sym + stem bars = rpu_rp.CsvToLines(barfile) lines = rpu_rp.grep_array_to_array(bars, datehyphen + bartime) l = [] ## for l in lines: ## print l return l
def show_one_bar(sym,dur,bartime,date): stem = '.'+dur +'.both.csv' datehyphen = rpu_rp.todaysdatehypens(date) if dur == 'RTicks': stem = '.RTticks.csv' barfile = DataDown + date + '.' + sym + stem bars = rpu_rp.CsvToLines(barfile) lines = rpu_rp.grep_array_to_array(bars,datehyphen +bartime) l=[] ## for l in lines: ## print l return l
def show_bar_range(sym,dur,startbartime,endbartime,date): datehyphen = rpu_rp.todaysdatehypens(date) startbartime = TicksUtile.time_to_epoch(datehyphen + startbartime) endbartime = TicksUtile.time_to_epoch(datehyphen + endbartime) stem = '.'+dur +'.both.csv' if dur == 'RTicks': stem = '.RTticks.csv' barfile = DataDown + date + '.' + sym + stem bars = rpu_rp.CsvToLines(barfile) newbars =[] for bar in bars: if len(bar) > 2: ## print bar,'is bar' curbartime = TicksUtile.time_to_epoch(bar[1]) if curbartime > startbartime and curbartime < endbartime: newbars.append(bar) ## for b in newbars: ## print b return newbars
def show_bar_range(sym, dur, startbartime, endbartime, date): datehyphen = rpu_rp.todaysdatehypens(date) startbartime = TicksUtile.time_to_epoch(datehyphen + startbartime) endbartime = TicksUtile.time_to_epoch(datehyphen + endbartime) stem = '.' + dur + '.both.csv' if dur == 'RTicks': stem = '.RTticks.csv' barfile = DataDown + date + '.' + sym + stem bars = rpu_rp.CsvToLines(barfile) newbars = [] for bar in bars: if len(bar) > 2: ## print bar,'is bar' curbartime = TicksUtile.time_to_epoch(bar[1]) if curbartime > startbartime and curbartime < endbartime: newbars.append(bar) ## for b in newbars: ## print b return newbars
def get_info(date): todayhyphen = rpu_rp.todaysdatehypens(date) ## Mod_Mod_Mod_Mod_RP_Snapshot.snapshot_sym(sym,date,['5mins']) ## need this to create good both bars ## btime = '15:30:0' Mod_RP_Snapshot.show_one_bar('ES','1min',btime,date) ############### ############ regionlist = ['USA','EUROPE','ASIA'] for r in regionlist: for tag in tag_list: ctag = r+tag startbartime = tagsstartdict[ctag] endbartime = tagsenddict[ctag] ## print r,tag,ctag,startbartime,endbartime rangehilos = BarUtiles.show_hi_lo_bar_range(sym,'5mins',startbartime,endbartime,date) LOW = rangehilos[0] HIGH = rangehilos[1] HIGHTIME = rangehilos[3].replace(bla,'') LOWTIME = rangehilos[2].replace(bla,'') CLOSE = rangehilos[4] OPEN = rangehilos[6] ## closetime is in 5 print('%8s %8s %8s %8s %8s %8s %8s %8s %8s %8s' % (r,tag,LOW,HIGH,CLOSE,LOWTIME,HIGHTIME,startbartime,endbartime,OPEN))
locals()[var] = nd[var] #################### from time import sleep import rpu_rp, rpInd, TicksUtile import ctypes ############################## symbol_list = symdict.keys() ##symbol_list =['ES','EUR.USD'] barlistall = bardict.keys() ## barlist =[] barlist = ['1 Week'] ########################################## date = rpu_rp.todaysdateunix() date = '20150905' datehyphen = rpu_rp.todaysdatehypens(date) ########################## import RP_Snapshot sym = 'SPX' ##RP_Snapshot.snapshot_sym(sym,date) basisdur = '1day' TicksUtile.assemble_dur_bars(date,sym,'1day','initialize','5secs') TicksUtile.assemble_bars_1min_basis(date,sym,'1Week','bartobar',basisdur) indlist = ['mcross','pivot','R','R2','S','S2'] threshold = 0.0 rpInd.create_states_files(sym,'1Week',date,threshold,indlist) rpInd.create_states_files(sym,'1day',date,threshold,indlist) ''' def fibbo_50retrace(low,high,sym,perc) : # could also use a time range for a range of bars / add this to states per duration retraceval = (high-low)/(100/perc)
locals()[var] = nd[var] #################### from time import sleep import rpu_rp, rpInd, TicksUtile import ctypes ############################## symbol_list = symdict.keys() ##symbol_list =['ES','EUR.USD'] barlistall = bardict.keys() ## barlist = [] barlist = ['1 Week'] ########################################## date = rpu_rp.todaysdateunix() date = '20150905' datehyphen = rpu_rp.todaysdatehypens(date) ########################## import RP_Snapshot sym = 'SPX' ##RP_Snapshot.snapshot_sym(sym,date) basisdur = '1day' TicksUtile.assemble_dur_bars(date, sym, '1day', 'initialize', '5secs') TicksUtile.assemble_bars_1min_basis(date, sym, '1Week', 'bartobar', basisdur) indlist = ['mcross', 'pivot', 'R', 'R2', 'S', 'S2'] threshold = 0.0 rpInd.create_states_files(sym, '1Week', date, threshold, indlist) rpInd.create_states_files(sym, '1day', date, threshold, indlist) ''' def fibbo_50retrace(low,high,sym,perc) : # could also use a time range for a range of bars / add this to states per duration retraceval = (high-low)/(100/perc) return retraceval