# NEED :20 weg doen
for i in range(len(stockList[:20])):

    if i % 500 == 0:
        print i

    name = stockList[i][1]
    ticker = stockList[i][0]
    market = stockList[i][2]

    dbInt.addStock(name, ticker)

    # markt in category steken
    # TODO inefficient, beter overloaden zodat je ook stockid kan meegeven
    dbInt.addStockToCategory(ticker, "market", market)

# methods
dbInt.addMethod("method1", "MACD only buy param1: threshold param2: duration")
dbInt.addMethod("methodGoogleTrends", "google trends uit paper params?")

# strategies
dbInt.addStrategy("MACD 3 6", "method1", "3 6")
dbInt.addStrategy("Google trends 0 5", "methodGoogleTrends", "0 5")

# data update scripts
dbInt.addDataSource("standardUpdate.py", "standard yahoo data")

endTime = time.time()
elapsedTime = (endTime - startTime)
print "total running time: " + str(elapsedTime) + " seconds"
dbObject.addUser("nero","$2a$12$/MugNnVIjdLd1TnshSyK2eXp.jM3lGM1GipTdFNTuwTHvFimPgCbu")
dbObject.addUser("michiel","$2a$12$/MugNnVIjdLd1TnshSyK2eXp.jM3lGM1GipTdFNTuwTHvFimPgCbu")
dbObject.addUser("baerto","$2a$12$/MugNnVIjdLd1TnshSyK2eXp.jM3lGM1GipTdFNTuwTHvFimPgCbu")

# stocks
dbObject.addStock("apple","AAPL","Nasdaq")
dbObject.addStock("oak","OAK","Euronext")

# stockCategory
dbObject.addStockToCategory("OAK","locatie","lieven zijn bureau")
dbObject.addStockToCategory("AAPL","locatie","amerika")

# methods
dbObject.addMethod("fundamentalist","geen argumenten jongeuh")
dbObject.addMethod("indexvolger","geef als string de index mee die je wil volgen")

# strategies

dbObject.addStrategy("fundamentAgressief","fundamentalist","")
dbObject.addStrategy("bel20volger","indexvolger","bel20")

# add data sources
dbObject.addDataSource("yahoo.py","prices of all stocks")
dbObject.addDataSource("wikipedia.py","number of views")

# simulation

# INSERT INTO simulation(name,description,owner,strategy,totalGain,totalReturn,status,progress) VALUES('denaam','descip0','1','1','3','4','running','40');

print 'Done'
from DatabaseInteraction import DatabaseInteraction

dbInt = DatabaseInteraction('backtest_real')
dbInt.addMethod("methodTA1","MACD, Aroon, OBV and RSI combined")
dbInt.addStrategy("Technical Analysis 1","methodTA1",[6,3])