def load(self, fn): infile = itrade_csv.read( None, os.path.join(itrade_config.dirUserData, '%s.matrix.txt' % fn)) if infile: # scan each line to read each quote for eachLine in infile: item = itrade_csv.parse(eachLine, 1) if item: if len(item) > 4: #print 'addKey:new fmt: %s : %s : %s : %s '% (item[0],item[2],item[3],item[5]) ref = None # be sure the market is loaded quotes.loadMarket(item[3]) if item[0] == '': quote = quotes.lookupTicker(ticker=item[2], market=item[3], place=item[5]) if quote: ref = quote.key() if not ref: ref = quote_reference(isin=item[0], ticker=item[2], market=item[3], place=item[5]) if not self.addKey(ref): print 'load (new format): %s/%s : quote not found in quotes list ! (ref=%s)' % ( item[0], item[2], ref) elif len(item) <= 4: print 'old matrix format : not supported anymore'
def load(self,fn): infile = itrade_csv.read(None,os.path.join(itrade_config.dirUserData,'%s.matrix.txt' % fn)) if infile: # scan each line to read each quote for eachLine in infile: item = itrade_csv.parse(eachLine,1) if item: if len(item)>4: #print 'addKey:new fmt: %s : %s : %s : %s '% (item[0],item[2],item[3],item[5]) ref = None # be sure the market is loaded quotes.loadMarket(item[3]) if item[0]=='': quote = quotes.lookupTicker(ticker=item[2],market=item[3],place=item[5]) if quote: ref = quote.key() if not ref: ref = quote_reference(isin=item[0],ticker=item[2],market=item[3],place=item[5]) if not self.addKey(ref): print 'load (new format): %s/%s : quote not found in quotes list ! (ref=%s)' % (item[0],item[2],ref) elif len(item)<=4: print 'old matrix format : not supported anymore'
# ============================================================================ if __name__ == '__main__': setLevel(logging.INFO) # load extensions import itrade_ext itrade_ext.loadExtensions(itrade_config.fileExtData, itrade_config.dirExtData) from itrade_quotes import quotes, initQuotesModule initQuotesModule() quotes.loadMarket('EURONEXT') quotes.loadMarket('NASDAQ') quote = quotes.lookupTicker('AAPL', 'NASDAQ') info('test1 %s' % quote) quote = quotes.lookupTicker('OSI', 'EURONEXT') info('test2 %s' % quote) trades = Trades(quote) trades.load('import/Cortal-2005-01-07.txt') trades.load('import/Cortal-2005-01-14.txt') trades.load('import/Cortal-2005-01-21.txt') info('test3 %s' % trades.trade(date(2005, 01, 04))) # ============================================================================ # That's all folks ! # ============================================================================
webbrowser.open(link) # ============================================================================ # Export me # ============================================================================ try: ignore(gNews) except NameError: gNews = News() # ============================================================================ # Test me # ============================================================================ if __name__=='__main__': setLevel(logging.INFO) class cb(object): pass gNews.setCallback(cb) from itrade_quotes import quotes quote = quotes.lookupTicker('RIB') print gNews.feedQuote(quote,'fr') # ============================================================================ # That's all folks ! # ============================================================================
try: ignore(gNewsGoogle) except NameError: gNewsGoogle = News_Google() # ============================================================================ # Test me # ============================================================================ if __name__=='__main__': setLevel(logging.INFO) from itrade_local import setLang setLang('fr') from itrade_quotes import quotes quote = quotes.lookupTicker('AAPL') print gNewsGoogle.feedQuote(quote) quote = quotes.lookupTicker('AXL') print gNewsGoogle.feedQuote(quote) print gNewsGoogle.feedQuote(quote,'fr') quote = quotes.lookupTicker('SAF') print gNewsGoogle.feedQuote(quote) # ============================================================================ # That's all folks ! # ============================================================================
self.m_bollM[i] = -1.0 self.m_bollUp[i] = -1.0 self.m_bollDn[i] = -1.0 # ============================================================================ # Test # ============================================================================ if __name__ == '__main__': setLevel(logging.INFO) from itrade_quotes import quotes quote = quotes.lookupTicket('AUSY', 'EURONEXT') info('test1 %s' % quote) quote = quotes.lookupTicker('AAPL', 'NASDAQ') info('test2 %s' % quote) trade = Trades(quote) trade.load('import/Cortal-2005-01-07.txt') trade.load('import/Cortal-2005-01-14.txt') trade.load('import/Cortal-2005-01-21.txt') info('test3 %s' % trade.trade('20050104')) # ============================================================================ # That's all folks ! # ============================================================================
self.m_quote = quote if lang==None: lang = self.m_quote.country() return self.feed(self.m_baseurl[page] % self.m_quote.ticker()) # ============================================================================ # Export me # ============================================================================ try: ignore(gNewsBoursorama) except NameError: gNewsBoursorama = News_Boursorama() # ============================================================================ # Test me # ============================================================================ if __name__=='__main__': setLevel(logging.INFO) from itrade_quotes import quotes quote = quotes.lookupTicker('RIB') print gNewsBoursorama.feedQuote(quote) gNewsBoursorama.goto(None,"http://www.boursorama.com/infos/imprimer_news.phtml?news=3020909") # ============================================================================ # That's all folks ! # ============================================================================
# Test # ============================================================================ if __name__=='__main__': setLevel(logging.INFO) # load extensions import itrade_ext itrade_ext.loadExtensions(itrade_config.fileExtData,itrade_config.dirExtData) from itrade_quotes import quotes, initQuotesModule initQuotesModule() quotes.loadMarket('EURONEXT') quotes.loadMarket('NASDAQ') quote = quotes.lookupTicker('AAPL','NASDAQ') info('test1 %s' % quote ) quote = quotes.lookupTicker('OSI','EURONEXT') info('test2 %s' % quote ) trades = Trades(quote) trades.load('import/Cortal-2005-01-07.txt') trades.load('import/Cortal-2005-01-14.txt') trades.load('import/Cortal-2005-01-21.txt') info('test3 %s' % trades.trade(date(2005,01,04))) # ============================================================================ # That's all folks ! # ============================================================================
else: self.m_bollM[i] = -1.0 self.m_bollUp[i] = -1.0 self.m_bollDn[i] = -1.0 # ============================================================================ # Test # ============================================================================ if __name__=='__main__': setLevel(logging.INFO) from itrade_quotes import quotes quote = quotes.lookupTicket('AUSY','EURONEXT'); info('test1 %s' % quote ); quote = quotes.lookupTicker('AAPL','NASDAQ'); info('test2 %s' % quote ); trade = Trades(quote) trade.load('import/Cortal-2005-01-07.txt') trade.load('import/Cortal-2005-01-14.txt') trade.load('import/Cortal-2005-01-21.txt') info('test3 %s' % trade.trade('20050104')); # ============================================================================ # That's all folks ! # ============================================================================