Add SOXX dynamic volatility threshold indicators#89
Conversation
40e4d82 to
f8b3cc1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40e4d8224f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| soxx_dynamic_volatility_threshold = _bounded_threshold( | ||
| volatility_threshold_history[-1], |
There was a problem hiding this comment.
Use the prior volatility threshold
When the threshold is evaluated against today's realized_volatility_10, taking volatility_threshold_history[-1] includes that same current volatility sample in the 95th-percentile threshold. This introduces look-ahead/self-inclusion for any strategy comparing the current realized volatility to this dynamic threshold, unlike the RSI threshold just above which uses the previous value; a high-volatility close can raise the threshold used for that same close and change the delever signal. Use the previous threshold sample for the current decision path.
Useful? React with 👍 / 👎.
Summary
Tests
Note: tests/test_longbridge_market_data.py could not run locally because this VPS Python environment does not have pandas installed.