<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def createTrailingStopOrder(self, contract, quantity, parentId=0, trailPercent=100., group=None, triggerPrice=None, account=None):
 """ convert hard stop order to trailing stop order """

        if parentId not in self.orders:
            raise ValueError("Order #" + str(parentId) + " doesn't exist or wasn't submitted")

        order = self.createStopOrder(quantity,
                    stop     = trailPercent,
                    transmit = True,
                    trail    = True,
                    # ocaGroup = group
                    parentId = parentId,
                    account  = account
                )

        self.requestOrderIds()
        return self.placeOrder(contract, order, self.orderId + 1)