Payout creation process

Hello, my team and I would like to submit our strategy : we created a script that defines weights. However, we have trouble understanding the payout creation process. How do you define the buy/sell signals ? How do we turn out our script into a payout function ?


Regards,


EvryDay

Hello EvryDay,

Buy/sell signals for a strategy is defined by their date and allocation. It is an xts object in R. For example:

Signal
2017-07-10 -1 # Short position
2017-08-03 1 # Long position
2018-06-15 1 # Maintain long position
2019-02-01 0 # Close all positions (no positions held)
2019-06-03 1 # Long position
2019-06-05 1.5 # Allocation increased by 50%

The date represents the day the signal was created. A signal on 2017-07-10, will use information available up to that day (including the close price of 2017-07-10) will be traded in the next trading day.

The allocations are defined using 1 as a base unit. 1 means a longing 1 unit of an asset, -2 means a shorting 2 units and 0 means no position. For the Lyxor-X-Alphien Alphathon, only allocations of 0 to 1 are allowed.


Payout is a function that takes price data and parameters to compute the signal xts. There are no requirements for parameters of a payout function. Note that the output xts should not have any NAs. You may refer to the payout creation wiki page and example payout on qlib to get an idea on how to construct a payout.

https://qlib.alphien.com/qlib/RFunctionEditor?open_functions=emaCross

https://wiki.alphien.com/ALwiki/Creating_a_payout



If your script defines weights for a portfolio, the weight payout function can be defined in the same way. For the Lyxor-X-Alphien Alphathon, sum of weights must be from 0 to 1.


A payout function is necessary to execute your strategy on any time period and on the paper trading period. A step by step approach can be used to break down what is happening in a script and convert it to a function. What is the logic of the strategy? What is done at every time step? You can test the payout function by using other Building Blocks or input different periods for the building block.


Hope this helps:)