How to view the details of expenses and commissions on a brokerage account automatically, without manually reconciling brokerage reports.

Софт и программы для трейдинга

If you bought a stock and then sold it with a small plus, then do not rush to rejoice. This plus for a broker in the terminal can be a minus in your wallet. When trading on the stock (and any other) market, you should always remember about commissions and overhead costs for transactions. Over the years, it may seem to you that your trading is profitable, but the account grows much more slowly than expected. Let’s understand why this happens. If you take the Tinkoff Investments API documentation, you can find that a broker (any one) has at least 64 types of operations with your money. At the same time, half of them are about withholding commissions and taxes, and the rest are about the movement of funds.

Operation types

numberDescription
0The operation type is not defined.
1Replenishment of the brokerage account.
2Withholding personal income tax on coupons.
3Withdrawal of the Central Bank.
4Income from an overnight REPO transaction.
5Withholding tax.
6Full redemption of bonds.
7Sale of securities from the card.
8Withholding tax on dividends.
9Withdrawal of funds.
10Partial redemption of bonds.
elevenTax adjustment.
12Withholding commission for servicing a brokerage account.
13Withholding tax for material gain.
14Withholding commission for an uncovered position.
15Buying a Central Bank.
16Buying a Central Bank with a card.
17Transfer of securities from another depository.
18Sale as a result of Margin-call.
19Withholding transaction fees.
20Purchase as a result of Margin-call.
21Dividend payment.
22Sale of securities.
23Coupon payout.
24Withholding SuccessFee commission.
25Transfer of dividend income.
26Calculation of variation margin.
27Write-off of variation margin.
28Purchase within the expiration of a futures contract.
29Продажа в рамках экспирации фьючерсного контракта.
30Комиссия за управление по счёту автоследования.
31Комиссия за результат по счёту автоследования.
32Удержание налога по ставке 15%.
33Удержание налога по купонам по ставке 15%.
34Удержание налога по дивидендам по ставке 15%.
35Удержание налога за материальную выгоду по ставке 15%.
36Корректировка налога по ставке 15%.
37Удержание налога за возмещение по сделкам РЕПО по ставке 15%.
38Удержание налога за возмещение по сделкам РЕПО.
39Удержание налога по сделкам РЕПО.
40Возврат налога по сделкам РЕПО.
41Удержание налога по сделкам РЕПО по ставке 15%.
42Возврат налога по сделкам РЕПО по ставке 15%.
43Выплата дивидендов на карту.
44Корректировка налога по купонам.
45Комиссия за валютный остаток.
46Комиссия за вывод валюты с брокерского счета.
47Гербовый сбор.
50SWIFT-перевод
51SWIFT-перевод
53Перевод на карту
54Перевод с карты
55Withdrawal fee
56Write-off of payment for the service of the Councils
57Transfer of securities from IIS to Brokerage account
58Transfer of securities from one brokerage account to another
59Withdrawal of funds from the account
60Replenishment of funds from the account
61Exchange overnight placement
62Commission write-off
63Income from overnight
64Expiration

  Expand table

Are you familiar with all these terms? Do you know that there is a certain “stamp duty”, when and how much taxes are withheld from you? And that when withdrawing money before the end of the financial year, you are taxed on all profits without taking into account losses? If you are not familiar with this, then you definitely need to figure it all out.

In the article you will learn the basics of how to see the real results of the account with all the details of all operations.

Three approaches to deal analysis

  1. Intuitive online
  2. Manual after the fact
  3. Auto

Intuitive

If you trade looking only at the brokerage terminal, then many details will elude your eyes. Firstly, it is not profitable for brokers to advertise how much commission you will pay on a particular transaction. For example, in the Finam terminal there is nothing about commission when making transactions. In the Tinkoff terminal, until recently, even on futures, they wrote the size of the commission before buying. But when preparing the article, I discovered that they began to hide it behind streamlined formulations.

These nuances are well described here: What Tinkoff Investments is not saying.

 


How to view the details of expenses and commissions on a brokerage account automatically, without manually reconciling brokerage reports.

Figure 1. Buying stocks (left) and futures (right).

Take a look at two screenshots of buying tools (Figure 1). On the first one, you see the amount of the transaction and the commission. On the second, you see some points and do not see the commission.  Second, once you’ve bought a stock, you’re already in the red. It would be correct to write in the terminal that your profitability of the operation is not zero, but immediately minus two commissions.  We understand on the fingers. In the first case (still the same picture 1) on a positive and good mood , you bought 150 lots . The stock went up 50 kopecks, by as much as +0.25% . You see on the deal +750 rubles Suddenly the weather turned bad, the clouds thickened , and you decided to sell everything. Some may think that they have +750 rublesincome. Others think that they have about zero, because minus the commission. But they are all wrong. The correct answer is that when closing a position, there will be a loss of 1000 rubles ( income, minus the commission for the purchase, minus the commission for the sale ).  Now let’s look at the screenshot on the right, it’s even more interesting there.  In this example, the commission for the purchase of a lot is 400 rubles. Accordingly, when buying three lots, you have minus 1200 rubles. And the sale will pay about the same. In total, you have minus 2400 rubles, although the course has not even moved yet. 

For you to break even on this trade, the price of one lot must rise by 800 rubles. One percent. It’s decent. That is, with an increase of 1%, your profitability is not +1% , but ZERO !

The example, of course, is almost synthetic, because the most expensive tariff is taken – the investor one. We save on the monthly fee, we get horse commissions for trading. Imagine the situation, you stop at a gas station with the condition that if you do not buy a hot dog and tea from them, then you pay ten times more for gasoline. Would you pay x10 prices for a liter of gasoline, or would you buy a hot dog and fill up at the best price?  That’s it, everything needs to be considered and compared. And a novice investor does not take these factors into account on small numbers: it somehow doesn’t matter, a ruble there, a ruble here. That’s how we live. How to decide? Either calculate manually, or use a trading robot that will calculate the profitability of the portfolio and sell at a pre-calculated profit or stop.  


How to view the details of expenses and commissions on a brokerage account automatically, without manually reconciling brokerage reports.
 

Manual after the fact

Let’s go further, you have been trading for some time and want to know the real profitability of your trade, and not these numbers in the terminal. Now it will be a little more difficult, but much more rewarding. There are three ways to track your transaction history manually

  1. In the broker’s terminal. We immediately dismiss this option for low information content.
  2. Recording your trades in Excel. This is for those who have a lot of free time or make one purchase-sale per week.
  3. Downloading reports and mixing manually (or using services).

There are six types of reports available for download in Tinkoff Investments

  1. tax report
  2. Broker Report
  3. Depository report
  4. Information about the value of assets
  5. Certificate of income outside the Russian Federation
  6. Tax Form 1042-S (Certificate confirming the payment of dividends and coupons on securities of US companies, as well as the amount of tax paid) 

And all of them have their own nuances. And you can’t get a statement for the date range you need in one go. For example, to get a brokerage report for a year, you need to download 12 reports for each month, and then bring them together.
How to view the details of expenses and commissions on a brokerage account automatically, without manually reconciling brokerage reports.Just don’t feed me bread, let me sort through these tables, right? It is much more fun to trade by clicking on a couple of buttons in the terminal. In turn, services that provide supposedly automation usually begin with the fact that you manually download these reports and then upload them manually as well. Excellent automation, I want to tell you.  And now we are smoothly moving to an automatic way of counting these reports. Fortunately, competitive brokers have a convenient API and various goodies for this.

Auto

We will analyze using the example of Tinkoff investments and their API. There are three types of requests for receiving reports: 

The first two are super accurate, in them the paid commission is even broken down to whom it took (commission of a broker, exchange and clearing center). The data in these reports are built after they are processed by all bidders in the T-3 mode. But while they are super cool and accurate, at the moment they are also slow and problematic. Without going into details, I will leave only links. In short, the first bug report was in early January, but it continues to not work https://github.com/Tinkoff/investAPI/issues/341 https://github.com/Tinkoff/investAPI/issues/367 https: //github.com/Tinkoff/investAPI/issues/370  But we don’t hold a grudge against them for this, because we understand that one and a half people use these functions, they somehow work. At the same time, there are now much more important cases about sanctions and so on. Therefore, we turn to the third option. Request for GetOperationsByCursor operations . This method is not the most accurate, the details of transactions may change before being finalized in the brokerage report. But this method is as fast as possible for general cognitive purposes. I used it to create a service for calculating financial flows on a brokerage account.   


How to view the details of expenses and commissions on a brokerage account automatically, without manually reconciling brokerage reports.
  And the first thing you can see in the service. The same flowing financial flows. The trader thought that he had traded +66 thousand, but in fact it was three times less. You just shouldn’t have traded with a loss, you should have traded with a plus! =) And if I also made fewer transactions, then I would save on the commission. Take a look for yourself. We log in to the service, enter the token from the broker’s API and get details on operations on the brokerage account. Fantastic! Below are the details of the transactions.  

How to view the details of expenses and commissions on a brokerage account automatically, without manually reconciling brokerage reports.
  There we see the same stamp duty. Explicit information in front of your eyes is a great opportunity to delve into what is happening and stimulates you to understand the operations of the exchange a little better.  If you have never calculated the profitability of investments, have not requested brokerage reports and have not summarized them in excel, then you should definitely take a look at this. Now it’s free and available in a couple of clicks, even on your phone. I use it myself and recommend it to you! =)

https://opexbot.info 

  If you liked the article and want more, then subscribe to my telegram channel .

Pavel
Rate author
Add a comment

  1. Валерий

    Статья познавательная особенно на примере банка Тиньков, спасибо!

    Reply