<b>New Concepts for the bot</b>
<i>A more meaningful decomposition of PNL</i>
==============================
Assume we have the following BUY / SELL orders (assume, for simplicity QTY = 1, zero comms and no multiplier, no closing costs). <b>
Prices $</b> (ordered by magnitude):
SELL
15
17
9
8
7
7
6
5
5
4
2
BUY
30
25
10
6
5
3
2
1
Now, we can compute the <b>PNL</b> (Profit and Loss) relative to the above orders, and it is equal to 3 bucks.
The problem is to decompose the PNL in an appropriate way such that we can really <b>understand</b> and have real insight on how the strategy is actually doing. For instance, how many positive scalps we have made (<b>money "pocketed"</b>), how many negative scalps we have made (for instance due to STOPs), which is money <b>"permanently lost"</b> and what is instead still "unrealized".
Now we have already seen that the broker itself provides us with a decompositions of the type: <b>PNL = Realized + Unrealized</b>
We also have been (approximately) following that so far. However, it's now time to <b>leave the herd and think out of the box </b> ;-))
The above decomposition of the PNL turns out actually almost totally useless for the purposes of algorithmic trading and has a bureaucratic value, for tax purposes. [Infact you can review from here for instance:
http://www.irs.gov/pub/irs-pdf/p550.pdf that the computation of the Realized is based on some assumptions, such as <b>FIFO or "Specific share identification"</b>, which are meaningless and arbitrary for the purpose of algorithmical trading.]
Now, the motivation for this new insight arised from the simple observation that for instance the scalps made in deep drawdown were not accounted as "pocketed" (realized), while from a strategy perspective they are and should actually be shown to the trader as <b>"pocketed" money</b>. It is very important that the trader has a real and precise feeling about the <b>real "realized"</b> component and see it possibly grow, as this provides, as we have seen, a strong psychological support in the periods of "investment".
So this lead to the necessity of some insight and different concepts, that i am introducing here.
Thus, i proceeed defining the following decomposition (the components will be illustrated by different curves in the application charts):
<b>PNL = Good Scalps + Bad Scalps + "Unrealized"</b>
where:
Good Scalps = amount due to non negative scalps, it's a <b>PERMANENT GAIN, money already pocketed</b>
Bad Scalps = amount due to negative scalps, it's a <b>PERMANENT LOSS, money gone forever </b> (such as due to stop loss)
Unrealized = it's the "real unrealized" part of the PNL
Let's see a practical example, looking at the above orders. Let's identify first the GOOD scalps (we clearly want to give
priority to their identification):
Good Scalps:
BUY - SELL
10 - 15 $5
6 - 17 $11
5 - 9 $4
3 - 8 $5
2 - 7 $5
1 - 7 $6
------------------ = $36
So 6 "good" scalps. Amounting to a pocketed profit of 5 + 11 + 4 + 5 + 5 + 6 = 36.
[ Note that changing the pairs in the scalps, doesnt change the value:
10 - 17 $7
6 - 15 $9
5 - 7 $2
3 - 7 $4
2 - 8 $6
1 - 9 $8
---------------- = $36 ]
We are left with the orders, clearly amounting to a loss of 3 - 36 = -33 :
SELL
6
5
5
4
2
BUY
30
25
where there are necessarily 2 BAD scalps (stop loss or whatever). Now, this amount, that we could call "total loss", is made of 2 unrecoverable bad scalps and 3 open positions. So we can compute the total loss and partition it proportionally. So we have:
total loss = Bad Scalps + Unrealized
-33 = -33 (2/5) + -33 (3/5)
that is:
-33 = -13,2 + -19,8
So of these 33 bucks, we can interpret 13,2 as <b>"permanently gone"</b>, and 19,8 as <b>"true unrealized component"</b>.
In this case, the unrealized component, could be actually seen as the "ongoing investment in volatility": total loss = Bad Scalps + Ongoing Investment
[Clearly, in my example here i have assumed qty=1 and not considered commissions or multipliers, to make the ideas more understandable. In actual implementation these have to be taken into account, which make these computations not really elementary to implement (especially the computation of the "permanent gain").]
In summary, we have:
<center>
PNL = Good Scalps + Bad Scalps + Ongoing Investment
</center>
or if you prefer:
<b><center>
PNL = "Permanent Gain" + "Permanent Loss" + "Ongoing Investment"
</b></center>
Let me know your thoughts, or if you have further ideas to adjust these concepts or naming conventions.
After the possible discussion, i will proceed by removing the current concepts of Realized/Unrealized and by substituting with the new concepts discussed here.
(I will also make a web page with more detailed explanation and source code to compute these components.)
Tom