Trendline does not draw correctly when out-of-view
See original GitHub issueLightweight Charts Version: “lightweight-charts”: “^1.2.1”
Steps/code to reproduce: Not sure if this is considered a bug as this is a workaround for drawing trend-lines by overlaying two charts together.
When either the start or end point pans out of view, the overlay addLineSeries behaves rather ugly
const trade_overlay = tradeReportChartOverlay(pnl_line_color)
trade_overlay.setData([
{value: entry_price, time: epoch_entry_time},
{value: exit_price, time: epoch_exit_time}
])
Actual behavior: Please see image below on the resulting behaviour
Expected behavior:
Ideally it should be able to draw the trend line accurately On a side note, is it possible to remove the overlay addLineSeries data in the event the either the start or end “time” is “out-of-view”
Screenshots
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Chart trendline formula is inaccurate in Excel - Office
This article documents an issue with the trendline function of an Excel chart when you manually enter X values.
Read more >How to Draw Trend Lines Correctly - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >How To Draw Trendlines Like A Pro (My Secret ... - YouTube
Discover how to draw trendlines correctly so you can better time your entries and identify high ... Your browser can't play this video....
Read more >Explaining Trends and How to Draw Trendlines - YouTube
This video should not be construed as investment advice. Investments can fall and rise. Capital at risk. CFDs are complex instruments and ...
Read more >How to draw trend lines – walkthrough - YouTube
This video is about drawing trend lines on TradingView and all of the features members have. ... Your browser can't play this video....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
the barSeries has the full OHLC data, where as the tradeDetailLineSeries is limited to two points (which is the start- and end-point of the trendline)
Sure, I’ll try to port over an example this afternoon
Closing.
This was an bug on my side; It looked like the underlying ohlc was drawn with UTC, while the Trendline was draw with EST… so the trendline sort of fell-off when out of viewpoint