(self, session, side, qty, price)
return  qty
This function returns qty that are available for execution
This function returns qty that are available for execution
This function returns qty that are available for execution
def get_available_qty_to_execute(self, session, side, qty, price):
    """This function returns qty that are available for execution"""
    balance_price =  Balance.get_balance(session, self.account_id, self.broker_id, self.symbol[3:])
    balance_qty   =  Balance.get_balance(session, self.account_id, self.broker_id, self.symbol[:3])

    if side == '1' : # buy
      qty_to_buy = min( qty, int((float(balance_price)/float(price)) * 1e8))
      return qty_to_buy
    elif side == '2': # Sell
      qty_to_sell = min( qty, balance_qty )
      return qty_to_sell
    return  qty
def get_available_qty_to_execute ( self , session , side , qty , price ) : balance_price = Balance . get_balance ( session , self . account_id , self . broker_id , self . symbol [ 3 : ] ) balance_qty = Balance . get_balance ( session , self . account_id , self . broker_id , self . symbol [ : 3 ] ) if side == '1' : # buy qty_to_buy = min ( qty , int ( ( float ( balance_price ) / float ( price ) ) * 1e8 ) ) return qty_to_buy elif side == '2' : # Sell qty_to_sell = min ( qty , balance_qty ) return qty_to_sell return qty