hyu2707 / goquantdata

python based trading engine for equities and cryptocurrency
1 stars 3 forks source link

[P2] create place_order in algo #41

Closed hyu2707 closed 3 years ago

hyu2707 commented 4 years ago

move those code into infra

    def __place_order(self,orders, symbol, quantity):

        if quantity > 0:
            orders.append(GQOrder(symbol=symbol, qty=abs(quantity), side='buy'))

        if quantity < 0:
            orders.append(GQOrder(symbol=symbol, qty=abs(quantity), side='sell'))
        return orders