Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions plugins/Trading212/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"steps": [
{
"displayName": "Authenticate",
"dataStream": { "name": "accountSummary" },
"required": true,
"error": "Could not authenticate. Check your API key, API secret and environment (Live/Demo) are correct and that the key hasn't been revoked.",
"success": "Connected successfully."
}
]
}
23 changes: 23 additions & 0 deletions plugins/Trading212/v1/custom_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"name": "Trading212 Account",
"sourceType": "Trading212 Account",
"icon": "wallet",
"singular": "Account",
"plural": "Accounts"
},
{
"name": "Trading212 Position",
"sourceType": "Trading212 Position",
"icon": "chart-line",
"singular": "Position",
"plural": "Positions"
},
{
"name": "Trading212 Pie",
"sourceType": "Trading212 Pie",
"icon": "chart-pie",
"singular": "Pie",
"plural": "Pies"
}
]
79 changes: 79 additions & 0 deletions plugins/Trading212/v1/dataStreams/accountSummary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "accountSummary",
"displayName": "Account Summary",
"description": "Cash balance, invested value and total account value",
"tags": ["Account"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "equity/account/summary",
"expandInnerObjects": true,
"paging": { "mode": "none" },
"getArgs": [],
"headers": []
},
"matches": "none",
"metadata": [
{
"name": "id",
"displayName": "Account ID",
"shape": "string",
"visible": false
},
{
"name": "currency",
"displayName": "Currency",
"shape": "string"
},
{
"name": "accountName",
"displayName": "Name",
"computed": true,
"valueExpression": "{{ 'Trading 212 (' + $['currency'] + ')' }}",
"shape": "string",
"role": "label"
},
{
"name": "totalValue",
"displayName": "Total Value",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }],
"role": "value"
},
{
"name": "cash.availableToTrade",
"displayName": "Cash Available",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
},
{
"name": "cash.reservedForOrders",
"displayName": "Cash Reserved for Orders",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
},
{
"name": "cash.inPies",
"displayName": "Cash in Pies",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
},
{
"name": "investments.currentValue",
"displayName": "Invested Value",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
},
{
"name": "investments.totalCost",
"displayName": "Total Cost",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
},
{
"name": "investments.realizedProfitLoss",
"displayName": "Realized P/L",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
},
{
"name": "investments.unrealizedProfitLoss",
"displayName": "Unrealized P/L",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
}
],
"timeframes": false
}
74 changes: 74 additions & 0 deletions plugins/Trading212/v1/dataStreams/dividendHistory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"name": "dividendHistory",
"displayName": "Dividend History",
"description": "Most recent dividend payments paid out to your account, one row per payment",
"tags": ["Dividends"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "equity/history/dividends",
"paging": { "mode": "none" },
"getArgs": [{ "key": "limit", "value": "50" }],
"headers": [],
"postRequestScript": "dividendHistory.js"
},
"matches": "none",
"ui": [
{
"type": "objects",
"name": "position",
"label": "Position (optional)",
"matches": {
"sourceType": { "type": "oneOf", "values": ["Trading212 Position"] }
}
}
],
"metadata": [
{
"name": "ticker",
"displayName": "Ticker",
"shape": "string",
"visible": false
},
{
"name": "instrumentName",
"displayName": "Instrument",
"shape": "string",
"role": "label"
},
{
"name": "amount",
"displayName": "Amount",
"shape": ["number", { "decimalPlaces": 2 }],
"role": "value"
},
{
"name": "grossAmountPerShare",
"displayName": "Gross Amount Per Share",
"shape": ["number", { "decimalPlaces": 4 }]
},
{
"name": "quantity",
"displayName": "Quantity",
"shape": ["number", { "decimalPlaces": 4 }]
},
{
"name": "type",
"displayName": "Type",
"shape": "string"
},
{
"name": "paidOn",
"displayName": "Paid On",
"shape": "date",
"role": "timestamp"
},
{
"name": "reference",
"displayName": "Reference",
"shape": "string",
"visible": false
}
],
"timeframes": false
}
179 changes: 179 additions & 0 deletions plugins/Trading212/v1/dataStreams/orderHistory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"name": "orderHistory",
"displayName": "Order History",
"description": "Most recent completed and cancelled equity orders, one row per order",
"tags": ["Orders"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "equity/history/orders",
"paging": { "mode": "none" },
"getArgs": [{ "key": "limit", "value": "50" }],
"headers": [],
"postRequestScript": "orderHistory.js"
},
"matches": "none",
"ui": [
{
"type": "objects",
"name": "position",
"label": "Position (optional)",
"matches": {
"sourceType": { "type": "oneOf", "values": ["Trading212 Position"] }
}
}
],
"metadata": [
{
"name": "id",
"displayName": "Order ID",
"shape": ["number", { "decimalPlaces": 0 }],
"role": "id",
"visible": false
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
{
"name": "ticker",
"displayName": "Ticker",
"shape": "string",
"visible": false
},
{
"name": "name",
"displayName": "Instrument",
"shape": "string",
"role": "label"
},
{
"name": "isin",
"displayName": "ISIN",
"shape": "string",
"visible": false
},
{
"name": "instrumentCurrency",
"displayName": "Instrument Currency",
"shape": "string",
"visible": false
},
{
"name": "type",
"displayName": "Order Type",
"shape": "string"
},
{
"name": "strategy",
"displayName": "Strategy",
"shape": "string",
"visible": false
},
{
"name": "side",
"displayName": "Side",
"shape": "string"
},
{
"name": "status",
"displayName": "Status",
"shape": "string"
},
{
"name": "orderedQuantity",
"displayName": "Ordered Quantity",
"shape": ["number", { "decimalPlaces": 4 }],
"visible": false
},
{
"name": "filledQuantity",
"displayName": "Filled Quantity",
"shape": ["number", { "decimalPlaces": 4 }]
},
{
"name": "orderedValue",
"displayName": "Ordered Value",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }],
"visible": false
},
{
"name": "filledValue",
"displayName": "Filled Value",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }],
"role": "value"
},
{
"name": "fillPrice",
"displayName": "Fill Price",
"shape": ["number", { "decimalPlaces": 2 }]
},
{
"name": "limitPrice",
"displayName": "Limit Price",
"shape": ["number", { "decimalPlaces": 2 }],
"visible": false
},
{
"name": "stopPrice",
"displayName": "Stop Price",
"shape": ["number", { "decimalPlaces": 2 }],
"visible": false
},
{
"name": "accountCurrency",
"displayName": "Account Currency",
"shape": "string",
"visible": false
},
{
"name": "realisedProfitLoss",
"displayName": "Realised P/L",
"shape": ["number", { "decimalPlaces": 2, "thousandsSeparator": true }]
},
{
"name": "fees",
"displayName": "Taxes",
"shape": ["number", { "decimalPlaces": 2 }],
"visible": false
},
{
"name": "fxRate",
"displayName": "FX Rate",
"shape": ["number", { "decimalPlaces": 4 }],
"visible": false
},
{
"name": "tradingMethod",
"displayName": "Trading Method",
"shape": "string",
"visible": false
},
{
"name": "extendedHours",
"displayName": "Extended Hours",
"shape": "boolean",
"visible": false
},
{
"name": "initiatedFrom",
"displayName": "Initiated From",
"shape": "string",
"visible": false
},
{
"name": "dateCreated",
"displayName": "Created",
"shape": "date",
"visible": false
},
{
"name": "dateExecuted",
"displayName": "Executed",
"shape": "date",
"role": "timestamp"
},
{
"sourceId": "ticker",
"sourceType": "Trading212 Position",
"name": "name"
}
],
"timeframes": false
}
Loading
Loading