allocations and orders
-
Hi again, I am a little bit confused about the backtester logic. You talk about exposure and allocations, but where can I define how many contracts to buy for a given assets? I do not see anthing in the examples. When are trades actually taking place?
-
@xiaolan Hi, sorry for the confusion.
We based our backtester on the concept of allocations (or exposure). Imagine to have some capital at your disposal, let us say 1 M USD. This is the "nominal" capital you would like to invest.
At Quantiacs you should not take care of defining how many contracts for a given asset you would like to buy or to sell. You should simply imagine to allocate capital on a daily basis. In other words, for each day you should decide the fraction of capital you want to distribute among your assets.
As we talk about fractions, we require the sum of the absolute values of fractions (positive for going long, negative for going short) to be smaller or equal to 1. If the sum is larger, we will scale down fractions to get a gross exposure of 1.
The backtester reads the close price for each asset, and then it applies fractions; for example, the backtester will decide to allocate 20% of the capital to BTC. The 20% will be translated to a number of contracts to be bought (using the close), and transactions will be executed at the open of the next day.
This is similar to a realistic scenario where the positions are defined at the close of markets active in the USA.
-
@support Thank you, well, for me orders are more intuitive, but it looks it is possible to transition from one setup to the other, in the end allocations become orders...
-
@xiaolan Yes, allocations are translate to orders internally, it is enough to check the variation in the allocations and transform it into number of contracts bought/sold. When we designed the toolbox the goal was to simplify development as much as possible for the users.