## dividend yields ## deal flag ## open interest ## number of strikes ## weeklies yes or no ## pennies yes or no sumodate = '2014-06-20' volumereport = rptarea + 'volume_report-complete-' + sumodate + '.csv' ## new lists based on latest volume rport tiers = rputiles.create_dict(volumereport, 1, 0) ##fnamefile=open(volumereport, 'r') lines = rputiles.CsvToLines(volumereport) stocklist = [] count = 1 pricebin = 'no' ## total volumes and avg tier volumes and categorize and create_dicts tierlist = ['A', 'B', 'C', 'D', 'E', 'F', 'G'] tierlist = ['C'] count = totalvol = 0 tieravgs = [] for tierq in tierlist: print tierq for line in lines: aline = [] tier = 'bla' tier = line[0]
todaydate = '20140625' ####################################### for f in (glob.glob(downloads + 'GBLACTIVITY' + todaydate + '*.csv')): print f print 'this file needs to automv to GS' for f in (glob.glob(GSarea + 'GBLACTIVITY' + todaydate + '*.csv')): tradefile = f for f in (glob.glob(GSarea + 'GBLPOSITIONAT' + todaydate + '*.csv')): GSposfile = f time = '' ##tradefile = DATA + 'GS/' + 'GBLACTIVITY' + todaydate + '194445' +custnum +'.csv' ##GSposfile = DATA + 'GS/' +'GBLPOSITIONAT' + todaydate + '181948' +custnum +'.csv' ##GBLPOSITIONAT20140625181948C132482 tradelist = rputiles.CsvToLines(tradefile) ##todays trades ##today SOD position = yesterday EOD ##today EOD position ##mark all positions of SOD today to nightly close prices = position pnl ##tradelist.today is marked against today.EOD prices = tradepnl ## ##create a dictionary of closing prices ##one for tradepnl and one for positionpnl ##check if SOD == EOD position g =[] bla =[] alllines = [['sym','pnl','trdp','clp','qty','bysell','usym','tdate','spareflag']] for line in rputiles.CsvToLines(GSposfile):
fnew = f.replace('xls','csv') ## if fnew in glob.glob(dlTS +'*Alloca*.xls') rputiles.convertXLStoCSV(f) fnew = f.replace('xls','csv') if 'Potentials' in f: ftag = 'Potentials' elif 'Allocations' in f: ftag = 'Allocations' elif 'Executions' in f: ftag = 'Executions' elif 'Exposure' in f: ftag = 'Exposure' else: ftag = 'need' lines = rputiles.CsvToLines(fnew) for l in lines: print ftag, l[1] if ftag == 'Exposure': print l for l in lines: for s in rnrStocklist: if s in str(l): print ' >>>>>>>>>>>>>>>>ATTENTION!!!! ',ftag, l[1]
path = os.getcwd() + '/' blapath = path.replace('EXE', '|') print blapath.split('|')[1] rootpath = ((path.replace('EXE', '|')).split('|'))[0] localtagSLASH = localtag + '/' EXEnoslash = rootpath + 'EXE' + localtag sys.path[0:0] = [EXEnoslash] import HVARs, rputiles ################################ EXE = EXEnoslash + '/' DATA = rootpath + 'DATA' + localtagSLASH TMP = rootpath + 'TMP' + localtagSLASH ########################################## acctfile = 'C:/users/bob/Google Drive/EXE_RNR/20140526.sf.Accounts.csv' acctfile = 'C:/users/bob/Google Drive/EXE_RNR/20140526.sf.Assets.csv' lines = rputiles.CsvToLines(acctfile) co = 0 for line in lines: if '00120000000AxdYAAS' in line: co += 1 if co < 3: print co c = 0 clen = len(line) while c < clen: print line[c] c += 1 ## print line ## ##
import rputiles import glob, csv, subprocess, datetime, shutil, subprocess ##import time, urllib2, urllib, requests ################################ EXE = EXEnoslash + '/' DATA = rootpath + 'DATA' + localtagSLASH TMP = rootpath + 'TMP' + localtagSLASH GS = DATA + 'GS/' ########################################### outputarea = TMP ####################################### fname = DATA + 'etfs.sorted.txt' tradefile = GS + 'GBLACTIVITY20140619090047C132482.csv' patternINheader = 'Account Number' trades = rputiles.CsvToLines(tradefile) stktrades = [] count = 0 for trade in trades: count += 1 if count == 1: header = trade print header stktrades.append(trade) ## print trade if 'P1Q' in trade: print trade stktrades.append(trade) fnameout = TMP + 'stocktrades.csv' rputiles.WriteArrayToCsvfile(fnameout, stktrades)