OPEN-SOURCE SCRIPT
已更新 Dow Theory Cockpit [Final Fixed V15]

1. Evolution History
The system has reached its final form through five distinct development phases:
Phase 1: Logic Development (V1–V6)
Established four core logics: BREAK and DIP (Dow Theory), SNIPER (Reversal), and PUSH (Trend continuation).
Implemented the Multi-Timeframe (MTF) panel and Market Scanner.
Phase 2: Strategy Transition (V7–V9)
Integrated backtesting features, but found the Pine Script calculation load too heavy for real-time charting.
Phase 3: Optimization & Performance (V10–V11)
Prioritized smooth real-time execution by returning to a lightweight indicator format.
Introduced the on-chart stats panel for Win Rate and P&L tracking.
Phase 4: Visual Completion (V12–V13)
High-Vis Fib: Bold orange lines highlighting the Golden Zone (38.2%/61.8%).
Visual Zones: Introduced Green and Red bands for intuitive trade tracking.
Phase 5: Smart Adjust Implementation (V14 - Current)
Barrier Avoidance: Automatically detects nearby Support/Resistance boxes and shortens the TP to secure profits before a potential reversal.
Dynamic RR Optimization: Automatically adjusts the SL in tandem with the shortened TP to maintain a healthy Risk-Reward ratio.
2. Specifications
Name: Dow Theory Cockpit [Smart Adjust V14]
Format: Indicator
Trading Style: Scalping to Day Trading
Timeframes: 5M, 15M (Recommended), 1H
Assets: All pairs (Gold, Crypto, Forex, Indices)
3. Features
① Quad-Logic Entry Signals
🎯 SNIPER: Reversal logic targeting "Tops and Bottoms" when the market is overextended.
🌊 DIP: Trend-following logic for "Deep Pullbacks" with clean Moving Average alignment.
⚡ PUSH: Scalping logic for "Shallow Pullbacks" during high-momentum trends.
🚀 BREAK: Classic Dow Theory momentum entry on recent High/Low breakouts.
② Visual Analysis Tools
S/R BOX: Displays key price levels as shaded zones to account for market noise and wick volatility.
High-Vis Auto Fib: Automatically plots Fibonacci levels, highlighting the Golden Zone with bold lines.
③ Bulletproof Money Management
Calculated Lot Size: Displays the precise lot size based on your account balance and Risk % directly on the signal label.
TP/SL Zones: Dynamic Green and Red bands show exactly where your profit and loss targets lie.
④ Smart Adjust Function (NEW)
Logic: Automatically scans for strong S/R walls near your entry.
Normal Condition: Displays TP/SL at your default Risk-Reward ratio.
Wall Detected: Automatically pulls the TP to the edge of the barrier and tightens the SL to maintain the ratio.
Alert: A "⚠️Adj" warning appears on the label when this adjustment is active.
⑤ Integrated Info Panel
Main Panel: Trends across all timeframes, real-time Win Rate, and Period Net P&L.
Scanner: Constant monitoring of Gold/JPY/BTC and major US/JP economic data.
4. How to Use
Configuration: In the settings under [F. Money Management], input your balance and Risk %. Set your start date in [T. Backtest Period].
Entry Decision: Wait for the "★ BUY" or "★ SELL" label.
"⚠️Adj" displayed: The system has detected a nearby barrier and narrowed the TP/SL for safety. This results in a higher win rate with smaller gains.
No warning: No barriers detected. Targets the default wide Risk-Reward ratio.
Execution: Enter using the exact Lot size on the label. Set your Limit/Stop orders at the provided TP/SL prices.
Exit: The trade concludes when the price reaches the Green or Red zone. Smart Adjust ensures you exit the market before a potential bounce.
1. 大幅なアップデート履歴 (Evolution History)
このシステムは、以下の5つのフェーズを経て完成しました。
フェーズ1:ロジック構築期 (V1〜V6)
ダウ理論に基づく「BREAK」「DIP」に加え、逆張り「SNIPER」、順張り追撃「PUSH」の4つのロジックを搭載。
マルチタイムフレーム(MTF)パネル、市場監視スキャナーの実装。
フェーズ2:ストラテジー化への挑戦 (V7〜V9)
バックテスト機能を搭載したが、Pine Scriptの計算負荷増大によりチャート動作が重くなる問題が発生。
フェーズ3:軽量化と原点回帰 (V10〜V11)
**「実戦での快適さ」**を最優先し、indicator 形式へ戻して超軽量化。
期間損益や勝率を、チャート上のパネルで簡易確認できる仕様に変更。
フェーズ4:視認性の完成 (V12〜V13)
High-Vis Fib: フィボナッチの重要ライン(38.2%/61.8%)を太いオレンジ実線で強調。
Visual Zone: トレード中、チャート上に「緑(利益)/赤(損失)」の帯を表示し、直感的な判断を可能に。
フェーズ5:スマート・アジャスト実装 (V14 - Current)
障害物回避機能: エントリー方向の直近に「逆側のレジサポBOX(壁)」がある場合、TPをその手前に自動短縮し、反発による含み益消滅リスクを回避。
RR自動最適化: TPの短縮に合わせて、最低限のリスクリワード(RR)を維持するようSLも自動調整する機能を搭載。
2. 全体の仕様 (Specifications)
名称: Dow Theory Cockpit [Smart Adjust V14]
形式: インジケーター (Indicator)
※TradingViewの「ストラテジーテスター」タブは使用しません。
推奨スタイル: スキャルピング 〜 デイトレード
推奨時間足: 5分足、15分足(推奨)、1時間足
通貨ペア: 全通貨対応(Gold, Crypto, Forex, Index)
3. 特徴と機能 (Features)
① 4つの「高期待値」エントリーロジック
相場の状況に合わせて最適なサインが点灯します。
🎯 SNIPER: 行き過ぎた相場の反転(天底)を狙う逆張り。
🌊 DIP: 移動平均線の並びが良い状態での「深い押し目」を拾う順張り。
⚡ PUSH: 強いトレンド(ADX上昇中)の「浅い押し目」で飛び乗るスキャルピング用。
🚀 BREAK: ダウ理論の基本、直近高値・安値ブレイクでのエントリー。
② 視覚的環境認識ツール
レジサポ BOX: 重要価格帯を「面(ボックス)」で表示。ヒゲのダマシを許容します。
High-Vis Auto Fib: 直近の波を検知し、38.2%/61.8%(ゴールデンゾーン)を太線で強調表示。
③ 鉄壁の資金管理 (Money Management)
推奨ロット表示: 口座資金と許容リスク(%)に基づき、適正ロット数を自動計算して表示します。
TP/SL ゾーン: エントリー中、チャート上に「利確までの緑の帯」と「損切までの赤の帯」が表示され、価格の進行度合いが一目で分かります。
④ スマート・アジャスト機能 (Smart Adjust) ★NEW
機能: エントリー時、目標地点の手前に「強力なレジサポBOX」があるかを自動検知します。
動作:
通常時: 設定通りのRR(2.5倍など)でTP/SLを表示。
壁がある時: **「壁の手前」**にTPを引き下げ、それに合わせてSLも浅く調整します。
表示: 調整が行われた場合、ラベルに 「⚠️Adj(調整済み)」 と警告が出ます。
⑤ 情報集約パネル
Main Panel: 全時間足のトレンド方向、直近の勝率、期間内の純損益を表示。
Scanner: Gold / JPY / BTC の動向と、日米経済指標を常時監視。
4. 使い方 (How to Use)
STEP 1: 初期設定
インジケーター設定の 【F. 資金管理】 を開き、口座資金 と リスク(%) を入力します。
【T. バックテスト期間】 で損益計算を開始したい日付を設定します。
STEP 2: エントリー判断
チャートに 「★ BUY」 または 「★ SELL」 のラベルが出現するのを待ちます。
ラベルの確認:
「⚠️Adj」 と出ている場合 → 「近くに壁があるため、TP/SLを狭く調整しました」という意味です。勝率は上がりますが、値幅は小さくなります。
何も出ていない場合 → 「障害物なし。通常のRRで大きく狙います」という意味です。
STEP 3: 注文 (Execution)
ラベルの数値を信頼して注文を出します。
Lot: 表示された数量を入力。
TP/SL: 表示された価格に指値・逆指値を置く。
STEP 4: 決済 (Exit)
チャート上の 「緑の帯(TP)」 か 「赤の帯(SL)」 にローソク足が到達したら決済です。
**「スマートアジャスト」により、壁の手前で利確設定されているため、「反発して戻ってくる前に逃げ切る」**ことができます。
The system has reached its final form through five distinct development phases:
Phase 1: Logic Development (V1–V6)
Established four core logics: BREAK and DIP (Dow Theory), SNIPER (Reversal), and PUSH (Trend continuation).
Implemented the Multi-Timeframe (MTF) panel and Market Scanner.
Phase 2: Strategy Transition (V7–V9)
Integrated backtesting features, but found the Pine Script calculation load too heavy for real-time charting.
Phase 3: Optimization & Performance (V10–V11)
Prioritized smooth real-time execution by returning to a lightweight indicator format.
Introduced the on-chart stats panel for Win Rate and P&L tracking.
Phase 4: Visual Completion (V12–V13)
High-Vis Fib: Bold orange lines highlighting the Golden Zone (38.2%/61.8%).
Visual Zones: Introduced Green and Red bands for intuitive trade tracking.
Phase 5: Smart Adjust Implementation (V14 - Current)
Barrier Avoidance: Automatically detects nearby Support/Resistance boxes and shortens the TP to secure profits before a potential reversal.
Dynamic RR Optimization: Automatically adjusts the SL in tandem with the shortened TP to maintain a healthy Risk-Reward ratio.
2. Specifications
Name: Dow Theory Cockpit [Smart Adjust V14]
Format: Indicator
Trading Style: Scalping to Day Trading
Timeframes: 5M, 15M (Recommended), 1H
Assets: All pairs (Gold, Crypto, Forex, Indices)
3. Features
① Quad-Logic Entry Signals
🎯 SNIPER: Reversal logic targeting "Tops and Bottoms" when the market is overextended.
🌊 DIP: Trend-following logic for "Deep Pullbacks" with clean Moving Average alignment.
⚡ PUSH: Scalping logic for "Shallow Pullbacks" during high-momentum trends.
🚀 BREAK: Classic Dow Theory momentum entry on recent High/Low breakouts.
② Visual Analysis Tools
S/R BOX: Displays key price levels as shaded zones to account for market noise and wick volatility.
High-Vis Auto Fib: Automatically plots Fibonacci levels, highlighting the Golden Zone with bold lines.
③ Bulletproof Money Management
Calculated Lot Size: Displays the precise lot size based on your account balance and Risk % directly on the signal label.
TP/SL Zones: Dynamic Green and Red bands show exactly where your profit and loss targets lie.
④ Smart Adjust Function (NEW)
Logic: Automatically scans for strong S/R walls near your entry.
Normal Condition: Displays TP/SL at your default Risk-Reward ratio.
Wall Detected: Automatically pulls the TP to the edge of the barrier and tightens the SL to maintain the ratio.
Alert: A "⚠️Adj" warning appears on the label when this adjustment is active.
⑤ Integrated Info Panel
Main Panel: Trends across all timeframes, real-time Win Rate, and Period Net P&L.
Scanner: Constant monitoring of Gold/JPY/BTC and major US/JP economic data.
4. How to Use
Configuration: In the settings under [F. Money Management], input your balance and Risk %. Set your start date in [T. Backtest Period].
Entry Decision: Wait for the "★ BUY" or "★ SELL" label.
"⚠️Adj" displayed: The system has detected a nearby barrier and narrowed the TP/SL for safety. This results in a higher win rate with smaller gains.
No warning: No barriers detected. Targets the default wide Risk-Reward ratio.
Execution: Enter using the exact Lot size on the label. Set your Limit/Stop orders at the provided TP/SL prices.
Exit: The trade concludes when the price reaches the Green or Red zone. Smart Adjust ensures you exit the market before a potential bounce.
1. 大幅なアップデート履歴 (Evolution History)
このシステムは、以下の5つのフェーズを経て完成しました。
フェーズ1:ロジック構築期 (V1〜V6)
ダウ理論に基づく「BREAK」「DIP」に加え、逆張り「SNIPER」、順張り追撃「PUSH」の4つのロジックを搭載。
マルチタイムフレーム(MTF)パネル、市場監視スキャナーの実装。
フェーズ2:ストラテジー化への挑戦 (V7〜V9)
バックテスト機能を搭載したが、Pine Scriptの計算負荷増大によりチャート動作が重くなる問題が発生。
フェーズ3:軽量化と原点回帰 (V10〜V11)
**「実戦での快適さ」**を最優先し、indicator 形式へ戻して超軽量化。
期間損益や勝率を、チャート上のパネルで簡易確認できる仕様に変更。
フェーズ4:視認性の完成 (V12〜V13)
High-Vis Fib: フィボナッチの重要ライン(38.2%/61.8%)を太いオレンジ実線で強調。
Visual Zone: トレード中、チャート上に「緑(利益)/赤(損失)」の帯を表示し、直感的な判断を可能に。
フェーズ5:スマート・アジャスト実装 (V14 - Current)
障害物回避機能: エントリー方向の直近に「逆側のレジサポBOX(壁)」がある場合、TPをその手前に自動短縮し、反発による含み益消滅リスクを回避。
RR自動最適化: TPの短縮に合わせて、最低限のリスクリワード(RR)を維持するようSLも自動調整する機能を搭載。
2. 全体の仕様 (Specifications)
名称: Dow Theory Cockpit [Smart Adjust V14]
形式: インジケーター (Indicator)
※TradingViewの「ストラテジーテスター」タブは使用しません。
推奨スタイル: スキャルピング 〜 デイトレード
推奨時間足: 5分足、15分足(推奨)、1時間足
通貨ペア: 全通貨対応(Gold, Crypto, Forex, Index)
3. 特徴と機能 (Features)
① 4つの「高期待値」エントリーロジック
相場の状況に合わせて最適なサインが点灯します。
🎯 SNIPER: 行き過ぎた相場の反転(天底)を狙う逆張り。
🌊 DIP: 移動平均線の並びが良い状態での「深い押し目」を拾う順張り。
⚡ PUSH: 強いトレンド(ADX上昇中)の「浅い押し目」で飛び乗るスキャルピング用。
🚀 BREAK: ダウ理論の基本、直近高値・安値ブレイクでのエントリー。
② 視覚的環境認識ツール
レジサポ BOX: 重要価格帯を「面(ボックス)」で表示。ヒゲのダマシを許容します。
High-Vis Auto Fib: 直近の波を検知し、38.2%/61.8%(ゴールデンゾーン)を太線で強調表示。
③ 鉄壁の資金管理 (Money Management)
推奨ロット表示: 口座資金と許容リスク(%)に基づき、適正ロット数を自動計算して表示します。
TP/SL ゾーン: エントリー中、チャート上に「利確までの緑の帯」と「損切までの赤の帯」が表示され、価格の進行度合いが一目で分かります。
④ スマート・アジャスト機能 (Smart Adjust) ★NEW
機能: エントリー時、目標地点の手前に「強力なレジサポBOX」があるかを自動検知します。
動作:
通常時: 設定通りのRR(2.5倍など)でTP/SLを表示。
壁がある時: **「壁の手前」**にTPを引き下げ、それに合わせてSLも浅く調整します。
表示: 調整が行われた場合、ラベルに 「⚠️Adj(調整済み)」 と警告が出ます。
⑤ 情報集約パネル
Main Panel: 全時間足のトレンド方向、直近の勝率、期間内の純損益を表示。
Scanner: Gold / JPY / BTC の動向と、日米経済指標を常時監視。
4. 使い方 (How to Use)
STEP 1: 初期設定
インジケーター設定の 【F. 資金管理】 を開き、口座資金 と リスク(%) を入力します。
【T. バックテスト期間】 で損益計算を開始したい日付を設定します。
STEP 2: エントリー判断
チャートに 「★ BUY」 または 「★ SELL」 のラベルが出現するのを待ちます。
ラベルの確認:
「⚠️Adj」 と出ている場合 → 「近くに壁があるため、TP/SLを狭く調整しました」という意味です。勝率は上がりますが、値幅は小さくなります。
何も出ていない場合 → 「障害物なし。通常のRRで大きく狙います」という意味です。
STEP 3: 注文 (Execution)
ラベルの数値を信頼して注文を出します。
Lot: 表示された数量を入力。
TP/SL: 表示された価格に指値・逆指値を置く。
STEP 4: 決済 (Exit)
チャート上の 「緑の帯(TP)」 か 「赤の帯(SL)」 にローソク足が到達したら決済です。
**「スマートアジャスト」により、壁の手前で利確設定されているため、「反発して戻ってくる前に逃げ切る」**ことができます。
版本注释
Dow & Granville AI-Cockpit [Trend Master V31.15]System Manual / システムマニュアル
1. System Overview / システム概要
English This indicator is a high-precision trend-following system that combines classical technical analysis (Dow Theory and Granville's Laws) with modern AI Adaptive Logic. It automatically monitors the win rate of the strategy in the background. If the win rate drops, the AI switches to "Defensive Mode," tightening entry filters and adjusting Risk-Reward (RR) ratios to protect capital. It includes a multi-currency scanner, economic indicators, and a comprehensive dashboard.
Japanese 本インジケーターは、古典的なテクニカル分析である**「ダウ理論」と「グランビルの法則」に、最新の「AI適応型ロジック」**を融合させた高精度トレンドフォローシステムです。 バックグラウンドで戦略の勝率を常時監視し、勝率が低下するとAIが自動的に「防御モード」へ移行。エントリーフィルターを厳格化し、リスクリワード(RR)を調整して資金を守ります。多通貨スキャナーや経済指標パネルも搭載した統合型コックピットです。
2. Key Features / 主な特徴
A. Dual Entry Logic / 2つのエントリーロジック
Dow Theory Breakout: Detects trend continuation when prices break recent highs (buy) or lows (sell) with higher lows/lower highs structure.
Granville’s Law: Identifies high-probability entries at pullbacks (dips) and rebounds from the 20 EMA/80 SMA ribbon.
ダウ理論ブレイク: 安値切り上げ時の高値ブレイク(買い)、高値切り下げ時の安値ブレイク(売り)によるトレンド継続を検知します。
グランビルの法則: 20 EMA/80 SMAリボンに対する押し目買い・戻り売りを高確率で捉えます。
B. AI Adaptive Function / AIアダプティブ(自動調整)機能
Win Rate Monitoring: Calculates the simulated win rate in real-time.
Defensive Mode: If the win rate falls below the target (default 50%), the system automatically:
Lowers the Take Profit target (Lower RR) to secure wins.
Increases the required ADX threshold to avoid weak trends.
勝率監視: リアルタイムでシミュレーション勝率を計算します。
防御モード: 勝率が目標値(デフォルト50%)を下回ると、AIが自動的に以下の調整を行います:
利確目標(RR)を下げ、確実に利益を確保する設定に変更。
必要なADX値を引き上げ、弱いトレンドでのエントリーを拒否。
C. Advanced Filters / 高度なフィルター群
Choppiness Index: Completely blocks signals during ranging/choppy markets.
MTF Filter: Aligns entries with higher timeframe trends (e.g., 1-hour or 4-hour).
Smart Adjust: Automatically adjusts TP/SL levels to avoid obstacles like previous support/resistance.
レンジ完全回避: Choppiness Index(CHOP)を使用し、レンジ相場でのサインを完全にブロックします。
MTFフィルター: 上位足(1時間足や4時間足)のトレンド方向と一致する場合のみエントリーします。
スマートアジャスト: 直近のレジサポライン等の「障害物」を検知し、TP/SLを自動で微調整します。
3. How to Use / 使い方
English
Setup: Apply the indicator to your chart (Recommended: 15m or 1h timeframe).
Check Dashboard: Look at the panel.
Green (AGGRESSIVE): Trend is clear. Standard RR is applied.
Orange (DEFENSIVE): Market conditions are tough. AI has tightened settings.
Entry: Wait for a "▲ (BUY)" or "▼ (SELL)" signal.
Bar Color: Bright bars indicate a confirmed signal. Grey/Transparent bars indicate weak trends.
Exit:
Use the TP/SL lines displayed on the chart.
Alternatively, follow the Purple Dotted Line (ATR Trailing Stop) to maximize profits.
Japanese
セットアップ: チャートにインジケーターを適用します(推奨:15分足または1時間足)。
ダッシュボード確認: パネルのステータスを見ます。
緑 (AGGRESSIVE): トレンドが出ています。通常の利益幅を狙います。
オレンジ (DEFENSIVE): 相場状況が悪化しています。AIが設定を厳しくしています。
エントリー: **「▲(買い)」または「▼(売り)」**のサインでエントリーします。
バーの色: 明るい色は確定サイン、グレー/半透明はトレンドが弱いことを示唆します。
決済:
チャートに表示されるTP(利確)/ SL(損切り)ラインに従います。
または、**紫の点線(ATRトレーリングストップ)**を活用して、利益を最大限伸ばします。
4. Update History / アップデート履歴
[V31.15] - Current Version / 最新版
Fixed: Completely refactored the code structure to resolve "Syntax error at input b_sl_final".
Optimization: Logic calculation blocks separated from variable definitions for maximum stability.
修正: b_sl_final 等で発生していたシンタックスエラーを解消するため、コード構造を完全に再構築。
最適化: 変数定義とロジック計算ブロックを分離し、動作の安定性を最大化。
[V31.13 - 31.14]
Added: MACD Momentum Filter.
Added: ATR Trailing Stop (Chandelier Exit) line.
Improved: Bar coloring logic now visualizes Trend Up/Down/Neutral even without entry signals.
追加: MACD勢いフィルターを搭載。
追加: ATRトレーリングストップ(シャンデリア・イグジット)線を表示。
改善: バーの色塗りを強化。エントリー時以外も「上昇/下降/レンジ」を色で視認可能に。
[V31.12]
Restored: Full Dashboard & Scanner features (Win Rates, 3-Currency Scan, Economy).
Adjusted: AI now focuses on adjusting Risk-Reward (RR) rather than hiding signals, ensuring trading opportunities.
復旧: ダッシュボードとスキャナーの全機能(詳細勝率、3通貨監視、経済指標)を復活。
調整: AIの挙動を変更。サインを消すのではなく「RR(利幅)を調整する」仕様にし、チャンスを維持。
[V31.8 - 31.11]
New Feature: Implemented "AI Adaptive Logic" (Auto-tuning based on real-time win rate).
New Filter: Added Choppiness Index for range avoidance.
Fixed: Resolved multiple variable declaration errors.
新機能: 「AIアダプティブ機能」(リアルタイム勝率に基づく自動チューニング)を実装。
新フィルター: レンジ回避のためのChoppiness Indexを追加。
修正: 複数の変数定義エラーを修正。
[V31.5]
Added: Multi-Timeframe (MTF) Support/Resistance lines derived from higher timeframe pivots.
追加: 上位足のピボットに基づいたMTFレジサポライン描画機能を追加。
[V31.0 - 31.4]
Base: Initial release of Dow Theory & Granville's Law logic.
基盤: ダウ理論とグランビルの法則を組み合わせた基本ロジックの実装。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。