-
Notifications
You must be signed in to change notification settings - Fork 264
feat: Pivot Points including 5 levels #1598
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
base: v3
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,12 +86,14 @@ PivotPointsResult r | |
| S2 = windowPoint.S2, | ||
| S3 = windowPoint.S3, | ||
| S4 = windowPoint.S4, | ||
| S5 = windowPoint.S5, | ||
|
|
||
| // resistance | ||
| R1 = windowPoint.R1, | ||
| R2 = windowPoint.R2, | ||
| R3 = windowPoint.R3, | ||
| R4 = windowPoint.R4 | ||
| R4 = windowPoint.R4, | ||
| R5 = windowPoint.R5, | ||
| } | ||
| : new PivotPointsResult { | ||
| Timestamp = q.Timestamp | ||
|
|
@@ -175,9 +177,13 @@ private static WindowPoint GetPivotPointStandard( | |
| S1 = (pp * 2) - high, | ||
| S2 = pp - (high - low), | ||
| S3 = low - (2 * (high - pp)), | ||
| S4 = low - (3 * (high - pp)), | ||
| S5 = low - (4 * (high - pp)), | ||
| R1 = (pp * 2) - low, | ||
| R2 = pp + (high - low), | ||
| R3 = high + (2 * (pp - low)) | ||
| R3 = high + (2 * (pp - low)), | ||
| R4 = high + (3 * (pp - low)), | ||
| R5 = high + (4 * (pp - low)) | ||
| }; | ||
| } | ||
|
|
||
|
|
@@ -196,10 +202,12 @@ private static WindowPoint GetPivotPointCamarilla( | |
| S2 = close - (1.1m / 6 * (high - low)), | ||
| S3 = close - (1.1m / 4 * (high - low)), | ||
| S4 = close - (1.1m / 2 * (high - low)), | ||
| S5 = close - (1.1m / 1 * (high - low)), | ||
| R1 = close + (1.1m / 12 * (high - low)), | ||
| R2 = close + (1.1m / 6 * (high - low)), | ||
| R3 = close + (1.1m / 4 * (high - low)), | ||
| R4 = close + (1.1m / 2 * (high - low)) | ||
| R4 = close + (1.1m / 2 * (high - low)), | ||
| R5 = close + (1.1m / 1 * (high - low)), | ||
|
Comment on lines
+207
to
+212
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify Camarilla pivot formulas against the reference source. The S5/R5 formulas use the multiplier 1.1 (from 1.1/1), which extends the Camarilla pattern. Please confirm this matches the referenced Camarilla Pivot Points definition. 🌐 Web query: 💡 Result: MyPivots.com lists Camarilla pivots only through R4 and S4 — it does not provide formulas for R5 or S5. The site gives:
(Where RANGE = HIGH − LOW and C = Close.) [1] Source: MyPivots — “Camarilla Pivot Points.” [1] Update GetPivotPointCamarilla R5/S5 formulas to match standard Camarilla implementation. The fifth layer of Camarilla formulas can vary depending on which version is used, but the code's R5/S5 implementation differs from industry standards. Standard Camarilla implementations define R5 = R4 + 1.168 * (R4 - R3) and S5 = S4 - 1.168 * (S3 - S4), or alternatively R5 = (High/Low) * Close and S5 = Close - (R5 - Close). The code currently uses Replace the R5/S5 formulas with the standard formula-based approach or document the custom variant rationale. 🤖 Prompt for AI Agents |
||
| }; | ||
|
|
||
| /// <summary> | ||
|
|
@@ -243,9 +251,13 @@ private static WindowPoint GetPivotPointFibonacci( | |
| S1 = pp - (0.382m * (high - low)), | ||
| S2 = pp - (0.618m * (high - low)), | ||
| S3 = pp - (1.000m * (high - low)), | ||
| S4 = pp - (1.618m * (high - low)), | ||
| S5 = pp - (2.618m * (high - low)), | ||
| R1 = pp + (0.382m * (high - low)), | ||
| R2 = pp + (0.618m * (high - low)), | ||
| R3 = pp + (1.000m * (high - low)) | ||
| R3 = pp + (1.000m * (high - low)), | ||
| R4 = pp + (1.618m * (high - low)), | ||
| R5 = pp + (2.618m * (high - low)), | ||
|
Comment on lines
+256
to
+262
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify Fibonacci pivot formulas against the reference source. The formulas use Fibonacci extension ratios 1.618 and 2.618, which are standard. However, please verify these match the referenced Fibonacci Pivot Points definition. Note: The PR description references the Woodie URL (definition/228) for Fibonacci verification—please confirm the correct reference URL. 🌐 Web query: 💡 Result: Use the standard pivot (PP) and the prior-day range (DR): PP = (High + Low + Close) / 3 Fibonacci extensions:
(These ratios are the common Fibonacci extension multipliers used for R4/R5 and S4/S5.) [1][2] Sources: Sierra Chart pivot formulas; TradingView Fibonacci pivot implementation. [1][2] Fix Fibonacci pivot formulas—ratios are incorrect. The formulas use wrong Fibonacci extension ratios. According to standard Fibonacci pivot implementations:
Corrected formulas (lines 256-262): 🤖 Prompt for AI Agents |
||
| }; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify Standard pivot formulas against the reference source.
The formulas follow a consistent mathematical pattern extending R3/S3, but should be verified against the referenced Classic Pivot Points definition to ensure correctness.
🌐 Web query:
💡 Result:
Classic (Standard) pivot formulas on MyPivots:
MyPivots' Classic definition lists R1–R4 and S1–S4 only; it does not provide R5 or S5 for the Classic/Standard set. [1][2]
Sources: MyPivots Classic Pivot Points definition and Pivot Point Calculator. [1][2]
Critical formula errors in Standard pivot point calculations—R3, R4, S4 do not match reference; R5/S5 should not exist.
The code's formulas diverge from the MyPivots Classic/Standard definition. R3 should be PP + 2 * RANGE, not
high + (2 * (pp - low)). Similarly, R4 = PP + 3 * RANGE, and S4 = PP − 3 * RANGE. Additionally, MyPivots' Classic definition lists R1–R4 and S1–S4 only; it does not provide R5 or S5 for the Classic/Standard set, so these should be removed.Lines 182–188 require correction to align with the authoritative reference formulas.
🤖 Prompt for AI Agents