Importing Positions Data

Try get Positions on a Date

Go to /explorer/workflows/com/finmars/exante-broker/get-positions/test.ipynb

Its a test Jupyter python script that allows you to check if you able to fetch Positions

Screenshot 2024-09-25 at 22.22.52.png

So you need to change your accounts variable on line 47, add your accountId e.g. ABC1234.001 it will call API endpoint of https://api-live.exante.eu/api-docs/#tag/Account-summary-API/operation/getAccountSummaryWithoutDate


So your output will be something like

{
  "currencies": [
    {
      "code": "USD",
      "convertedValue": "55175.23",
      "value": "55175.23"
    }
  ],
  "timestamp": 1727295675000,
  "freeMoney": "55175.22",
  "netAssetValue": "970467.92",
  "marginUtilization": "0.7443",
  "positions": [
    {
      "convertedPnl": "-54410.19",
      "symbolId": "CIFR.NASDAQ",
      "convertedValue": "778292.7",
      "price": "2.925",
      "accruedInterest": null,
      "symbolType": "STOCK",
      "value": "778292.7",
      "quantity": "91724.0",
      "pnl": "-34410.19",
      "currency": "USD",
      "averagePrice": "4.5182"
    }
  ],
  "sessionDate": "2024-09-20",
  "currency": "USD",
  "accountId": "ABC1234.001",
  "moneyUsedForMargin": "568292.7"
}


Finmars will store this outputs in Explorer, so after it will be processed by Exante Transformer, to make it compatible with Finmars Standard Configuration

Download Positions to Finmars

Go to Workflow Page

Screenshot 2024-09-25 at 23.33.43.png

Run following workflow: com.finmars.exante-broker:get-positions

Pass payload like:


{
    "secret": "finmars/exante",
    "date_from": "2024-09-01",
    "date_to": "2024-09-24",
    "currencies": ["USD"],
    "portfolios": ["ABCD123.001"]
}



Screenshot 2024-09-25 at 23.35.27.png

Go to see status of your workflow

Screenshot 2024-09-25 at 23.36.14.png

Seems all the requests are done!

Go to  explorer/data/exante/positions/ABCD123.001/ and you shall able to see downloaded files as .json

Screenshot 2024-09-25 at 23.38.47.png

That data can be later passed to Exante Data Transformer, to make it compatible with Finmars Standard Configuration

Transform Positions to Standard Configuration

Precondition: You downloaded some Positions from Exante (Check your /explorer/data/exante/positions folder)

Go to Worfklow Page

Screenshot 2024-09-26 at 00.58.55.png

Run Task  com.finmars.exante-data-transformer:transform-positions

{
    "date_from": "2024-09-01",
    "date_to": "2024-09-27",
    "portfolios": ["ABCD123.001"]
}


Screenshot 2024-09-27 at 10.32.01.png



Go to see you Task Status

Screenshot 2024-09-26 at 01.00.59.png

So all your download Position files from Exante should be packed into one .json file that converted to Standard Configuration

You shall able to see it in 

/explorer/data/general/positions

data/general - is a folder where data accumulates from all the sources, we keep transformed data there

Screenshot 2024-09-26 at 01.02.52.png

Great, so this file will be dispatched to Standard Import (see schema com.finmars.standard-import-from-file:pos_daily)  STD - POS DAILY

P.S. Before we able to import Positions, we must ensure that all Instruments/Currencies already present in Space. So after it, you free to import file either manually or via Standard AutoImport Schedule

Import Daily Positions to Finmars

Preconditions: You parsed instruments from positions file and Imported Instruments to Finmars
Warning: Without Instruments/Currencies this step will lead to error

Go to Workflow Page

Screenshot 2024-09-27 at 10.10.42.png

Look for com.finmars.standard-workflow:simple-autoimport 

Lets execute it (You can find files to import in /explorer/data/general/positions)

Screenshot 2024-09-27 at 10.18.51.png


Go to see Task Status

Screenshot 2024-09-27 at 10.19.19.png

Great success! Lets check our transactions


Screenshot 2024-09-27 at 21.17.08.png

Your Daily Positions successfully imported into Finmars

P.S. Some issues with Standard Import Schema Daily Positions, please provide feedback