-
Notifications
You must be signed in to change notification settings - Fork 73
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
Best way to add lines (e.g. horizontal, rays, etc.) #11
Comments
Are you guys talking about something other than "multiple trend lines", which was added in a previous version? |
Yes we are. Trend lines are lines with data points for each candle i.e. x=time, y=price. However, horizontal lines and rays don't know about candle data, they just have a start x/y point and an end x/y point. These lines are used to represent "support & resistance", which is the most basic form of technical analysis that a candle chart would be used for. A ray is a line that can be placed at an angle, which has the same 2 points I described above, but the end of the line actually continues off screen into infinity, hence the name ray. |
Hi @calculabs, would you mind sharing the code that got you that far please? It looks excellent! |
@anfen - This is not my app, this is just a TradingView example to show the functionality, to give the author an idea of what we're trying to accomplish. I believe that the naming convention "Trend Lines" in this package actually refers to what are usually considered to be "Formulas", ie MACD, MA, BOLLINGER, etc. |
You can draw a line with a simple code:
The problem will be to catch events, I also didn't find a way of customize the color of the trends line |
Actually checked now and it's possible to customize the style, check here: The moving of the resistance line could be more difficult, there is a event onTap, but it only identifies the candle clicked, the moving of the line could be tricky |
@h65wang is this something you're looking into or do you have any suggestions maybe? Thanks |
I need to add lines e.g. for support and resistance etc., but feel that this may be better achieved using a transparent overlay over the chart widget. This would prevent the original chart widget becoming bloated with optional features. However, it may cause gestures to be harder to communicate down to the chart widget for panning and zooming.
How would you recommend this be achieve?
The text was updated successfully, but these errors were encountered: