analyzer
analyzer copied to clipboard
Trading center missing validator
It was removed and moved to pystock however this one is required on the trading center.
if order.symbol in self.__lastTickDict:
closePrice = self.__lastTickDict[order.symbol].close
if Action.SELL == order.action and Type.STOP == order.type and order.price > closePrice:
msg = "Sell stop order price %s shouldn't be higher than market price %s" % (order.price, closePrice)
elif Action.BUY_TO_COVER == order.action and Type.STOP == order.type and order.price < closePrice:
msg = "Buy to cover stop order price %s shouldn't be higher than market price %s" % (order.price, closePrice)