Coinbase Pro | Place Orders

In order to place new orders in Coinbase, you require first your APIs to access your private data, check the following article How Use Private REST API.

 

Once you have configured your API keys, you can start to place orders

Market Order

Place a new Market Order, buy 0.002 contracts of BTC-USD


oCoinbase := TsgcWSAPI_Coinbase.Create(nil);
oCoinbase.Coinbase.ApiKey := 'your api key';
oCoinbase.Coinbase.ApiSecret := 'your api secret';
oCoinbase.Coinbase.ApiPassphrase := 'your passphrase';
ShowMessage(oCoinbase.REST_API.PlaceMarketOrder(coisBuy, 'BTC-USD', 0.002, 0));

Limit Order

Place a new Limit Order, buy 0.002 contracts of BTC-USD at price limit of 10000


oCoinbase := TsgcWSAPI_Coinbase.Create(nil);
oCoinbase.Coinbase.ApiKey := 'your api key';
oCoinbase.Coinbase.ApiSecret := 'your api secret';
oCoinbase.Coinbase.ApiPassphrase := 'your passphrase';
ShowMessage(oCoinbase.REST_API.PlaceLimitOrder(coisBuy, 'BTC-USD', 0.002, 0, 10000));