@@ -170,13 +170,31 @@ def depth(self, marketid):
170170 ##
171171 # Outputs:
172172 # orderid If successful, the Order ID for the order which was created
173- def create_order (self , marketid , ordertype , quantity , price ):
173+ def _create_order (self , marketid , ordertype , quantity , price ):
174+ """ Creates an order for buying or selling coins.
175+
176+ It is preferable to buy and sell coins using the Api.buy and Api.sell
177+ methods.
178+
179+ :param marketid: Market to buy from.
180+ :param ordertype: Either Buy or Sell.
181+ :param quantity: Number of coins to buy.
182+ :param price: At this price.
183+ """
174184 return self ._api_query ('createorder' ,
175185 request_data = {'marketid' : marketid ,
176186 'ordertype' : ordertype ,
177187 'quantity' : quantity ,
178188 'price' : price })
179189
190+ def buy (self , marketid , quantity , price ):
191+ """ Buy a specified number of coins on the given market. """
192+ return self ._create_order (marketid , 'Buy' , quantity , price )
193+
194+ def sell (self , marketid , quantity , price ):
195+ """ Sell a specified number of coins on the given market. """
196+ return self ._create_order (marketid , 'Sell' , quantity , price )
197+
180198 # Inputs:
181199 # orderid Order ID for which you would like to cancel
182200 ##
0 commit comments