PSI SQUARE • case study • algorithmic trading

TradingView Multi-Timeframe Strategy with Sentiment Scoring Engine

A TradingView Pine Script strategy combining MSTG trend filtering across three timeframes, Fear and Greed sentiment integration, and a custom weighted indicator scoring engine — generating signals only when trend alignment, sentiment, and scoring thresholds are all met simultaneously.

TradingViewPine ScriptMulti-TimeframeSentimentMSTG
THE CHALLENGE

The challenge

Most TradingView strategies generate signals from a single timeframe and indicator — producing entries that conflict with the broader trend and ignore market-wide sentiment. A trader needed all three layers — trend alignment, sentiment, and multi-indicator scoring — combined into one signal system.

Key Project Constraints & Requirements

Multi-Timeframe Alignment

Must analyse 3 distinct timeframes simultaneously to confirm macro trend direction before validating trade entries.

MSTG Trend Guard Filter

Proprietary Multi-Swing Trend Guard logic filters out low-conviction counter-trend fluctuations.

Fear & Greed Sentiment Integration

Integrates live sentiment index data to prevent buying into overextended euphoria or selling into capitulation.

Weighted Indicator Scoring Engine

Evaluates multiple technical indicators simultaneously with custom weights, firing only when threshold score is reached.

Zero-Repainting Pine Script v5

Built with strict barstate confirmation and clean alert payloads for automated webhook bridging to live brokers.

THE SOLUTION

The solution

A multi-timeframe TradingView strategy combining MSTG trend filtering, Fear and Greed sentiment integration, and a custom indicator scoring engine. Three timeframes are analysed to align trend direction. MSTG logic filters low-quality setups. Live Fear and Greed data avoids trading into market extremes. A weighted scoring engine evaluates multiple indicators and only generates a signal when a configurable score threshold is met. All parameters are fully configurable for backtesting and live use.

Trend Architecture

3-Tier MSTG Trend Filter

Synchronizes higher timeframe structure with lower timeframe entry triggers, blocking counter-trend entries automatically.

Sentiment Analysis

Fear & Greed Sentiment Module

Evaluates market sentiment extremes in real time to pause execution during dangerous market overextensions.

Signal Engine

Weighted Confluence Scoring Core

Calculates dynamic composite score across momentum, trend, and volume indicators against configurable trigger thresholds.

Webhook Integration

Non-Repainting Execution Engine

Ensures strict bar closure verification with webhook JSON alert formatting for MT4/MT5 automation bridges.

THE ARCHITECTURE

Technical architecture

A breakdown of the multi-layered analysis framework, sentiment feeds, and scoring logic engineered for this Pine Script v5 deployment.

Platform
TradingView
Language
Pine Script v5
Timeframes
3 (user-configurable)
Trend filter
MSTG (Multi-Swing Trend Guard) logic
Sentiment
Fear and Greed index integration
Scoring engine
Weighted multi-indicator score with configurable threshold
Signal output
Entry only when all 3 layers align simultaneously
VERIFIED OUTCOME

Verified outcome

Performance impact and signal quality enhancements achieved through 3-tier confluence filtering.

3 layers
Triple alignment
Trend, sentiment, and scoring must align
Configurable
Adaptive parameters
Thresholds and timeframes adjustable per market
High conviction
Quality over quantity
Fewer, significantly higher-quality signals

Enhanced Signal Conviction & Drawdown Reduction

Trade entries are generated only when trend alignment, sentiment conditions, and indicator scoring all meet predefined thresholds simultaneously — significantly reducing low-quality setups. Fully configurable inputs allow tuning for different market conditions.

GET IN TOUCH

Ready to build your TradingView strategy?

Whether you need a custom multi-timeframe Pine Script strategy, sentiment scoring integration, or webhook automation to MT4/MT5 — tell us what you're building. We'll scope it, design it and deliver it to production standard.

Or email info@psi-square.net · Phone +44 (0) 20 3872 7195 · We reply within 24 hours · NDA available on request