technical-patterns-lab/docs/对称三角形-几何约束示意.svg
褚宏光 543572667b Add initial implementation of converging triangle detection algorithm and related documentation
- Created README.md and USAGE.md for project overview and usage instructions.
- Added core algorithm in src/converging_triangle.py for batch processing of stock data.
- Introduced data files (open.pkl, high.pkl, low.pkl, close.pkl, volume.pkl) for OHLCV data.
- Developed output documentation for results and breakout strength calculations.
- Implemented scripts for running the detection and generating reports.
- Added SVG visualizations and markdown documentation for algorithm details and usage examples.
2026-01-21 18:02:58 +08:00

104 lines
4.4 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="980" height="520" viewBox="0 0 980 520">
<defs>
<marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="5" orient="auto">
<path d="M0,0 L10,5 L0,10 Z" fill="#444"/>
</marker>
<style>
.bg { fill:#ffffff; }
.axis { stroke:#cfcfcf; stroke-width:1; }
.lineU { stroke:#e67e22; stroke-width:4; fill:none; }
.lineL { stroke:#e67e22; stroke-width:4; fill:none; }
.price { stroke:#c0392b; stroke-width:3; fill:none; }
.touch { fill:#ffffff; stroke:#111; stroke-width:3; }
.label { font-family: Arial, Helvetica, sans-serif; font-size:18px; fill:#111; font-weight: bold; }
.small { font-family: Arial, Helvetica, sans-serif; font-size:15px; fill:#333; }
.hint { font-family: Arial, Helvetica, sans-serif; font-size:14px; fill:#555; }
.dash { stroke:#666; stroke-width:2; stroke-dasharray:6 6; }
.bracket { stroke:#444; stroke-width:2; fill:none; marker-end:url(#arrow); }
.box { fill:#f7f7f7; stroke:#ddd; stroke-width:1; }
</style>
</defs>
<!-- background -->
<rect class="bg" x="0" y="0" width="980" height="520"/>
<!-- plotting area -->
<rect x="40" y="40" width="660" height="420" class="box"/>
<!-- grid -->
<g opacity="0.6">
<line class="axis" x1="40" y1="130" x2="700" y2="130"/>
<line class="axis" x1="40" y1="220" x2="700" y2="220"/>
<line class="axis" x1="40" y1="310" x2="700" y2="310"/>
<line class="axis" x1="40" y1="400" x2="700" y2="400"/>
<line class="axis" x1="150" y1="40" x2="150" y2="460"/>
<line class="axis" x1="260" y1="40" x2="260" y2="460"/>
<line class="axis" x1="370" y1="40" x2="370" y2="460"/>
<line class="axis" x1="480" y1="40" x2="480" y2="460"/>
<line class="axis" x1="590" y1="40" x2="590" y2="460"/>
</g>
<!-- upper / lower trendlines (sym triangle) -->
<path class="lineU" d="M70 120 L680 240"/>
<path class="lineL" d="M70 430 L680 290"/>
<!-- apex indication -->
<line class="dash" x1="680" y1="240" x2="680" y2="290"/>
<text class="small" x="645" y="320">Apex Area</text>
<!-- price path inside triangle (containment) -->
<path class="price"
d="M85 330
C110 300, 125 240, 150 215
C175 240, 195 300, 220 325
C245 350, 265 310, 285 290
C305 270, 315 250, 330 260
C345 270, 360 310, 380 315
C400 320, 410 290, 430 285
C450 280, 470 270, 490 275
C510 280, 525 300, 545 300
C565 300, 580 285, 600 285
C620 285, 640 275, 660 275"/>
<!-- touch points on upper line (pivot highs) -->
<circle class="touch" cx="150" cy="215" r="10"/>
<circle class="touch" cx="330" cy="260" r="10"/>
<circle class="touch" cx="600" cy="285" r="10"/>
<!-- touch points on lower line (pivot lows) -->
<circle class="touch" cx="85" cy="330" r="10"/>
<circle class="touch" cx="220" cy="325" r="10"/>
<circle class="touch" cx="545" cy="300" r="10"/>
<circle class="touch" cx="660" cy="275" r="10"/>
<!-- labels for trendlines -->
<text class="label" x="500" y="235">Upper Line (Resistance)</text>
<text class="label" x="500" y="340">Lower Line (Support)</text>
<!-- slope explanation -->
<line class="bracket" x1="760" y1="90" x2="930" y2="90"/>
<text class="label" x="740" y="75">1. Slope</text>
<text class="hint" x="740" y="110">Upper: Downward (a&lt;0)</text>
<text class="hint" x="740" y="132">Lower: Upward (a&gt;0)</text>
<!-- convergence width brackets -->
<text class="label" x="740" y="190">2. Convergence</text>
<line class="bracket" x1="120" y1="475" x2="120" y2="420"/>
<text class="hint" x="140" y="470">Wide Start</text>
<line class="bracket" x1="675" y1="475" x2="675" y2="438"/>
<text class="hint" x="695" y="470">Narrow End</text>
<!-- touches explanation -->
<text class="label" x="740" y="260">3. Touches</text>
<text class="hint" x="740" y="285">Min 2-3 touches (top)</text>
<text class="hint" x="740" y="307">Min 2-3 touches (bottom)</text>
<text class="hint" x="740" y="329">Touch = Reversal at line</text>
<!-- containment explanation -->
<text class="label" x="740" y="390">4. Containment</text>
<text class="hint" x="740" y="415">Price stays inside lines</text>
<text class="hint" x="740" y="437">Rare breakouts before apex</text>
<!-- title -->
<text class="label" x="40" y="28">Symmetrical Triangle: Geometric Constraints</text>
</svg>