braverock / braverock/quantstrat
Implement Triple Barrier Method from "Advances in Financial Machine Learning" - De Prado 2018
- Dominant language
- R
- Stars
- 310
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
De Prado (https://www.amazon.com/Advances-Financial-Machine-Learning-Marcos/dp/1119482089) introduces the Triple Barrier Method concept for labeling observations in a potential ML model for time series. The 3 barriers are 2 horizontal bars (representing profit-taking and stop-loss prices) and one vertical bar (representing an expiration timespan, ie. x number of bars). Where the top horizontal bar is touched first, the observation gets a label of +1. If the lower horizontal bar is touched first, the observation gets a label of -1. If the vertical bar is touched first, De Prado suggests 2 options...either give the observation the sign of the return or a zero. Your choice should depend on the problem you are trying to solve.
De Prado says the output from the function should be a dataframe containing the timestamps at which any barrier was touched. De Prado also mentions 8 possible configurations of the "barrier triplet" in which the barriers are enabled or disabled reflecting different objectives and constraints. For our replication of the method, we should consider all configurations, some of which share some overlap with the trading strategy posed by Olsen et al in https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2951348.
There could be a few applications of this method in `quantstrat` but our initial focus will be for extending it to signal analysis for any periodicity.
TODO: Add more info?
Contributor guide
Assessment
This issue has not been assessed yet.