Pine Script v5 · Strategy
Click Draw TrendLine [UhoKang] v2
A Pine Script v5 strategy with no technical-analysis calculation. It has 4 order rules, 2 entries among them, and trades long only with the default settings; 1 entry is switched off until a setting enables it. Exits wait for a signal; there is no stop loss. Each trade commits 20% of equity and pays 0.075 commission. 9 settings; defaults include Grid percent value 0.05.
Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.
- Does Click Draw TrendLine [UhoKang] v2 repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
- How did Click Draw TrendLine [UhoKang] v2 do on BTCUSDT 1D with default settings?
- Not measured
- It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its code limits trading to a date window, which can leave this period out. It closed no trades on the other markets either. A backtest, not investment advice.
- Does Click Draw TrendLine [UhoKang] v2 run in Pine Script v6?
- Not tested
- Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download.
- Does Click Draw TrendLine [UhoKang] v2 use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does Click Draw TrendLine [UhoKang] v2 run in Zeal Terminal?
- Yes
- It compiles in 97 ms and runs 1,000 bars in 144 ms, in the browser.
BTCUSDT · 1D · default settings
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- 0.00%
- $0.00
- Buy and hold
- +102.5%
- same period
- Closed trades
- 0
- 0 won · 0 lost
- Profitable
- 0.0%
- of closed trades
- Profit factor
- —
- gross profit ÷ gross loss
- Max drawdown
- 0.00%
- $0.00
One run with the author's default settings, $10,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.
Review
What a careful reader of this script would point out, found by checking the source and the backtest.
-
Check
No stop loss
Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.
-
Note
The s side is off by default line 224
Its orders only fire after “Short Mode On!” is switched on. The figures on this page cover l trades only.
Settings
Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Bear Trendline : [A] Pivot high | timestamp("2021-12-30") | time | BigH1 |
| Bear Trendline : [B] Pivot low | timestamp("2021-12-30") | time | BigHR1 |
| Bear Trendline : [C] Pivot high | timestamp("2021-12-30") | time | BigH2 |
| Bull Trendline : [A] Pivot low | timestamp("2021-12-30") | time | BigL1 |
| Bull Trendline : [B] Pivot high | timestamp("2021-12-30") | time | BigLR1 |
| Bull Trendline : [C] Pivot low | timestamp("2021-12-30") | time | BigL2 |
| Grid percent value | 0.05 | float · step 0.01 | BigH_Line_Buy2 BigH_Line_Buy1 BigH_Line_Sell1 BigH_Line_Sell2 BigL_Line_Buy2 BigL_Line_Buy1 BigL_Line_Sell1 BigL_Line_Sell2 |
| Long Mode On! | true | bool | entry L line 220 |
| Short Mode On! | false | bool | entry S line 223 |
What it calculates
No technical-analysis calculation: the script works on prices and settings directly.
Signal flow
How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.
The script has 99 named inputs, calculations, conditions and outputs, too many to draw legibly here; the tables above list them.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open L long | check_long_mode | On “Long Mode On!” | 221 |
| Open S short | check_short_mode | Off “Short Mode On!” | 224 |
| Close L | trendline_longExitTr | On | 226 |
| Close S | trendline_shortExitTr | On | 228 |
Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.
Does it repaint?
No
No repainting patterns in the source.
- ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
- ClearFuture-bar referencesNo negative history offsets such as close[-1].
- ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
- ClearOrder timingprocess_orders_on_close = true: orders fill at the signal bar's close.
The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.
Other markets
The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | 0.0% | +102.5% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | 0.0% | +5.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | 0.0% | +9.8% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | 0.0% | +8.4% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | 0.0% | +16.7% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | 0.0% | +21.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | 0.0% | +148.3% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | 0.0% | +17.1% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
Backtests are simulations on historical data and are not investment advice.
Similar scripts
No other indicator or strategy here shares enough of its calculations.
Upgrade and export
Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.
- No v6-only features. v6 is not needed to run this script.
Clean v5
VerifiedNothing to change.
Does it run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/-//@version=5+//@version=6strategy("Click Draw TrendLine [UhoKang] v2", shorttitle="Click TrendLine v2", overlay=true, initial_capital=10000,default_qty_type=strategy.percent_of_equity,default_qty_value=20,commission_value=0.075,pyramiding = 5, slippage=3, process_orders_on_close=true)⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 97 ms | With a workaround 1,000 bars in 144 ms | Not measured |
| PineTS | Not tested | Not tested | Not measured |
Zeal Terminal's engine currently merges fill() calls that share a title, so it would draw 4 of this script's 6 fills; this page gives each call its own title to draw all of them.
“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.
Source
Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0///@version=5strategy("Click Draw TrendLine [UhoKang] v2", shorttitle="Click TrendLine v2", overlay=true, initial_capital=10000,default_qty_type=strategy.percent_of_equity,default_qty_value=20,commission_value=0.075,pyramiding = 5, slippage=3, process_orders_on_close=true)// This is an indicator that directly draws a trend line by clicking on the candle.// Click to Create Trend lines !!// Create a trend line by connecting A, B, and C with three vertices.// 1. Draw Bear Trend line// Click [A] pivot high : First pivothigh of the downtrend line// Click [B] pivot low : pivotlow of the downtrend line // Click [C] pivot high : Second pivothigh of the downtrend line // 2. Draw Bull Trend line// Click [A] pivot low : First pivotlow of the uptrend line// Click [B] pivot high : pivothigh of the uptrend line // Click [C] pivot low : Second pivotlow of the uptrend line // Modefiy Trendlines// 1. Edit Bear Trend line// Drag Red[A],[B],[C]// 2. Edit Bull Trend line // Drag Green[A],[B],[C]/////////////////////////////////////////////// TrendLine /////////////////////////////////////////////////////////// 1. inputvar TriangleHigh_A = input.time(timestamp("2021-12-30"), confirm = true, title = "Bear Trendline : [A] Pivot high")var TriangleHigh_B = input.time(timestamp("2021-12-30"), confirm = true, title = "Bear Trendline : [B] Pivot low")var TriangleHigh_C = input.time(timestamp("2021-12-30"), confirm = true, title = "Bear Trendline : [C] Pivot high")var TriangleLow_A = input.time(timestamp("2021-12-30"), confirm = true, title = "Bull Trendline : [A] Pivot low")var TriangleLow_B = input.time(timestamp("2021-12-30"), confirm = true, title = "Bull Trendline : [B] Pivot high")var TriangleLow_C = input.time(timestamp("2021-12-30"), confirm = true, title = "Bull Trendline : [C] Pivot low")// 2. get bar_index of pivotpoint (피봇의 인덱스를 구하기)BigH1 = TriangleHigh_A == time ? bar_index : naBigHR1 = TriangleHigh_B == time ? bar_index : naBigH2 = TriangleHigh_C == time ? bar_index : naBigL1 = TriangleLow_A == time ? bar_index: naBigLR1 = TriangleLow_B == time ? bar_index: naBigL2 = TriangleLow_C == time ? bar_index : na// 2. get price of pivotpoint (피봇의 가격을 구하기)BigH_price1 = BigH1 ? high : naBigH_price2 = BigH2 ? high : naBigL_price1 = BigL1 ? low : naBigL_price2 = BigL2 ? low : naBigHR_price1 = BigHR1 ? low : naBigLR_price1 = BigLR1 ? high : na// 3. set datas (고점의 정보들을 var 변수에 기록해두기)// trendlines var (긴추세선 변수 기록)var BigH_Line_index1 = int(na)var BigH_Line_index2 = int(na)var BigL_Line_index1 = int(na)var BigL_Line_index2 = int(na)var BigH_Line_price1 = float(na)var BigH_Line_price2 = float(na)var BigL_Line_price1 = float(na)var BigL_Line_price2 = float(na)BigH_Line_index1 := BigH1? BigH1: BigH_Line_index1 [1]BigH_Line_index2 := BigH2? BigH2: BigH_Line_index2 [1]BigL_Line_index1 := BigL1? BigL1: BigL_Line_index1 [1]BigL_Line_index2 := BigL2? BigL2: BigL_Line_index2 [1]BigH_Line_price1 := BigH_price1? BigH_price1 : BigH_Line_price1 [1]BigH_Line_price2 := BigH_price2? BigH_price2 : BigH_Line_price2 [1]BigL_Line_price1 := BigL_price1? BigL_price1 : BigL_Line_price1 [1]BigL_Line_price2 := BigL_price2? BigL_price2 : BigL_Line_price2 [1]// parallel lines var (평행선 변수 기록)var BigHR_Line_price1 = float(na)var BigLR_Line_price1 = float(na)var BigH_Atr = float(na)var BigL_Atr = float(na)var BigHR_index = int(na)var BigLR_index = int(na)BigHR_Line_price1 := BigHR_price1? BigHR_price1 : BigHR_Line_price1 [1]BigLR_Line_price1 := BigLR_price1? BigLR_price1 : BigLR_Line_price1 [1]BigHR_index := BigHR1 ? BigHR1 : BigHR_index[1]BigLR_index := BigLR1 ? BigLR1 : BigLR_index[1]// mini trendlines var (짧은추세선 변수 기록)var MidH_Line_index1 = int(na)var MidH_Line_index2 = int(na)var MidL_Line_index1 = int(na)var MidL_Line_index2 = int(na)var MidH_Line_price1 = float(na)var MidH_Line_price2 = float(na)var MidL_Line_price1 = float(na)var MidL_Line_price2 = float(na)// 4. plotshape inputpoint on chart 입력 받았는지 차트에 표시하기plotshape(BigH1, location = location.abovebar, color=color.maroon, textcolor=color.yellow, text = "A", style = shape.labeldown)plotshape(BigHR1, location = location.belowbar, color=color.maroon, textcolor=color.yellow, text = "B", style = shape.labeldown)plotshape(BigH2, location = location.abovebar, color=color.maroon, textcolor=color.yellow, text = "C", style = shape.labeldown)plotshape(BigL1, location = location.belowbar, color=color.olive, textcolor=color.white, text = "A", style = shape.labelup)plotshape(BigLR1, location = location.abovebar, color=color.olive, textcolor=color.white, text = "B", style = shape.labelup)plotshape(BigL2, location = location.belowbar, color=color.olive, textcolor=color.white, text = "C", style = shape.labelup)// 5. plot startpoint of trendlines (추세선이 생성된 지점의 라인 그리기) plot(BigH1 ? high : BigH2 ? high : na, color=color.new(color.maroon,30), style=plot.style_line, linewidth=1, editable=false, title = "iAC guideline")plot(BigHR1 ? low : BigH1 ? high : na, color=color.new(color.maroon,80), style=plot.style_line, linewidth=1, editable=false, title = "AB guideline")plot(BigHR1 ? low : BigH2 ? high : na, color=color.new(color.maroon,80), style=plot.style_line, linewidth=1, editable=false, title = "BC guideline")plot(BigL1 ? low : BigL2 ? low : na, color=color.new(color.olive,30), style=plot.style_line, linewidth=1, editable=false, title = "AC guideline")plot(BigLR1 ? high : BigL1 ? low : na, color=color.new(color.olive,80), style=plot.style_line, linewidth=1, editable=false, title = "AB guideline")plot(BigLR1 ? high : BigL2 ? low : na, color=color.new(color.olive,80), style=plot.style_line, linewidth=1, editable=false, title = "BC guideline")/////////////////////////////////////////////////////// 추 세 선 계 산 하 기 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// calc trendline ///////////////////////////////////////////////////////////// get avg of trendline (추세선 곡률계산)avgLine(src1,src2, x1, x2) => // pivot price1, pivot price2, pivot index1, pivot index2 (가격1, 가격2, 시작점, 끝점) avgLineRatio = (src1 - src2)/(x2-x1) avgLineRatioLast = -(avgLineRatio * (bar_index-x2)) // x2 꼭지점 ~ 현재 꼭지점의 차이를 계산 // calc trendlines (추세선 계산)BigH_Avg = avgLine(BigH_Line_price1,BigH_Line_price2,BigH_Line_index1,BigH_Line_index2)BigL_Avg = avgLine(BigL_Line_price1,BigL_Line_price2,BigL_Line_index1,BigL_Line_index2)MidH_Avg = avgLine(MidH_Line_price1,MidH_Line_price2,MidH_Line_index1,MidH_Line_index2)MidL_Avg = avgLine(MidL_Line_price1,MidL_Line_price2,MidL_Line_index1,MidL_Line_index2)BigH_Line = BigH_Line_price2 + BigH_Avg BigL_Line = BigL_Line_price2 + BigL_Avg MidH_Line = MidH_Line_price2 + MidH_Avg MidL_Line = MidL_Line_price2 + MidL_Avg // calc triangles (삼각수렴 계산) lineTop = float(na)lineMid = float(na)lineBot = float(na)if BigH_Line and BigL_Line and BigH_Line > BigL_Line lineHeight = (BigH_Line - BigL_Line)/4 lineTop := BigL_Line + (lineHeight*3) lineMid := BigL_Line + (lineHeight*2) lineBot := BigL_Line + (lineHeight*1) // calc trendLine and parallel lines (추세선과 평행선의 간격계산) BigH_Atr := (BigH_Line_price1 - BigHR_Line_price1)BigH_Atr:= BigH_Atr - (BigH_Line_price1-BigH_Line_price2) * (BigHR_index - BigH_Line_index1)/(BigH_Line_index2 - BigH_Line_index1) BigL_Atr := (BigLR_Line_price1 - BigL_Line_price1)BigL_Atr:= BigL_Atr + (BigL_Line_price1-BigL_Line_price2) * (BigLR_index - BigL_Line_index1)/(BigL_Line_index2 - BigL_Line_index1) BigH_TrendLineMax = BigH_Line - BigH_AtrBigH_TrendLineTop = BigH_Line - BigH_Atr*0.25BigH_TrendLineMid = BigH_Line - BigH_Atr*0.5BigH_TrendLineBot = BigH_Line - BigH_Atr*0.75BigL_TrendLineMax = BigL_Line + BigL_AtrBigL_TrendLineTop = BigL_Line + BigL_Atr*0.75BigL_TrendLineMid = BigL_Line + BigL_Atr*0.5BigL_TrendLineBot = BigL_Line + BigL_Atr*0.25// calc price line for trade (매수선 계산)LineRange = input.float(0.05, title = "Grid percent value", step = 0.01)BigH_Line_Buy2 = BigH_Line -(BigH_TrendLineMax - BigH_TrendLineTop )*LineRange*2BigH_Line_Buy1 = BigH_Line -(BigH_TrendLineMax - BigH_TrendLineTop )*LineRangeBigH_Line_Sell1 = BigH_Line +(BigH_TrendLineMax - BigH_TrendLineTop )*LineRangeBigH_Line_Sell2 = BigH_Line +(BigH_TrendLineMax - BigH_TrendLineTop )*LineRange*2BigL_Line_Buy2 = BigL_Line -(BigL_TrendLineBot - BigL_TrendLineMax )*LineRange*2BigL_Line_Buy1 = BigL_Line -(BigL_TrendLineBot - BigL_TrendLineMax )*LineRangeBigL_Line_Sell1 = BigL_Line +(BigL_TrendLineBot - BigL_TrendLineMax )*LineRangeBigL_Line_Sell2 = BigL_Line +(BigL_TrendLineBot - BigL_TrendLineMax )*LineRange*2// plot mini trendlines (추세선그리기)plot_BigH_LIne = plot(BigH_Line, color=color.new(color.maroon,0), style = plot.style_linebr, linewidth = 2, title = "Bull Trendline")plot_BigL_LIne = plot(BigL_Line, color=color.new(color.olive,0), style = plot.style_linebr, linewidth = 2, title = "Bear Trendline")plot(MidH_Line, color=color.new(color.red,0), style = plot.style_linebr, linewidth = 1, title = "Bull line")plot(MidL_Line, color=color.new(color.green,0), style = plot.style_linebr, linewidth = 1, title = "Bear line")// plot triangles (삼각수렴 그리기)plotTriTop = plot(lineTop, color = color.new(color.green,60), title = "Triangle line Top")plotTriMid = plot(lineMid, color = color.new(color.black,50), title = "Triangle line Middle")plotTriBot = plot(lineBot, color = color.new(color.red,60), title = "Triangle line Bottom")fill(plot_BigH_LIne,plotTriTop, color = color.new(color.green,70), title = "Triangle fill Top")fill(plot_BigH_LIne,plotTriMid, color = color.new(color.green,90), title = "Triangle fill Top")fill(plot_BigL_LIne,plotTriMid, color = color.new(color.red,90), title = "Triangle fill Bottom")fill(plot_BigL_LIne,plotTriBot, color = color.new(color.red,70), title = "Triangle fill Bottom") // plot parallel lines (평행선 그리기)plot_TrendHMax = plot(BigH_TrendLineMax, color=color.new(color.maroon,50), style = plot.style_circles, linewidth = 1, title = "Bear parallel Max")plot_TrendHTop = plot(BigH_TrendLineTop, color=color.new(color.maroon,85), style = plot.style_linebr, linewidth = 1, title = "Bear parallel Top")plot_TrendHMid = plot(BigH_TrendLineMid, color=color.new(color.maroon,90), style = plot.style_linebr, linewidth = 1, title = "Bear parallel Mid")plot_TrendHBot = plot(BigH_TrendLineBot, color=color.new(color.maroon,95), style = plot.style_linebr, linewidth = 1, title = "Bear parallel Bot")fill(plot_TrendHMax,plot_TrendHMid, color = color.new(color.maroon,90), title = "Bear parallel lines")plot_TrendLMax = plot(BigL_TrendLineMax, color=color.new(color.olive,50), style = plot.style_circles, linewidth = 1, title = "Bull parallel Max")plot_TrendLTop = plot(BigL_TrendLineTop, color=color.new(color.olive,95), style = plot.style_linebr, linewidth = 1, title = "Bull parallel Top")plot_TrendLMid = plot(BigL_TrendLineMid, color=color.new(color.olive,90), style = plot.style_linebr, linewidth = 1, title = "Bull parallel Mid")plot_TrendLBot = plot(BigL_TrendLineBot, color=color.new(color.olive,85), style = plot.style_linebr, linewidth = 1, title = "Bull parallel Bot")fill(plot_TrendLMax,plot_TrendLMid, color = color.new(color.olive,90), title = "Bull parallel lines")// draw start point of parallel lines (평행선 작도선 그리기)plot(BigHR1 ? low : BigH2 ? BigH_TrendLineMax : na, color=color.new(color.maroon,80), style=plot.style_line, linewidth=1, editable=false, title = "Bear parallel guideline")plot(BigLR1 ? high : BigL2 ? BigL_TrendLineMax : na, color=color.new(color.olive,80), style=plot.style_line, linewidth=1, editable=false, title = "Bull parallel guideline")// // plot price lines for trade (parallel lines) (평행선에 매수선 그리기)plot(BigH_Line_Buy2, color=color.new(color.green,80), style = plot.style_linebr, linewidth = 2, title = "Bear Trendline Buy B2")plot(BigH_Line_Buy1, color=color.new(color.green,90), style = plot.style_linebr, linewidth = 1, title = "Bear Trendline Buy B1")plot(BigH_Line_Sell1, color=color.new(color.red,90), style = plot.style_linebr, linewidth = 1, title = "Bear Trendline Sell T1")plot(BigH_Line_Sell2, color=color.new(color.red,80), style = plot.style_linebr, linewidth = 2, title = "Bear Trendline Sell T2")plot(BigL_Line_Buy2, color=color.new(color.green,80), style = plot.style_linebr, linewidth = 2, title = "Bull Trendline Buy B2")plot(BigL_Line_Buy1, color=color.new(color.green,90), style = plot.style_linebr, linewidth = 1, title = "Bull Trendline Buy B1")plot(BigL_Line_Sell1, color=color.new(color.red,90), style = plot.style_linebr, linewidth = 1, title = "Bull Trendline Sell T1")plot(BigL_Line_Sell2, color=color.new(color.red,80), style = plot.style_linebr, linewidth = 2, title = "Bull Trendline Sell T2")// set trendvar trendline_trend = 0 if close > BigH_Line trendline_trend := 1 else if close < BigL_Line trendline_trend := -1 else trendline_trend := 0trendline_trend_color = trendline_trend > 0 ? color.new(color.green,80) : trendline_trend < 0 ? color.new(color.red,80) : nabgcolor(trendline_trend_color , title = "Plot Trendline Trend")// set trigger trendline_longTr = falsetrendline_longExitTr = false trendline_shortTr = false trendline_shortExitTr = false // if trendline_trend == 0 if ta.crossover(close, BigL_Line_Buy1) or ta.crossover(close, BigL_Line_Buy2) trendline_longTr := true if ta.crossunder(close, BigH_Line_Sell1) or ta.crossunder(close, BigH_Line_Sell2) trendline_shortTr := true if ta.crossunder(close, lineTop) trendline_longExitTr := true if ta.crossover(close,lineBot) trendline_shortExitTr := true if trendline_trend == -1 if ta.crossover(close, BigL_Line) or ta.crossover(close, BigL_Line_Sell1) trendline_longTr := true trendline_shortExitTr := true if close < BigL_Line_Sell2 trendline_longExitTr := true if trendline_trend == 1 if ta.crossunder(close, BigH_Line) or ta.crossunder(close, BigH_Line_Buy1) trendline_shortTr := true trendline_longExitTr := true if close > BigH_Line_Buy2 trendline_shortExitTr := true// Lets trade ----------------------------------------------------------------check_long_mode = input.bool(true, title = "Long Mode On!")check_short_mode = input.bool(false, title = "Short Mode On!")if trendline_longTr if check_long_mode strategy.entry("L", strategy.long)else if trendline_shortTr if check_short_mode strategy.entry("S", strategy.short) if trendline_longExitTr strategy.close("L")else if trendline_shortExitTr strategy.close("S")