analyzer icon indicating copy to clipboard operation
analyzer copied to clipboard

Trading center missing validator

Open llazzaro opened this issue 10 years ago • 0 comments

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)

llazzaro avatar May 08 '15 05:05 llazzaro