OPEN-SOURCE SCRIPT
Roy Gravity Matrix AI

ROY GRAVITY MATRIX AI
Roy Gravity Matrix AI is an advanced multi-timeframe mathematical trading engine designed to analyze market gravity, trend structure, momentum alignment, and directional pressure using adaptive EMA matrix calculations.
Unlike traditional EMA indicators that focus only on a single timeframe, Roy Gravity Matrix AI combines multiple timeframes and multiple EMA layers into one adaptive AI-driven matrix system.
The indicator is built around the concept of:
“Higher timeframe gravity controls lower timeframe movement.”
This means larger market structure from higher timeframes such as H4 and Daily carries stronger influence over smaller timeframes like M1 and M5.
The system transforms bullish and bearish market conditions into weighted mathematical scores to detect:
• Market Gravity
• Trend Alignment
• Momentum Strength
• Pullback Conditions
• Expansion Phases
• Smart Entry Timing
━━━━━━━━━━━━━━━━━━
FEATURES
━━━━━━━━━━━━━━━━━━
• Adaptive Main Timeframe System
• Multi-Timeframe EMA Matrix
• EMA 10 / 20 / 50 / 100 / 200 Analysis
• Gravity Trend Engine
• Mathematical Trend Scoring
• AI Market Bias Detection
• AI Market Phase Detection
• Smart Buy & Sell Signals
• Confidence Percentage System
• Bullish & Bearish Heatmap
• Mobile-Friendly Compact Dashboard
• Lightweight Optimized Performance
━━━━━━━━━━━━━━━━━━
ADAPTIVE MAIN TIMEFRAME
━━━━━━━━━━━━━━━━━━
Traders can select their preferred main trading timeframe:
• M1
• M5
• M15
• M30
• H1
• H4
• Daily
The AI engine automatically adjusts:
• Gravity Timeframes
• Trigger Timeframes
• Momentum Structure
• Entry Logic
based on the selected trading style.
Example:
If Main TF = M15:
• Gravity = H1 + H4
• Momentum = M15
• Trigger = M5 + M1
If Main TF = H1:
• Gravity = H4 + Daily
• Momentum = H1
• Trigger = M15 + M30
━━━━━━━━━━━━━━━━━━
HOW IT WORKS
━━━━━━━━━━━━━━━━━━
Each EMA and timeframe combination is converted into a weighted mathematical value.
Bullish conditions produce positive values.
Bearish conditions produce negative values.
Higher EMAs and higher timeframes carry stronger weight in the final score calculation.
This creates a market gravity system capable of identifying:
• True dominant trend
• Pullbacks against trend
• Trend continuation
• Weak trend conditions
• Expansion momentum
• Reversal pressure
━━━━━━━━━━━━━━━━━━
MARKET PHASES
━━━━━━━━━━━━━━━━━━
• BULL EXP → Strong bullish expansion
• BULL PULL → Bullish pullback
• BEAR EXP → Strong bearish expansion
• BEAR PULL → Bearish pullback
• MIXED → Sideway or conflicting structure
━━━━━━━━━━━━━━━━━━
SIGNAL LOGIC
━━━━━━━━━━━━━━━━━━
BUY Signal:
• Overall score bullish
• Main timeframe bullish
• Trigger timeframe confirms momentum
• Gravity trend aligned bullish
SELL Signal:
• Overall score bearish
• Main timeframe bearish
• Trigger timeframe confirms downside momentum
• Gravity trend aligned bearish
━━━━━━━━━━━━━━━━━━
BEST USED FOR
━━━━━━━━━━━━━━━━━━
• Scalping
• Intraday Trading
• Swing Trading
• Trend Following
• Momentum Trading
• Gold (XAUUSD)
• Forex
• Crypto
• Indices
━━━━━━━━━━━━━━━━━━
CORE CONCEPT
━━━━━━━━━━━━━━━━━━
Roy Gravity Matrix AI is designed around the idea that market movement behaves similarly to gravity.
Higher timeframe trends pull lower timeframe movement toward the dominant market direction.
This creates a smarter way to analyze market structure beyond traditional EMA crossover systems.
The indicator combines:
• Trend Gravity
• Momentum Structure
• Adaptive Timeframe Logic
• Mathematical Scoring
• Multi-Timeframe Alignment
• AI Market Interpretation
into a single professional trading engine.
Roy Gravity Matrix AI is an advanced multi-timeframe mathematical trading engine designed to analyze market gravity, trend structure, momentum alignment, and directional pressure using adaptive EMA matrix calculations.
Unlike traditional EMA indicators that focus only on a single timeframe, Roy Gravity Matrix AI combines multiple timeframes and multiple EMA layers into one adaptive AI-driven matrix system.
The indicator is built around the concept of:
“Higher timeframe gravity controls lower timeframe movement.”
This means larger market structure from higher timeframes such as H4 and Daily carries stronger influence over smaller timeframes like M1 and M5.
The system transforms bullish and bearish market conditions into weighted mathematical scores to detect:
• Market Gravity
• Trend Alignment
• Momentum Strength
• Pullback Conditions
• Expansion Phases
• Smart Entry Timing
━━━━━━━━━━━━━━━━━━
FEATURES
━━━━━━━━━━━━━━━━━━
• Adaptive Main Timeframe System
• Multi-Timeframe EMA Matrix
• EMA 10 / 20 / 50 / 100 / 200 Analysis
• Gravity Trend Engine
• Mathematical Trend Scoring
• AI Market Bias Detection
• AI Market Phase Detection
• Smart Buy & Sell Signals
• Confidence Percentage System
• Bullish & Bearish Heatmap
• Mobile-Friendly Compact Dashboard
• Lightweight Optimized Performance
━━━━━━━━━━━━━━━━━━
ADAPTIVE MAIN TIMEFRAME
━━━━━━━━━━━━━━━━━━
Traders can select their preferred main trading timeframe:
• M1
• M5
• M15
• M30
• H1
• H4
• Daily
The AI engine automatically adjusts:
• Gravity Timeframes
• Trigger Timeframes
• Momentum Structure
• Entry Logic
based on the selected trading style.
Example:
If Main TF = M15:
• Gravity = H1 + H4
• Momentum = M15
• Trigger = M5 + M1
If Main TF = H1:
• Gravity = H4 + Daily
• Momentum = H1
• Trigger = M15 + M30
━━━━━━━━━━━━━━━━━━
HOW IT WORKS
━━━━━━━━━━━━━━━━━━
Each EMA and timeframe combination is converted into a weighted mathematical value.
Bullish conditions produce positive values.
Bearish conditions produce negative values.
Higher EMAs and higher timeframes carry stronger weight in the final score calculation.
This creates a market gravity system capable of identifying:
• True dominant trend
• Pullbacks against trend
• Trend continuation
• Weak trend conditions
• Expansion momentum
• Reversal pressure
━━━━━━━━━━━━━━━━━━
MARKET PHASES
━━━━━━━━━━━━━━━━━━
• BULL EXP → Strong bullish expansion
• BULL PULL → Bullish pullback
• BEAR EXP → Strong bearish expansion
• BEAR PULL → Bearish pullback
• MIXED → Sideway or conflicting structure
━━━━━━━━━━━━━━━━━━
SIGNAL LOGIC
━━━━━━━━━━━━━━━━━━
BUY Signal:
• Overall score bullish
• Main timeframe bullish
• Trigger timeframe confirms momentum
• Gravity trend aligned bullish
SELL Signal:
• Overall score bearish
• Main timeframe bearish
• Trigger timeframe confirms downside momentum
• Gravity trend aligned bearish
━━━━━━━━━━━━━━━━━━
BEST USED FOR
━━━━━━━━━━━━━━━━━━
• Scalping
• Intraday Trading
• Swing Trading
• Trend Following
• Momentum Trading
• Gold (XAUUSD)
• Forex
• Crypto
• Indices
━━━━━━━━━━━━━━━━━━
CORE CONCEPT
━━━━━━━━━━━━━━━━━━
Roy Gravity Matrix AI is designed around the idea that market movement behaves similarly to gravity.
Higher timeframe trends pull lower timeframe movement toward the dominant market direction.
This creates a smarter way to analyze market structure beyond traditional EMA crossover systems.
The indicator combines:
• Trend Gravity
• Momentum Structure
• Adaptive Timeframe Logic
• Mathematical Scoring
• Multi-Timeframe Alignment
• AI Market Interpretation
into a single professional trading engine.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน