-
Notifications
You must be signed in to change notification settings - Fork 5
Add Trading212 plugin #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ryanwelan
wants to merge
3
commits into
main
Choose a base branch
from
work/rw/trading212-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,111
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| }, | ||
| { | ||
| "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 | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.