PROTECTED SOURCE SCRIPT

coinbot_mr_table

14
이 스크립트는 **"MA 리본(Moving Average Ribbon) 기반 자동매매 전략"**입니다.

이름(coinbot_mr_table)에 모든 기능이 요약되어 있습니다.

coinbot: user_id, exchange, leverage 등 자동매매 봇과 연동하기 위한 웹훅(Webhook) 신호 전송 기능이 포함되어 있습니다.

mr (MA Ribbon): 18개(5~90)의 이동평균선(EMA 또는 SMA)이 100 이평선을 기준으로 정배열/역배열되는지를 색상(LIME/RUBI)으로 구분하여 추세를 판단합니다.

table: 전략의 백테스팅 성과(총 승률, 일일 수익률 등)를 차트 위에 '누적 통계'와 '일일 통계' 테이블로 시각화해 줍니다.

이 스크립트의 매매 로직과 자동매매 신호에 대한 자세한 설명을 한글과 영어로 각각 제공해 드립니다.

🇰🇷 한글 (Korean)
이 스크립트는 **"MA 리본(Moving Average Ribbon)"**을 핵심 엔진으로 사용하는 완전 자동매매(Autotrade) 전략 신호 생성기입니다.

이 지표의 목적은 차트에서 추세를 시각적으로 보여주는 것을 넘어, 구체적인 매매 신호(진입, 분할 익절, 손절)가 발생할 때마다 JSON 형식의 명령어를 자동매매 봇으로 전송하는 것입니다.

1. 📈 매매 전략: MA 리본 추세 추종
이 전략은 18개의 단기/중기 이동평균선(5~90)과 1개의 장기 이동평균선(100)을 사용하여 추세를 정의합니다.

100 이평선: 장기 추세를 가르는 기준선(강/약을 나누는 분수령)입니다.

18개 리본: 이 리본들이 100 이평선 위에서 모두 상승(LIME 색상)하면 '강세 추세', 아래에서 모두 하락(RUBI 색상)하면 '약세 추세'로 판단합니다.

2. 🚦 진입 및 청산 신호
이 전략은 '전환(Reversing)' 전략입니다. 즉, 롱 신호가 발생하면 숏 포지션을 종료하고 롱으로 진입하며, 그 반대도 마찬가지입니다. (항상 롱 또는 숏 포지션을 유지합니다.)

진입 신호 (Long):

추세 확정: 모든 리본이 100 이평선 위에서 '강세(LIME)'로 통일될 때.

재진입 (불타기): 강세 추세 중, 리본이 일시적으로 조정(GREEN)을 보이다가 다시 '강세(LIME)'로 복귀할 때.

진입 신호 (Short):

추세 확정: 모든 리본이 100 이평선 아래에서 '약세(RUBI)'로 통일될 때.

재진입 (물타기): 약세 추세 중, 리본이 일시적으로 반등(MAROON)하다가 다시 '약세(RUBI)'로 복귀할 때.

청산 신호 (자동매매):

진입 (ENTRY): 롱/숏 신호 발생 시, 설정한 user_id, exchange, leverage 등을 포함한 JSON 메시지를 전송합니다.

익절 (TAKE_PROFIT): 롱/숏 포지션이 사용자가 설정한 TP1, TP2, TP3 목표가에 도달하면, 설정된 물량(qty_percent)만큼 분할 익절하라는 JSON 메시지를 전송합니다.

손절 (CLOSE): 포지션이 설정한 sl_percent에 도달하면, 포지션을 즉시 종료하라는 JSON 메시지를 전송합니다.

3. 📊 핵심 기능: 통계 테이블
이 스크립트는 백테스팅 성과를 두 개의 테이블로 요약하여 차트에 실시간으로 표시합니다.

누적 통계 (Total Stats): 전체 기간의 총 진입 횟수, 승/패, 승률(Winrate), 총수익률(Total Profit) 등을 보여줍니다.

일일 통계 (Daily Stats): '오늘' 하루 동안 발생한 매매의 성과(승/패, 승률, 수익률)만 따로 집계하여 보여줍니다.

🇺🇸 영어 (English)
This script is an automated trading (Autotrade) strategy signal generator based on a "Moving Average (MA) Ribbon."

Its purpose extends beyond visual trend analysis; it is designed to generate specific JSON-formatted commands and send them to an automated trading bot whenever a trade signal (entry, take-profit, stop-loss) occurs.

1. 📈 Trading Strategy: MA Ribbon Trend Following
This strategy uses 18 short-to-mid-term Moving Averages (5 to 90) and one long-term Moving Average (100) to define the trend.

100-MA: This acts as the baseline filter, dividing the market into a long-term bull or bear state.

18-MA Ribbon: When all 18 ribbons are above the 100-MA and rising (LIME color), it defines a 'Strong Bull Trend'. When all are below the 100-MA and falling (RUBI color), it defines a 'Strong Bear Trend'.

2. 🚦 Entry and Exit Signals
This is a 'Reversing' strategy. This means when a long signal occurs, it closes any existing short position and enters long, and vice-versa. It is designed to hold a position (either long or short) at all times.

Long Entry Signals:

Trend Confirmation: When all ribbons unify into a 'Strong Bull' (LIME) state above the 100-MA.

Re-entry (Buy the Dip): During a bull trend, if the ribbon shows a temporary pullback (GREEN) and then flips back to 'Strong Bull' (LIME).

Short Entry Signals:

Trend Confirmation: When all ribbons unify into a 'Strong Bear' (RUBI) state below the 100-MA.

Re-entry (Sell the Rally): During a bear trend, if the ribbon shows a temporary rally (MAROON) and then flips back to 'Strong Bear' (RUBI).

Exit Signals (For Automation):

ENTRY: When a long/short signal occurs, it sends a JSON message with the user's user_id, exchange, leverage, etc.

TAKE_PROFIT: When a position reaches the user-defined TP1, TP2, or TP3 price targets, it sends a JSON message to take profit on the specified quantity (qty_percent) for that portion.

CLOSE (Stop-Loss): When a position hits the sl_percent threshold, it sends a JSON message to immediately close the entire position.

3. 📊 Key Feature: Statistics Tables
The script provides two real-time summary tables on the chart to visualize backtesting performance.

Cumulative Stats: Shows lifetime performance, including total trades, wins, losses, win rate, and total profit.

Daily Stats: Isolates and displays the performance metrics (wins, losses, win rate, profit) for "Today's" trading activity only.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.