OPEN-SOURCE SCRIPT

SFC Bollinger Band and Bandit

65
概述 (Overview)
SFC 布林通道與海盜策略 (SFC Bollinger Band and Bandit Strategy) 是一個基於 Pine Script™ v6 的技術分析指標,結合布林通道 (Bollinger Bands)、移動平均線 (Moving Averages) 以及布林海盜 (Bollinger Bandit) 交易策略,旨在為交易者提供多時間框架的趨勢分析與進出場訊號。該腳本支援風險管理功能,並提供視覺化圖表與交易訊號提示,適用於多種金融市場。
This script, written in Pine Script™ v6, combines Bollinger Bands, Moving Averages, and the Bollinger Bandit strategy to provide traders with multi-timeframe trend analysis and entry/exit signals. It includes risk management features and visualizes data through charts and trading signals, suitable for various financial markets.

功能特點 (Key Features)
布林通道 (Bollinger Bands)
提供可調整的標準差參數 (σ1, σ2),支援多層布林通道顯示。
進場訊號基於價格穿越布林通道上下軌,並結合連續K線確認機制。
Provides adjustable standard deviation parameters (σ1, σ2) for multi-layer Bollinger Bands display.
Entry signals are based on price crossing the upper/lower bands, combined with a consecutive bar confirmation mechanism.

移動平均線 (Moving Averages)
支援簡單移動平均線 (SMA) 或指數移動平均線 (EMA),可自訂快、中、慢線週期。
Supports Simple Moving Average (SMA) or Exponential Moving Average (EMA) with customizable fast, medium, and slow line periods.

布林海盜策略 (Bollinger Bandit Strategy)
基於變動率 (ROC) 與布林通道動態止損,提供做多與做空訊號。
包含動態止損均線與平倉天數設定,增強交易靈活性。
Utilizes Rate of Change (ROC) and Bollinger Bands with dynamic stop-loss for long and short signals.
Includes dynamic stop-loss moving average and liquidation days for enhanced trading flexibility.

多時間框架分析 (Multi-Timeframe Analysis)
支援六個時間框架 (5分、15分、1小時、4小時、日線、週線) 的趨勢分析。
通過表格顯示各時間框架的連續上漲/下跌趨勢,輔助交易決策。
Supports trend analysis across six timeframes (5m, 15m, 1h, 4h, daily, weekly).
Displays consecutive up/down trends in a table to aid decision-making.

風險管理 (Risk Management)
提供基於 ATR 或布林通道的停利/停損設定。
自動計算交易手數,根據報價貨幣匯率調整風險敞口。
Offers take-profit/stop-loss settings based on ATR or Bollinger Bands.
Automatically calculates trading lots, adjusting risk exposure based on quote currency exchange rates.

視覺化與提示 (Visualization and Alerts)
繪製布林通道、移動平均線、海盜策略動態止損線及交易訊號。
提供多時間框架趨勢表格、交易手數標籤及浮水印。
支援交易訊號快訊,方便即時監控。
Plots Bollinger Bands, Moving Averages, Bandit strategy stop-loss lines, and trading signals.
Includes multi-timeframe trend tables, trading lot labels, and watermark.
Supports alert conditions for real-time trade monitoring.

使用說明 (Usage Instructions)
設置參數 (Parameter Setup)
布林通道 (Bollinger Bands): 可調整週期 (預設21)、標準差 (σ1=1, σ2=2) 及停利/停損依據 (ATR 或 BAND)。
移動平均線 (Moving Averages): 可選擇顯示快線 (10)、中線 (20)、慢線 (60),並切換 SMA/EMA。
布林海盜 (Bollinger Bandit): 調整通道週期 (50)、平倉均線週期 (50) 及 ROC 週期 (30)。
時間框架 (Timeframes): 自訂六個時間框架,預設為 5分、15分、1小時、4小時、日線、週線。
Adjust Bollinger Band period (default 21), standard deviations (σ1=1, σ2=2), and take-profit/stop-loss basis (ATR or BAND).
Configure Moving Averages (fast=10, medium=20, slow=60) and toggle SMA/EMA.
Set Bollinger Bandit parameters: channel period (50), liquidation MA period (50), ROC period (30).
Customize six timeframes (default: 5m, 15m, 1h, 4h, daily, weekly).

交易訊號 (Trading Signals)
買入訊號 (Buy): 價格穿越下軌且滿足連續K線條件。
賣出訊號 (Sell): 價格穿越上軌且滿足連續K線條件。
海盜策略訊號: 基於 ROC 與布林通道穿越,結合動態止損。
Buy signal: Price crosses below lower band with consecutive bar confirmation.
Sell signal: Price crosses above upper band with consecutive bar confirmation.
Bandit strategy signals: Based on ROC and band crossings with dynamic stop-loss.

視覺化 (Visualization)
布林通道以不同顏色顯示上下軌與中軌。
移動平均線以快、中、慢線區分顏色。
趨勢表格顯示各時間框架的趨勢狀態 (🔴上漲, 🟢下跌, ⚪中性)。
海盜策略顯示動態止損線與交易狀態。
Bollinger Bands display upper, lower, and middle bands in distinct colors.
Moving Averages use different colors for fast, medium, and slow lines.
Trend table shows timeframe trends (🔴 up, 🟢 down, ⚪ neutral).
Bandit strategy displays dynamic stop-loss and trading status.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.