steadforwardx

TrendLine I3-TL

Idea:
Draw a trendline that can set an alert every time the price cross over/under.

Concept:
(Note that we take the close to get the closing price).
-Determine the coordinates of 2 points of the line AB: A(x1;y1); B(x2;y2).
-Apply Oxy geometry to the chart with price as Oy axis, time as Ox axis. Use linear equations to determine:
+If point's x > line's x, the point is to the right of the line.
+If point's x < line's x, the point is to the left of the line.
+If point's x == line's x, the point is on the line.
-Determine when the price is crossOver or crossUnder the trend line, display that time on the chart and send an alert.

How it works:
1. Input value to config the line by manually:
- Y1: Price 1 as point 1.
- X1: Time at point 1.
- Y2: Price 2 as point 2.
- X2: Time at point 2.
X2 (To date) must be after X1 (From date).
Please consider time (hour, minute) if timeframe < 1hour.

Then draw a line on the pouring table with straight line AB as solid line, extended line as broken line. Logic will start from dashed line (To date in input).
If the price changes value from side to side of the line, show the text label, change the background color accordingly (blue top, red bottom),
also sends an alert ("CrossUnder"; "CrossOver").

2. The indicator's operating range is limited to 500 bars from the "From date" bar. When reaching to the outside, it will show a yellow warning with outbound message.

3. Set alert for this indicator, it will send alert follow 1. condition.


Suitable time frames:
5m, 15m, 1h, 4h, 1D

* Please note that this logic does not attempt to predict future prices or 100% accurate signal.
This is FREE indicator.
(Please direct message or visit website if you want to try another invite-only indicators)
Hope you guys enjoy!

Examples:
GOLD 1D

EURUSD 1H

Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?