I am trying to see why this algorithm does not work. This is a snippet:
if(maxVal >= 1 and minVal <= -1):
stockLong = str(stockList[maxPos])
stockShort = str(stockList[minPos])
order_target_percent(stockLong, 0.5)
order_target_percent(stockShort, -0.5)
elif (maxVal >= 1):
stock = stockList[maxPos]
stock = str(stock)
order_percent(stock, 1)
elif (minVal <= 0):
stock = stockList[minPos]
stock = str(stock)
order_target_percent(stock, -1)
Some notes about the code:
stockList is a list of symbols from data. I added elements to stockList using stock.symbol for stock in data.
It seems as if each element of stockList is in unicode.
Any suggestions?