Esempio n. 1
0
from algotrader.workers import RateProcessor
from algotrader.database import database
from datetime import datetime

if __name__ == "__main__":
    database.removeRates()
    x = datetime.strptime("2010-01-01", "%Y-%m-%d")
    y = datetime.today()

    symbols = database.getSymbols()
    symbols.sort(key=lambda x: x["symbol"], reverse=False)
    for item in symbols:
        symbol = item["symbol"]
        rateProcessor = RateProcessor(symbol, x, y, "d")
        rateProcessor.saveRates()

    print "FINISHED LOADING RATES"
Esempio n. 2
0
 def loadSymbols(self):
     self.symbols = []
     data = database.getSymbols()
     for item in data:
         self.symbols.append(item["symbol"])
     self.symbols.sort()