OPEN-SOURCE SCRIPT
Updated

AI's Opinion Trading System V2

207
1. Complete Summary of the Indicator Script
AI’s Opinion Trading System V2 is an advanced, multi-factor trading tool designed for the TradingView platform. It combines several technical indicators (moving averages, RSI, MACD, ADX, ATR, and volume analysis) to generate buy, sell, and hold signals. The script features a customizable AI “consensus” engine that weighs multiple indicator signals, applies user-defined filters, and outputs actionable trade instructions with clear stop loss and take profit levels. The indicator also tracks sentiment, volume delta, and allows for advanced features like pyramiding (adding to positions), custom stop loss/take profit prices, and flexible signal confirmation logic. All key data and signals are displayed in a dynamic, color-coded table on the chart for easy review.

2. Full Explanation of the Table
The table is a real-time dashboard summarizing the indicator’s logic and recommendations for the most recent bars. It is color-coded for clarity and designed to help traders quickly understand market conditions and AI-driven trade signals.

Columns (from left to right):

Column Name What it Shows
Bar The time context: “Now” for the current bar, then “Bar -1”, “Bar -2”, etc. for previous bars.
Raw Consensus The raw AI consensus for each bar: “Buy”, “Sell”, or “-” (neutral).
Up Vol The amount of volume on up (rising) bars.
Down Vol The amount of volume on down (falling) bars.
Delta The difference between up and down volume. Green if positive, red if negative, gray if neutral.
Close The closing price for each bar, color-coded by price change.
Sentiment Diff The difference between the close and average sentiment price (a custom sentiment calculation).
Lookback The number of bars used for sentiment calculation (if enabled).
ADX The ADX value (trend strength).
ATR The ATR value (volatility measure).
Vol>Avg “Yes” (green) if volume is above average, “No” (red) otherwise.
Confirm Whether the AI signal is confirmed over the required bars.
Logic Output The AI’s interpreted signal after applying user-selected logic: “Buy”, “Sell”, or “-”.
Final Action The final signal after all filters: “Buy”, “Sell”, or “-”.
Trade Instruction A plain-English instruction: Buy/Sell/Add/Hold/No Action, with price, stop loss, and take profit.
Color Coding:

Green: Positive/bullish values or signals
Red: Negative/bearish values or signals
Gray: Neutral or inactive
Blue background: For all table cells, for visual clarity
White text: Default, except for color-coded cells
3. Full User Instructions for Every Input/Style Option
Below are plain-language instructions for every user-adjustable option in the indicator’s input and style pages:

Inputs
Table Location
What it does: Sets where the summary table appears on your chart.
How to use: Choose from 9 positions (Top Left, Top Center, Top Right, etc.) to avoid overlapping with other chart elements.
Decimal Places
What it does: Controls how many decimal places prices and values are displayed with.
How to use: Increase for assets with very small prices (e.g., SHIB), decrease for stocks or forex.
Show Sentiment Lookback?
What it does: Shows or hides the “Lookback” column in the table, which displays how many bars are used in the sentiment calculation.
How to use: Turn off if you want a simpler table.
AI View Mode
What it does: Selects the logic for how the AI combines signals from different indicators.
Majority: Follows the most common signal among all indicators.
Weighted: Uses custom weights for each type of signal.
Custom: Lets you define your own logic (see below).
How to use: Pick the logic style that matches your trading philosophy.
AI Consensus Weight / Vol Delta Weight / Sentiment Weight
What they do: When using “Weighted” AI View Mode, these let you set how much influence each factor (indicator consensus, volume delta, sentiment) has on the final signal.
How to use: Increase a weight to make that factor more important in the AI’s decision.
Custom AI View Logic
What it does: Lets advanced users write their own logic for when the AI should signal a trade (e.g., “ai==1 and delta>0 and sentiment>0”).
How to use: Only use if you understand basic boolean logic.
Use Custom Stop Loss/Take Profit Prices?
What it does: If enabled, you can enter your own fixed stop loss and take profit prices for buys and sells.
How to use: Turn on to override the auto-calculated SL/TP and enter your desired prices below.
Custom Buy/Sell Stop Loss/Take Profit Price
What they do: If custom SL/TP is enabled, these fields let you set exact prices for stop loss and take profit on both buy and sell trades.
How to use: Enter your preferred price, or leave at 0 for auto-calculation.
Sentiment Lookback
What it does: Sets how many bars the sentiment calculation should look back.
How to use: Increase to smooth out sentiment, decrease for faster reaction.
Max Pyramid Adds
What it does: Limits how many times you can add to an existing position (pyramiding).
How to use: Set to 1 for no adds, higher for more aggressive scaling in trends.
Signal Preset
What it does: Quick-sets a group of signal parameters (see below) for “Robust”, “Standard”, “Freedom”, or “Custom”.
How to use: Pick a preset, or select “Custom” to adjust everything manually.
Min Bars for Signal Confirmation
What it does: Sets how many bars a signal must persist before it’s considered valid.
How to use: Increase for more robust, less frequent signals; decrease for faster, but possibly less reliable, signals.
ADX Length
What it does: Sets the period for the ADX (trend strength) calculation.
How to use: Longer = smoother, shorter = more sensitive.
ADX Trend Threshold
What it does: Sets the minimum ADX value to consider a trend “strong.”
How to use: Raise for stricter trend confirmation, lower for more trades.
ATR Length
What it does: Sets the period for the ATR (volatility) calculation.
How to use: Longer = smoother volatility, shorter = more reactive.
Volume Confirmation Lookback
What it does: Sets how many bars are used to calculate the average volume.
How to use: Longer = more stable volume baseline, shorter = more sensitive.
Volume Confirmation Multiplier
What it does: Sets how much current volume must exceed average volume to be considered “high.”
How to use: Increase for stricter volume filter.
RSI Flat Min / RSI Flat Max
What they do: Define the RSI range considered “flat” (i.e., not trending).
How to use: Widen to be stricter about requiring a trend, narrow for more trades.
Style Page
Most style settings (such as plot colors, label sizes, and shapes) are preset in the script for visual clarity.

You can adjust plot visibility and colors (for signals, stop loss, take profit) in the TradingView “Style” tab as with any indicator.

Buy Signal: Shows as a green triangle below the bar when a buy is triggered.
Sell Signal: Shows as a red triangle above the bar when a sell is triggered.
Stop Loss/Take Profit Lines: Red and green lines for SL/TP, visible when a trade is active.
SL/TP Labels: Small colored markers at the SL/TP levels for each trade.
How to use:

Toggle visibility or change colors in the Style tab if you wish to match your chart theme or preferences.
In Summary
This indicator is highly customizable—you can tune every aspect of the AI logic, risk management, signal filtering, and table display to suit your trading style.
The table gives you a real-time, comprehensive view of all relevant signals, filters, and trade instructions.
All inputs are designed to be intuitive—hover over them in TradingView for tooltips, or refer to the explanations above for details.
Release Notes
(NOT TRADING ADVICE. USE AT YOUR OWN RISK. DO YOUR OWN RESEARCH AND TRADE WISELY.)

Purpose of AI’s Opinion Trading System V6
AI’s Opinion Trading System V6 is an advanced, customizable indicator for TradingView that helps traders make systematic decisions by combining multiple classic technical indicators (SMA, EMA, RSI, MACD, ADX, ATR, volume) into a single “AI consensus” signal, displayed in configurable dashboards.

Key Features:
Multi-Indicator Analysis:

Each indicator generates its own buy/sell/neutral signal. These are combined using Majority, Weighted, or Custom logic to form an overall AI consensus.

Signal Filtering & Confirmation:

Additional filters (trend, volatility, volume, RSI flatness) ensure only robust signals are shown. Signals can be set to require persistence over several bars to reduce false positives.

Trade Management:

For each signal, the script provides clear trade instructions (Buy, Sell, Hold, Add, or No Action) and auto-calculates or lets you set custom Stop Loss and Take Profit levels.

Visual Dashboards:

Full Bar Table: Detailed breakdown of signals, filters, and trade instructions for recent bars.
Trade Tracker Table: Summary of the latest signal, price, SL, and TP.
Customizability:

Nearly every aspect—table location, size, bar count, logic, filters, and SL/TP—can be adjusted via dropdowns and inputs, making it suitable for all experience levels.

User Controls & Options
Table Location: Choose where the main and tracker tables appear (9 options each).
Show/Hide Tables: Toggle the full bar and tracker tables on/off.
Table Text Size: Tiny, Small, or Normal.
Number of Dashboard Bars: 3–30, controls table history length.
Decimal Places: 0–10, controls number precision.
Show Sentiment Lookback: Toggle lookback column in the table.
AI Logic & Signal Options
AI View Mode:

Majority: Simple voting.
Weighted: Use custom weights for consensus, volume delta, and sentiment.
Custom: Write your own logic (e.g., ai==1 and delta>0 and sentiment>0).
Preset & Confirmation:

Signal Preset: Robust, Standard, Freedom, or Custom.
Min Bars for Signal Confirmation: Set how many bars a signal must persist.
Custom All Filter Settings: When using Custom preset.
Trade Management
Use Custom SL/TP:
If checked, enter your own SL/TP for buys and sells (0 = ATR-based auto).
Sentiment Lookback:
Set how many bars to use for sentiment calculation.
Max Pyramid Adds:
Control how many times to add to a position in a trend.
How It Works
Calculates all indicators for each bar.
Combines signals into an AI consensus using your chosen logic mode.
Applies filters and confirms signals based on your settings.
Outputs trade instructions and management levels for each bar.
Displays results in fully configurable tables and marks signals on your chart.
Customization Summary
Move tables anywhere on the chart.
Change text size for readability.
Adjust bar count for more or less history.
Fine-tune logic, filters, and confirmation to match your strategy.
Use auto or custom SL/TP for trade management.
Advanced options like pyramiding and sentiment lookback are available.
This script is a flexible decision-support tool, not trading advice. All inputs are accessible from the script’s menu so you can experiment and adapt the tool to your style.

(NOT TRADING ADVICE. USE AT YOUR OWN RISK. DO YOUR OWN RESEARCH AND TRADE WISELY.)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.