Problem 45890. Algorithmic Trading - 4 (two thresholds)
This is the fourth of a series of problems on quant trading. It builds on earlier problems 45776, 45860, and 45884
Goal
Similar to problem 45884, with an additional degree of freedom in the fractional trading strategy
- Use two thresholds to define 3 possible states of the trading signal, and establish a different level of exposure (between -2 and +3) to the traded security for each state
You are given
- P, a n x 1 vector of daily prices of the traded security, at market open (always positive)
- S, a n x 1 vector of trading signals, calculated just ahead of market open (can take any real value)
- These will serve both as training and test set
Your function should return
- T, a 2 x 1 vector, with T(1) <= T(2), which determines the state of signal S
- E, a 3 x 1 vector of security exposures in each state, i.e., invest a fraction E(k) of the available equity when S(i) < T(k), for k = 1 + (S(i)<=T(1)) + (S(i)<=T(2)), with -2 <= E(k) <= 3, for any k
Solution Stats
Problem Comments
-
1 Comment
jmac
on 22 Nov 2020
Test suite fixed
Solution Comments
Show commentsProblem Recent Solvers2
Suggested Problems
-
13275 Solvers
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15529 Solvers
-
Swap the first and last columns
20438 Solvers
-
21398 Solvers
-
Volatile array in parfor and for
3 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!