james S/R Trend Pro v6 — Strategy by Kingjmaes

By version

Performance Metrics

Description

//version=6strategy("james S/R Trend Pro v6", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.05, slippage=1)// --- 사용자 입력 (Inputs) ---group_date = "1. 백테스트 기간"start_date = input.time(timestamp("2024-01-01 00:00:00"), "시작일", group=group_date)end_date = input.time(timestamp("2026-12-31 23:59:59"), "종료일", group=group_date)is_within_date = time >= start_date and time 0 and ta.crossunder(close, res_line)// --- 주문 실행 (Execution) ---if is_within_date if long_condition strategy.entry("Long", strategy.long, comment="BUY") if short_condition strategy.entry("Short", strategy.short, comment="SHORT") // 청산 로직 if strategy.position_size > 0 strategy.exit("TP-L", "Long", limit=res_line, qty_percent=50, comment="분할익절") if ta.crossunder(close, trend_line) strategy.close("Long", comment="추세이탈") if strategy.position_size < 0 strategy.exit("TP-S", "Short", limit=sup_line, qty_percent=50, comment="분할익절") if ta.crossover(close, trend_line) strategy.close("Short", comment="추세이탈")// --- 시각화 (Visualization - 다크 모드 최적화) ---// 1. 추세선: 검은 배경에서 잘 보이도록 하얀색/회색 계열 사용plot(trend_line, color=direction < 0 ? trend_up_color : trend_down_color, linewidth=2, title="Trend Line")// 2. 지지/저항선: 네온 컬러로 시인성 극대화plot(res_line, color=color.new(res_color, 0), style=plot.style_linebr, linewidth=2, title="Resistance")plot(sup_line, color=color.new(sup_color, 0), style=plot.style_linebr, linewidth=2, title="Support")// 3. 진입 시그널 라벨plotshape(long_condition, style=shape.triangleup, location=location.belowbar, color=sup_color, size=size.small, title="Buy Label")plotshape(short_condition, style=shape.triangledown, location=location.abovebar, color=res_color, size=size.small, title="Short Label")// 4. 추세 배경색 (매우 옅게 설정하여 캔들을 방해하지 않음)fill_color = direction < 0 ? color.new(sup_color, 90) : color.new(res_color, 90)fill(plot(trend_line), plot(close), color=fill_color, title="Trend Fill")

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView