Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Trading center missing validator #7

@llazzaro

Description

@llazzaro

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions