Order creator
Last updated
Last updated
[sdks/ccxt/private/Order creator]
Places a new order. More: https://docs.ccxt.com/en/latest/manual.html#placing-orders Example:
Received via exchange
:
{<br>
"id": "coinbasepro",<br>
"credentials": {<br>
"apiKey": "API_KEY",<br>
"secret": "SECRET",<br>
"password": "PASSWORD"<br>
},<br>
"sandboxMode": true<br>
}<br>
@0 <br>
```<br>
2. Received via `parameters`:<br>
```<br>
{ <br>
"symbol": "BTC/USD",<br>
"type": "limit", <br>
"side" : "buy", <br>
"amount": 1, <br>
"price": 100<br>
}@0 <br>
```<br>
3. Sent via `data`:<br>
```<br>
{<br>
"id": "4bba5198-9aac-4e3e-8e07-8c200daad567",<br>
"info": {<br>
"id": "4bba5198-9aac-4e3e-8e07-8c200daad567",<br>
"price": "100",<br>
"size": "1",<br>
"product_id": "BTC-USD",<br>
"side": "buy",<br>
"stp": "dc",<br>
"type": "limit",<br>
"time_in_force": "GTC",<br>
"post_only": false,<br>
"created_at": "2022-08-08T09:30:41.37098Z",<br>
"fill_fees": "0",<br>
"filled_size": "0",<br>
"executed_value": "0",<br>
"status": "pending",<br>
"settled": false<br>
},<br>
"timestamp": 1659951041370,<br>
"datetime": "2022-08-08T09:30:41.370Z",<br>
"status": "open",<br>
"symbol": "BTC/USD",<br>
"type": "limit",<br>
"timeInForce": "GTC",<br>
"postOnly": false,<br>
"side": "buy",<br>
"price": 100,<br>
"cost": 0,<br>
"amount": 1,<br>
"filled": 0,<br>
"remaining": 1,<br>
"fee": {<br>
"cost": 0,<br>
"currency": "USD"<br>
},<br>
"trades": [],<br>
"fees": [<br>
{<br>
"cost": 0,<br>
"currency": "USD"<br>
}<br>
]<br>
}@0<br>
```<br>
---
### Input ports
* __exchange__:
```
{
"id": string,
optional "credentials": {
"apiKey": string,
"secret": string,
optional "uid": string,
optional "password": string
},
optional "sandboxMode": boolean
}
```
Received the exchange to be used.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/exchange-markets.html<br>
<br>
Example:<br>
```<br>
{<br>
"id": "coinbasepro",<br>
"credentials": {<br>
"apiKey": "API_KEY",<br>
"secret": "SECRET",<br>
"password": "PASSWORD"<br>
},<br>
"sandboxMode": true<br>
}<br>
```<br>
* __parameters__:
```
{
"symbol": string,
"type": ("limit" or "market"),
"side": ("buy" or "sell"),
"amount": number,
optional "price": number,
optional "params": {string: any}
}
```
Received the order parameters to be placed.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/manual.html#placing-orders<br>
<br>
Example:<br>
```<br>
{ <br>
"symbol": "BTC/USD",<br>
"type": "limit", <br>
"side" : "buy", <br>
"amount": 1, <br>
"price": 100<br>
}<br>
```<br>
### Output ports
* __data__:
```
{
"id": string,
optional "clientOrderId": string,
optional "datetime": string,
optional "timestamp": number,
optional "lastTradeTimestamp": number,
"status": ("open" or "closed" or "canceled" or "expired" or "rejected"),
"symbol": string,
"type": ("market" or "limit"),
"timeInForce": ("GTC" or "IOC" or "FOK" or "PO"),
"side": ("buy" or "sell"),
optional "price": number,
optional "average": number,
optional "amount": number,
"filled": number,
optional "remaining": number,
"cost": number,
"trades": any[],
optional "fee": {"currency": string, "cost": number, "rate": number},
"info": any
}
```
Sends information about the placed order.<br>
<br>
More:<br>
https://docs.ccxt.com/en/latest/manual.html#order-structure<br>
<br>
Example:<br>
```<br>
{<br>
"id": "4bba5198-9aac-4e3e-8e07-8c200daad567",<br>
"info": {<br>
"id": "4bba5198-9aac-4e3e-8e07-8c200daad567",<br>
"price": "100",<br>
"size": "1",<br>
"product_id": "BTC-USD",<br>
"side": "buy",<br>
"stp": "dc",<br>
"type": "limit",<br>
"time_in_force": "GTC",<br>
"post_only": false,<br>
"created_at": "2022-08-08T09:30:41.37098Z",<br>
"fill_fees": "0",<br>
"filled_size": "0",<br>
"executed_value": "0",<br>
"status": "pending",<br>
"settled": false<br>
},<br>
"timestamp": 1659951041370,<br>
"datetime": "2022-08-08T09:30:41.370Z",<br>
"status": "open",<br>
"symbol": "BTC/USD",<br>
"type": "limit",<br>
"timeInForce": "GTC",<br>
"postOnly": false,<br>
"side": "buy",<br>
"price": 100,<br>
"cost": 0,<br>
"amount": 1,<br>
"filled": 0,<br>
"remaining": 1,<br>
"fee": {<br>
"cost": 0,<br>
"currency": "USD"<br>
},<br>
"trades": [],<br>
"fees": [<br>
{<br>
"cost": 0,<br>
"currency": "USD"<br>
}<br>
]<br>
}<br>
```<br>
<br>
* __error__: ` {"error": string, optional "details": any} `