I have an indicator that works fine to send a webhook message on different conditions like 3 green high cross, 20 EMA cross etc and trades go well... however sometimes I find random opportunities on chart upon crossing down/up a horizontal/trend line, where I wanted to invoked this indicator to run... is there a way to achieve this. This line is managed/moved by me on case to case basis to different prices on chart as shown in below image
https://i.sstatic.net/HATW2.png
I tried a fixed /static massage that works fine to send a message up on crossing line, however my need is a custom indicator in which some function, custom logic are there, hence seeking help on how to catch a trendline cross through an indicator
User drawings are not accessible by pinescript.
If all you need is a horizontal line, you can have an input.float()
and define the price there.
If you need more complicated lines (e.g. trend lines, conditional lines etc.), you need to create your lines with line.new()
and then access its price with line.get_y2()
or line.get_price()
and set your alerts based on the return value.