Commit c8c1390
committed
fix: retroactively redraw trendlines when slope changes
In PineScript, line.set_xy2() redraws the entire line from the
anchor point. Our per-bar output was recording the initial flat phase
(slope=0) and only applying the slope going forward. This left 63-83%
of trendline bars with zero slope showing horizontal lines.
Fix: when the slope is first set or updated, retroactively recompute
tl_value and tl_slope for all bars from the anchor (tl_x1) forward,
matching PineScript's visual behavior. Now 97-100% of trendline bars
have correct diagonal values.1 parent d2ded75 commit c8c1390
3 files changed
Lines changed: 21 additions & 1 deletion
File tree
- analysis/indicators
- pyindicators/indicators
- static/images/indicators
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
259 | 269 | | |
260 | 270 | | |
261 | 271 | | |
| |||
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
326 | 346 | | |
327 | 347 | | |
328 | 348 | | |
| |||
0 commit comments