-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parabolic SAR #780
base: main
Are you sure you want to change the base?
Parabolic SAR #780
Conversation
@real-lazy-coder brilliant PR! 👌 Thanks for doing all the work. It is just missing some test coverage. Have you tried EarlyAI to generate test code? Or the Cursor AI Editor? |
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…c SAR indicators 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
@bennycode I'm on the struggle bus. For the life of me I cannot figure out how to get 100% test coverage on the PSAR.
These are edge cases and I'm at a loss. Any guidance? |
I'm using Claude Code quite a bit these days. But it's 🔥 my 💰 at a blazing fast rate! I'll look into EarlyAI. Thanks, |
I ran the tests and reviewed the HTML output in the sar = previousLow.lt(sar) ? previousLow : sar; Similarly, we should add a test case where it falls back to sar = previousHigh.gt(sar) ? previousHigh : sar; |
@real-lazy-coder I was able to write tests for the missing cases -> real-lazy-coder#1 Example: it('adjusts the SAR when the previous low is lower than the pre-previous low', () => {
const psar = new PSAR({accelerationMax: 0.2, accelerationStep: 0.02});
const prePreviousLow = 8;
const previousLow = 7;
psar.add({high: 10, low: 9});
psar.add({high: 11, low: prePreviousLow});
psar.add({high: 12, low: previousLow});
expect(psar.getResultOrThrow().toString()).toBe('12');
}); |
@real-lazy-coder shall we get this in? 😀 |
I have 1 last line I need to write a test for. I'm currently on vacation with my family. I will get this finalized when I return next week. |
1 similar comment
I have 1 last line I need to write a test for. I'm currently on vacation with my family. I will get this finalized when I return next week. |
Sure! Take it easy and enjoy the vacation with your loves ones. 😊 |
Parabolic SAR (PSAR) Type: Trend
The Parabolic Stop and Reverse (PSAR) is a technical indicator that identifies potential reversals in the price movement of an asset. It appears as a series of dots placed either above or below the price, depending on the direction the price is moving. The indicator is used to determine the direction of a trend, identify potential entry and exit points, and set trailing stop-loss orders.
Checklist for new indicators
BigIndicatorSeries
NumberIndicatorSeries
getResult
are presentsrc/index.ts
startBenchmark.ts
README.md