RSI Full [Titans_Invest]RSI Full
One of the most complete RSI indicators on the market.
While maintaining the classic RSI foundation, our indicator integrates multiple entry conditions to generate more accurate buy and sell signals.
All conditions are fully configurable, allowing complete customization to fit your trading strategy.
⯁ WHAT IS THE RSI❓
The Relative Strength Index (RSI) is a technical analysis indicator developed by J. Welles Wilder. It measures the magnitude of recent price movements to evaluate overbought or oversold conditions in a market. The RSI is an oscillator that ranges from 0 to 100 and is commonly used to identify potential reversal points, as well as the strength of a trend.
⯁ HOW TO USE THE RSI❓
The RSI is calculated based on average gains and losses over a specified period (usually 14 periods). It is plotted on a scale from 0 to 100 and includes three main zones:
Overbought: When the RSI is above 70, indicating that the asset may be overbought.
Oversold: When the RSI is below 30, indicating that the asset may be oversold.
Neutral Zone: Between 30 and 70, where there is no clear signal of overbought or oversold conditions.
⯁ ENTRY CONDITIONS
The conditions below are fully flexible and allow for complete customization of the signal.
______________________________________________________
🔹 CONDITIONS TO BUY 📈
______________________________________________________
• Signal Validity: The signal will remain valid for X bars .
• Signal Sequence: Configurable as AND/OR .
📈 RSI Conditions:
🔹 RSI > Upper
🔹 RSI < Upper
🔹 RSI > Lower
🔹 RSI < Lower
🔹 RSI > Middle
🔹 RSI < Middle
🔹 RSI > MA
🔹 RSI < MA
📈 MA Conditions:
🔹 MA > Upper
🔹 MA < Upper
🔹 MA > Lower
🔹 MA < Lower
📈 Crossovers:
🔹 RSI (Crossover) Upper
🔹 RSI (Crossunder) Upper
🔹 RSI (Crossover) Lower
🔹 RSI (Crossunder) Lower
🔹 RSI (Crossover) Middle
🔹 RSI (Crossunder) Middle
🔹 RSI (Crossover) MA
🔹 RSI (Crossunder) MA
🔹 MA (Crossover) Upper
🔹 MA (Crossunder) Upper
🔹 MA (Crossover) Lower
🔹 MA (Crossunder) Lower
📈 RSI Divergences:
🔹 RSI Divergence Bull
🔹 RSI Divergence Bear
______________________________________________________
______________________________________________________
🔸 CONDITIONS TO SELL 📉
______________________________________________________
• Signal Validity: The signal will remain valid for X bars .
• Signal Sequence: Configurable as AND/OR .
📉 RSI Conditions:
🔸 RSI > Upper
🔸 RSI < Upper
🔸 RSI > Lower
🔸 RSI < Lower
🔸 RSI > Middle
🔸 RSI < Middle
🔸 RSI > MA
🔸 RSI < MA
📉 MA Conditions:
🔸 MA > Upper
🔸 MA < Upper
🔸 MA > Lower
🔸 MA < Lower
📉 Crossovers:
🔸 RSI (Crossover) Upper
🔸 RSI (Crossunder) Upper
🔸 RSI (Crossover) Lower
🔸 RSI (Crossunder) Lower
🔸 RSI (Crossover) Middle
🔸 RSI (Crossunder) Middle
🔸 RSI (Crossover) MA
🔸 RSI (Crossunder) MA
🔸 MA (Crossover) Upper
🔸 MA (Crossunder) Upper
🔸 MA (Crossover) Lower
🔸 MA (Crossunder) Lower
📉 RSI Divergences:
🔸 RSI Divergence Bull
🔸 RSI Divergence Bear
______________________________________________________
______________________________________________________
🤖 AUTOMATION 🤖
• You can automate the BUY and SELL signals of this indicator.
______________________________________________________
______________________________________________________
⯁ UNIQUE FEATURES
______________________________________________________
Signal Validity: The signal will remain valid for X bars
Signal Sequence: Configurable as AND/OR
Condition Table: BUY/SELL
Condition Labels: BUY/SELL
Plot Labels in the Graph Above: BUY/SELL
Automate and Monitor Signals/Alerts: BUY/SELL
Signal Validity: The signal will remain valid for X bars
Signal Sequence: Configurable as AND/OR
Condition Table: BUY/SELL
Condition Labels: BUY/SELL
Plot Labels in the Graph Above: BUY/SELL
Automate and Monitor Signals/Alerts: BUY/SELL
______________________________________________________
📜 SCRIPT : RSI Full
🎴 Art by : @Titans_Invest & @DiFlip
👨💻 Dev by : @Titans_Invest & @DiFlip
🎑 Titans Invest — The Wizards Without Gloves 🧤
✨ Enjoy the Spell!
______________________________________________________
o Mission 🗺
• Inspire Traders to manifest Magic in the Market.
o Vision 𐓏
• To elevate collective Energy 𐓷𐓏
Pine Dienstprogramme
TrendTwisterV1.5 (Forex Ready + Indicators)A Precision Trend-Following TradingView Strategy for Forex**
HullShiftFX is a Pine Script strategy for TradingView that combines the power of the **Hull Moving Average (HMA)** and a **shifted Exponential Moving Average (EMA)** with multi-layered momentum filters including **RSI** and **dual Stochastic Oscillators**.
It’s designed for traders looking to catch high-probability breakouts with tight risk management and visual clarity.
Chart settings:
1. Select "Auto - Fits data to screen"
2. Please Select "Scale Price Chart Only" (To make the chart not squished)
### ✅ Entry Conditions
**Long Position:**
- Price closes above the 12-period Hull Moving Average.
- Price closes above the 5-period EMA shifted forward by 2 bars.
- RSI is above 50.
- Stochastic Oscillator (12,3,3) %K is above 50.
- Stochastic Oscillator (5,3,3) %K is above 50.
- Hull MA crosses above the shifted EMA.
**Short Position:**
- Price closes below the 12-period Hull Moving Average.
- Price closes below the 5-period EMA shifted forward by 2 bars.
- RSI is below 50.
- Stochastic Oscillator (12,3,3) %K is below 50.
- Stochastic Oscillator (5,3,3) %K is below 50.
- Hull MA crosses below the shifted EMA.
---
## 📉 Risk Management
- **Stop Loss:** Set at the low (for long) or high (for short) of the previous 2 candles.
- **Take Profit:** Calculated at a risk/reward ratio of **1.65x** the stop loss distance.
---
## 📊 Indicators Used
- **Hull Moving Average (12)**
- **Exponential Moving Average (5) **
- **Relative Strength Index (14)**
- **Stochastic Oscillators:**
- %K (12,3,3)
- %K (5,3,3)
TRP Stop-Loss and Position SizingScript is based on TRP to see both Long Stop Loss and Short Stop Loss, You can Also adjust the position size based on your capital and percentage risk.
Futures Position Size CalculatorFutures Position Size Calculator by vmkhats
Streamline your futures trading risk management with this intuitive Pine Script utility designed for TradingView. Created by vmkhats, this tool automates position sizing calculations for popular futures contracts, ensuring precise risk control while eliminating manual errors.
Key Features:
Supports 15+ Instruments: Trade confidently with preconfigured settings for indices (ES, NQ, RTY), commodities (CL, GC), currencies (6E), and micro contracts (MES, MNQ, MCL).
Customizable Inputs: Set your risk amount (e.g., $1,000) and stop-loss size in points, tailored to your strategy.
Automatic Calculations: The script computes stop-loss size in ticks, risk per contract, and optimal position size using floor rounding to prevent over-leveraging.
Clear Visual Output: A table displays results (instrument, risk, stop size, contracts) with color-coded alerts for invalid configurations (e.g., zero position size).
Ideal for both novice and seasoned traders, this utility enforces disciplined risk management while saving time. Enhance your TradingView workspace with this essential tool and trade futures with confidence.
Created by vmkhats — ensuring traders stay precise, proactive, and risk-aware.
Tracking Lines with TP/SL + Labels at LeftA simple indicator so you can set your TP and SL tolerance along with capital and leverage.
A red line and green line will represent where current TP and SL would be on the chart along with the number of tokens you need to trade to meet the USD capital to be trades.
Just gives a visual representation of SL to key zones on the chart so you can judge scalp entries a little better :)
Bull Bear Pivot by RawstocksThe "Bull Bear Pivot" indicator is a custom Pine Script (v5) tool designed for TradingView to assist traders in identifying key price levels and pivot points on intraday charts (up to 1-hour timeframes). It combines time-based open price markers, pivot high/low detection, and candlestick visualization to provide a comprehensive view of potential support, resistance, and trend reversal levels. Below is a detailed description of the indicator’s functionality, features, and intended use.
Indicator Overview:
The "Bull Bear Pivot" indicator is tailored for intraday trading, focusing on specific times of the day to mark significant price levels (open prices) and detect pivot points. It plots horizontal lines at the open prices of user-defined sessions, identifies pivot highs and lows on the current chart timeframe, and overlays custom candlesticks to highlight price action. The indicator is designed to work on timeframes of 1 hour or less (e.g., 1-minute, 3-minute, 5-minute, 15-minute, 30-minute, 60-minute) and includes a warning mechanism for invalid timeframes.
Key Features:
Time-Based Open Price Markers:
The indicator allows users to define up to five time-based sessions (e.g., 4:00 AM, 8:30 AM, 9:30 AM, 10:00 AM, and a custom time) to capture the open price at the start of each session.
For each session, it plots a horizontal line at the 1-minute open price, extending from the session start to the market close at 4:00 PM EST.
Each line is accompanied by a label positioned 5 bars to the right of the market close (4:00 PM EST), with the text right-aligned and vertically centered on the line.
Users can enable/disable each marker, customize the session time, label text, line color, and text color via the indicator’s settings.
Pivot Highs and Lows:
The indicator calculates pivot highs and lows on the current chart timeframe using the ta.pivothigh and ta.pivotlow functions.
Pivot highs are marked with green triangles above the bars, and pivot lows are marked with red triangles below the bars.
The pivot period (lookback/lookforward) is user-configurable, allowing flexibility in detecting short-term or longer-term reversals.
Custom Candlesticks:
The indicator overlays custom candlesticks on the chart, colored green for bullish candles (close > open) and red for bearish candles (close < open).
This feature helps visualize price action alongside the open price markers and pivot points.
Timeframe Restriction:
The indicator is designed to work on timeframes of 1 hour or less. If the chart timeframe exceeds 1 hour (e.g., 4-hour, daily), a warning label ("Timeframe > 1H Indicator Disabled") is displayed, and no elements are plotted.
Customizable Appearance:
Users can customize the appearance of the open price marker lines, including the line style (solid, dashed, dotted) and line width.
Labels for the open price markers have no background (transparent) and use customizable text colors.
Circuit Breaker - MFFUThis Indicator Is Used To Protect User From Over Trading After Market Hit The Circuit Breakers.
The CME Exchange Usually Halts Trading If Market Hit + or - 7%.
To Protect Users From Extreme Volatile Condition MFFU, Halts Trading If Market Hits + or - 5%.
This Indicator helps us to plot the circuit breaking lines helping us to when to stop trading.
Buffett Indicator with Historical Bubbles (Clean)The Buffett Indicator is a trusted macroeconomic gauge that compares the total US stock market capitalization to the nation’s GDP. Popularized by Warren Buffett, this metric highlights periods of overvaluation and undervaluation in the market.
This tool offers a clean and accurate visualization of the Buffett Indicator, enhanced with historical bubble annotations for key market events:
Dot-com Bubble (2000)
Global Financial Crisis Peak (2007)
COVID-19 Pre-crash Peak (2020)
Post-COVID Bull Market Peak (2021)
Features:
Dynamic Buffett Ratio (%) calculation using Wilshire 5000 Index as the market cap proxy.
Customizable GDP input for accuracy (update quarterly).
Visual thresholds for fair value, undervaluation, and overvaluation zones.
Historical event markers for educational and analytical context.
Optimized to display clearly across all timeframes: Daily, Weekly, Monthly.
How to Use:
Manually update the GDP input as new data is released.
Use this indicator for macro-level market sentiment analysis and valuation tracking.
Combine with other tools and risk management strategies for comprehensive market insights.
Disclaimer:
This indicator is for educational purposes only. It does not constitute financial advice. Always perform your own research and analysis.
Version: 1.0
we ask Allah reconcile and repay
#BuffettIndicator #MarketValuation #MacroAnalysis #BubbleDetector #LongTermInvestor #USMarket #Wilshire5000 #TradingViewScript
Market Clock with Inline HoursThis script displays a powerful, configurable market session clock that shows the open/closed status and trading hours for major global financial markets — including specialized logic for NY Futures (Globex).
🔑 Key Features:
✅ Real-Time Session Status:
Shows whether each selected market is currently OPEN or CLOSED, based on the user’s selected time zone.
✅ NY Futures Weekend Logic:
Built-in logic ensures NY Futures are marked CLOSED:
Friday after 5:00 PM ET
All of Saturday
Sunday until 6:00 PM ET
This reflects the true CME Globex trading schedule.
✅ 12-Hour Format + Timezone Labels:
Session hours are displayed in 12-hour AM/PM format alongside their associated timezone (EST, GMT, JST, etc.) for clarity.
✅ Fully Configurable Markets:
You can choose to display:
NY Market (RTH)
NY Futures (Globex)
London
Tokyo
Frankfurt
And you can easily toggle them on/off in the settings.
✅ Text Size & Position Customization:
Easily control the text size (tiny → huge) and screen position (top/bottom, left/center/right).
✅ Auto Timezone Offset Support:
Select from a list of common time zones (EST, UTC, JST, etc.), or enter your own custom UTC offset for global flexibility.
✅ Compact & Clean Design:
The layout groups each market’s:
Real-time OPEN/CLOSED status
Trading hours
All into a single column, making the layout clean and dashboard-ready.
🧠 Who is this for?
Day traders
Futures traders
Forex traders
Anyone who tracks multiple time zones or global markets
📌 Notes:
Clock updates based on chart timeframe (e.g., every 1m on a 1-minute chart)
Pine Script doesn't support real-time per-second updates, but works well for market status tracking
💬 Feedback Welcome!
This script was designed to be lightweight and user-friendly. Suggestions and improvements are always welcome — feel free to leave a comment or reach out directly.
Prior LevelThe "Prior Level" indicator displays the previous day's key price levels (Open, High, Low, Close) directly on your chart. These reference levels are essential for intraday trading strategies, support/resistance analysis, and breakout identification.
Key features:
- Shows previous session's Open, High, Low and Close values
- Customizable line colors for better visual distinction
- Adjustable line length for cleaner chart appearance
- Optional data table showing exact values
- Simple and lightweight design for easy chart reading
This indicator helps traders identify important price zones from the previous trading session, allowing for more informed trading decisions based on how current price action interacts with these established levels.
CFD Lot Calculator [MT5 Optimized]CFD Position Size Calculator for MT5 (ES/NQ)
A clean, professional Pine Script tool that calculates optimal position sizes in lots for ES/NQ CFDs based on:
Account balance
Risk percentage per trade
Stop loss in pips
Contract size (default = 1 for MT5)
Features:
✅ Bottom-right compact table
✅ Displays risk amount, stop loss, and lot size
✅ Works with any CFD broker (adjust pip/contract values if needed)
✅ Detailed tooltips explain all inputs
Perfect for traders who want precise position sizing without chart clutter.
RiskCalc FX & GoldRiskCalc FX & Gold is a multi-market position sizing tool designed to help you manage risk quickly and accurately. With this script, simply enter your account capital, the percentage of risk you wish to take, and your stop in ticks. Depending on the selected market—Forex or XAUUSD—the script automatically adjusts its calculations:
Forex: Assumes 1 lot equals 100,000 units.
XAUUSD: Assumes 1 lot equals 100 ounces.
The script calculates your risk in dollars and, using a fixed value of 1 USD per tick per lot, determines the ideal position size in both lots and total contracts. Results are displayed in a clear, centralized table at the top of the chart for real-time decision-making.
Perfect for traders operating across multiple markets who need an automated and consistent approach to risk management.
Trade Ladder Pro: Compounding & Risk ManagerTrade Ladder Pro: Compounding & Risk Manager
Inspired by the popular $20 to $52,000 trading challenge, this tool is designed to help you scale your trading account using systematic compounding and enhanced risk management techniques. Whether you’re aiming for disciplined growth or fine-tuning your risk/reward, Trade Ladder Pro offers a flexible approach to visualizing your trade levels.
How to Use:
Inputs:
Compounding Mode:
Set your starting balance, final balance goal, number of trades, and current trade level. You can move to the next trade after a successful trade in settings. The entries are not signals. They are there to help manage risk.
The script calculates the necessary compounding factor to grow your balance across the defined trades.
Risk Management Mode:
In addition to the above, specify a risk percentage and risk/reward ratio.
Input an entry price (or leave it at 0 to use the current price) to automatically compute the stop loss and take profit levels.
Display Options:
Choose the table’s position on the chart (e.g., Top Right, Top Left, Bottom Right, Bottom Left).
Pick between a vertical or horizontal layout for a display that suits your workflow.
Results:
The table will display the trade level, starting balance, risk amount, entry price, take profit, and (if in Risk Management mode) stop loss along with the projected ending balance.
Community & Feedback:
Your feedback is invaluable! Please share any tips or report any errors you encounter so we can continue to improve this tool. Happy trading!
ATR SL and TP with Candle Freeze & DataWindowThis indicator uses the Average True Range (ATR) to automatically calculate your stop loss (SL) and take profit (TP) levels based on the current market volatility and your chosen multipliers. Here's how it works:
ATR Calculation:
The indicator computes the ATR, which measures the average market volatility over a set period. This value helps gauge how much the price typically moves.
SL and TP Determination:
Depending on whether you're in a long or short trade, the SL and TP are calculated relative to the current price:
For a long trade, the stop loss is set below the current price (by subtracting a multiple of the ATR) and the take profit is set above it (by adding a multiple of the ATR).
For a short trade, the calculations are reversed.
Candle Freeze Feature:
Once a new candle starts, the calculated SL and TP values are "frozen" for that candle. This means they remain constant during the candle's formation, preventing them from updating continuously as the price fluctuates. This can make it easier to plan your trades without the levels shifting mid-candle.
Data Window & Labels:
The SL and TP values are plotted on the chart as lines and displayed in labels for quick reference. Additionally, they appear in TradingView's Data Window, so you can easily copy the price numbers if needed.
Overall, the indicator is designed to help you manage your trades by setting dynamic, volatility-adjusted SL and TP levels that only update at the start of each new candle, aligning with your chosen timeframe. Let me know if you have any more questions or need further adjustments!
VSA Vol Key VSA Signals
(1) No Demand – Bearish Signal
Low volume, narrow spread.
Price rises, but volume does not increase → Weak market, lack of buyers.
If this appears in an uptrend, it may indicate a potential reversal.
(2) No Supply – Bullish Signal
Low volume, narrow spread.
Price declines, but volume does not increase → Weak selling pressure.
If this appears in an uptrend, it may confirm the continuation of the uptrend.
(3) Stopping Volume – Bullish Reversal Signal
Strong price decline, but unusually high volume.
Candle shows a long lower wick, closing near the top.
Indicates Smart Money absorbing supply, signaling a potential reversal upwards.
(4) Climactic Volume – Possible Trend Reversal
Extremely high volume with a sharp price increase or decrease.
If this occurs after a long trend, it may indicate a trend reversal.
Smart Money may be taking profits after a prolonged price movement.
(5) Effort vs. Result
If volume is high but price movement is weak → Inefficient buying/selling, possible reversal.
If volume is high and price moves strongly in the same direction → Trend is likely to continue.
Exact Dynamic Yield SpreadYield Spread Overlay
"Yield Spread Overlay" is an indicator that displays the yield spread between two currencies based on their respective 10-year bond yields. It overlays directly onto the Forex chart, allowing real-time visualization of the relationship between the yield spread and the currency pair's price movements.
This indicator saves time by avoiding the manual addition of bond yields. Unlike manual methods, it supports smaller timeframes (1h, 4h, etc.), making it particularly useful.
Several customization options are available to suit individual preferences:
Custom Display: Adjust the line thickness and color.
Scale Position: Choose between displaying the scale on the right or left side of the chart.
This indicator helps traders better understand currency relationships and can serve as an additional tool within a Forex trading strategy.
All feedback, suggestions, and critiques—positive or negative—are welcome to continually improve this tool.
Supertrend Fixed TP Unified with Time Filter (MSK)Trend Strategy Based on the SuperTrend Indicator
This strategy is based on the use of the adaptive SuperTrend indicator, which takes into account the current market volatility and acts as a dynamic trailing stop. The indicator is visualized on the chart with colors that change depending on the direction of the trade: green indicates an uptrend (long), while red indicates a downtrend (short).
How It Works:
A buy signal (long) is generated when a bar closes above the indicator line.
A sell signal (short) is triggered when a bar closes below the indicator line.
Strategy Settings:
Trading Modes :
Long only : Only long positions are allowed.
Short only : Only short positions are allowed.
Both : Both types of trades are permitted.
Take-Profit :
The strategy supports a simple percentage-based take-profit, allowing you to lock in profits during sharp price movements without waiting for a pullback.
The take-profit level and its value are visualized on the chart. Visualization can be disabled in the settings.
Colored Chart Areas :
Long and short areas on the chart are highlighted with background colors for easier analysis.
Price Level :
You can set a price level in the settings to restrict trade execution:
Long trades are executed only above the specified level.
Short trades are executed only below the specified level.
This mode can be enabled or disabled in the parameters.
________________________________________________________________
Описание стратегии (на русском языке)
Трендовая стратегия на основе индикатора SuperTrend
Стратегия основана на использовании адаптивного индикатора SuperTrend , который учитывает текущую волатильность рынка и играет роль динамического трейлинг-стопа. Индикатор визуализируется на графике цветом, который меняется в зависимости от направления сделки: зелёный цвет указывает на восходящий тренд (лонг), а красный — на нисходящий тренд (шорт).
Принцип работы:
Сигнал на покупку (лонг) генерируется при закрытии бара выше линии индикатора.
Сигнал на продажу (шорт) возникает при закрытии бара ниже линии индикатора.
Настройки стратегии:
Режимы торговли :
Long only : только лонговые позиции.
Short only : только шортовые позиции.
Both : разрешены оба типа сделок.
Тейк-профит :
Стратегия поддерживает простой процентный тейк-профит, что позволяет фиксировать прибыль при резком изменении цены без ожидания отката.
Уровень и значение тейк-профита визуализируются на графике. Визуализацию можно отключить в настройках.
Цветные области графика :
Лонговые и шортовые области графика выделяются цветом фона для удобства анализа.
Уровень цены :
В настройках можно задать уровень цены, который будет ограничивать выполнение сделок:
Лонговые сделки выполняются только выше указанного уровня.
Шортовые сделки выполняются только ниже указанного уровня.
Этот режим можно включать или отключать в параметрах.
Daily Range %The Daily Range % Indicator calculates and plots a percentage of the daily range (high to low) based on a custom lookback period. It identifies outside bars from past daily data, prioritizing the most recent unbroken range. If no outside bar is found, it defaults to yesterday's range. The selected percentage of this range is then displayed on the chart, updating once per 5-minute bar (or the chosen resolution).
JsonAlertJsonAlert Library – Convert TradingView Alerts to JSON for Server Processing! 📡
🚀 The JsonAlert library makes it easy to send TradingView alerts as structured JSON to your server, allowing seamless integration with automated trading systems, databases, or webhook-based services.
📌 Features:
✅ Converts TradingView alert data into JSON format
✅ Supports custom key-value pairs for flexibility
✅ Allows frequency control (once per bar, once per bar close, every update)
✅ Easy to integrate with server-side PHP or other languages
Note that you have to pass one string array for keys and one string array for values , also you should pass alert frequency .
📖 Example Usage in Pine Script:
//@version=6
indicator("My script" , overlay = true)
import Penhan/JsonAlert/1 as alrt
if high > low
var array keys = array.from("ticker", "timeframe", "pattern")
var array values = array.from( syminfo.ticker , timeframe.period , str.tostring(123.45) )
alrt.alarm (keys, values , alert.freq_once_per_bar)
📡 Json Output Example:
{"ticker": "BTCUSDT","timeframe": "1","pattern": "123.45"}
🖥️ Server-Side PHP Example:
There you can integrate JsonAlert with your server in seconds! :)
Mark Hours/Minutes (Formula + Minutes)This Pine Script code is a TradingView indicator that analyzes the hour and minutes of each candle in a 1-minute timeframe and plots a red triangle above the candle if one of the following conditions is met:
Sum/Difference Condition: The sum or the absolute difference of the hours and minutes is equal to 29, 35, or 71, with a tolerance of +/- 1.
Minutes Condition: The minutes are equal to 00, 29, or 35.
This indicator is based on the Goldbach theory and the "algo path" concept popularized by Hopiplaka, which posits that algorithmic trading paths often initiate from minute values of 00, 29, and 35. Use this indicator according to your trading strategy.
Correlation X macroeconomicsFind the correlation between financial assets and the main Brazilian macroeconomic variables:
SELIC rate (Red)
PIB (Green)
Inflation (Blue)
Employment and income (Yellow)
Unlike other indicators that measure the correlation between two assets, the indicator "Correlation X macroeconomics" measures, for example, the correlation that the VALE3 asset has with the SELIC rate.
The correlation is obtained by calculating the variation suffered by a given asset on the day a given Brazilian macroeconomic variable is released.
This indicator can be used on any financial asset.
Use time frame chart = 1 day.
To calculate the correlation, data published by IBGE and the Central Bank of Brazil over a period of time are used. This time period is different depending on the selected macroeconomic variable. Namely:
16 PIB disclosures (4 years)
24 SELIC rate disclosures (3 years)
24 disclosures of IPCA and employment and income data (2 years)
You can select one or more macroeconomic variables to check the effect of correlation separately on each of them.
This indicator "Correlation X macroeconomics" will be updated monthly, as detailed below:
At the end of the day on which the PIB is released
At the end of the day on which employment and income data are released
At the end of the day following the day on which the SELIC rate is published
On the last business day of the month if none of the aforementioned disclosures occur
DateTimeLibrary with enums that can be used as script inputs to allow users to set their preferred date and/or time formats. The user-selected formats can be passed to the library functions (which use 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎() under the hood) to get formatted date and time strings from a UNIX time.
PREFACE
The target audience of this publication is users creating their own indicators/strategies.
Sometimes a date and/or time needs to be displayed to the user. As a Pine Coder, it is natural to focus our initial attention on the primary calculations or functions of a script, which can lead to the display format of dates and times being an afterthought. While it may not be crucial for the main use case of a script, increased customizability can help push indicators/strategies to the next level in the eyes of the user.
The purpose of this library is to provide an easy-to-use mechanism for allowing script users to choose the formats of dates and times that are displayed to them. Not only is this helpful for users from around the world who may be accustomed to different date/time formats, but it also makes it easier for the script author because it offloads the date/time formatting decision from the author to the user.
HOW TO USE
Step 1
Import the library. Replace with the latest available version number for this library.
//@version=6
indicator("Example")
import n00btraders/DateTime/ as dt
Step 2
Select a date format and/or time format enum to be used as an input.
dateFormatInput = input.enum(dt.DateFormat.FORMAT_3, "Date format")
timeFormatInput = input.enum(dt.TimeFormat.TWENTY_FOUR_HOURS, "Time hours format")
Step 3
Pass the user's selection as the `format` parameter in the formatting functions from this library. The `timestamp` & `timezone` parameters can be any value that would otherwise be used in 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎(𝚝𝚒𝚖𝚎, 𝚏𝚘𝚛𝚖𝚊𝚝, 𝚝𝚒𝚖𝚎𝚣𝚘𝚗𝚎).
string formattedDate = dt.formatDate(timestamp, dateFormatInput, timezone)
string formattedTime = dt.formatTime(timestamp, timeFormatInput, timezone)
LIMITATIONS
The library's ease-of-use comes at a few costs:
Fixed date/time formats.
Using the library's pre-defined date & time formats means that additional custom formats cannot be utilized. For example, this library does not include seconds or fractional seconds in formatted time strings. If a script's use case requires displaying the 'seconds' from a time of day, then 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎() must be used directly.
Fixed time zone offset format.
The `formatTime()` function of this library can optionally add the time zone offset at the end of the time string, but the format of the offset cannot be specified. Note: if the default format for time zone offset is not sufficient, the Timezone library can be imported directly to get the time zone offset string in a preferred format.
ADVANTAGES
There are benefits to utilizing this library instead of directly using 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎():
Easy to use from the user's perspective.
The date & time format enums provide a similar look and feel to the "Date format" and "Time hours format" options that already exist in the TradingView chart settings.
Easy to use from the author's perspective.
The exported functions from this library are modeled to behave similarly to the 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎(𝚝𝚒𝚖𝚎, 𝚏𝚘𝚛𝚖𝚊𝚝, 𝚝𝚒𝚖𝚎𝚣𝚘𝚗𝚎) built-in function from Pine Script.
Format quarter of the year.
The date formatting function from this library can display a fiscal quarter if it's included in the user-selected format. This is currently not possible with the built-in 𝚜𝚝𝚛.𝚏𝚘𝚛𝚖𝚊𝚝_𝚝𝚒𝚖𝚎().
EXPORTED ENUM TYPES
This section will list the available date/time formats that can be used as a script input. Each enum type has a detailed //@𝚏𝚞𝚗𝚌𝚝𝚒𝚘𝚗 description in the source code to help determine the best choice for your scripts.
Date Format Enums:
𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝
𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝𝙳𝚊𝚢𝙾𝚏𝚆𝚎𝚎𝚔𝙰𝚋𝚋𝚛
𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝𝙳𝚊𝚢𝙾𝚏𝚆𝚎𝚎𝚔𝙵𝚞𝚕𝚕
𝙲𝚞𝚜𝚝𝚘𝚖𝙳𝚊𝚝𝚎𝙵𝚘𝚛𝚖𝚊𝚝
Supporting Date Enums:
𝙳𝚊𝚝𝚎𝙿𝚛𝚎𝚏𝚒𝚡
Time Format Enums:
𝚃𝚒𝚖𝚎𝙵𝚘𝚛𝚖𝚊𝚝
Supporting Time Enums:
𝚃𝚒𝚖𝚎𝙰𝚋𝚋𝚛𝚎𝚟𝚒𝚊𝚝𝚒𝚘𝚗
𝚃𝚒𝚖𝚎𝚂𝚎𝚙𝚊𝚛𝚊𝚝𝚘𝚛
𝚃𝚒𝚖𝚎𝙿𝚘𝚜𝚝𝚏𝚒𝚡
Note: all exported enums have custom titles for each field. This means that the supporting enums could also be exposed to the end-user as script inputs if necessary. The supporting enums are used as optional parameters in this library's formatting functions to allow further customizability.
EXPORTED FUNCTIONS
formatDate(timestamp, format, timezone, prefix, trim)
Converts a UNIX time into a date string formatted according to the selected `format`.
Parameters:
timestamp (series int) : A UNIX time.
format (series DateFormat) : A date format.
timezone (series string) : A UTC/GMT offset or IANA time zone identifier.
prefix (series DatePrefix) : Optional day of week prefix.
trim (series bool) : Optional truncation of numeric month / day.
Returns: Calendar date string using the selected format.
⸻⸻⸻⸻⸻⸻⸻⸻
Required parameters: `timestamp`, `format`.
Note: there is a version of this function for each Date Format enum type. The only difference is the type of the `format` parameter.
Tip: hover over the `formatDate()` function in the Pine Editor to display useful details:
Function description
Parameter descriptions + default values
Example function usage
formatTime(timestamp, format, timezone, trim, separator, postfix, space, offset)
Converts a UNIX time into a formatted time string using the 24-hour clock or 12-hour clock.
Parameters:
timestamp (series int) : A UNIX time.
format (series TimeFormat) : A time format.
timezone (series string) : A UTC/GMT offset or IANA time zone identifier.
trim (series TimeAbbreviation) : Optional truncation of the hour and minute portion.
separator (series TimeSeparator) : Optional time separator.
postfix (series TimePostfix) : Optional format for the AM/PM postfix.
space (series bool) : Optional space between the time and the postfix.
offset (series bool) : Optional UTC offset as a suffix.
Returns: Time of day string using the selected format.
⸻⸻⸻⸻⸻⸻⸻⸻
Required parameters: `timestamp`, `format`.
Note: the `trim`, `postfix`, and `space` optional parameters are not applicable and will be ignored when using the 24-hour clock (`format` = TimeFormat.TWENTY_FOUR_HOURS).
Tip: hover over the `formatTime()` function in the Pine Editor to display useful details:
Function description
Parameter descriptions + default values
Example function usage
Example outputs for combinations of TimeFormat.* enum values & optional parameters
NOTES
This library can be used in conjunction with the Timezone library to increase the usability of scripts that can benefit from allowing the user to input their preferred time zone.
Credits to HoanGhetti for publishing an informative Markdown resource which I referenced to create the formatted function descriptions that pop up when hovering over `formatDate()` and `formatTime()` function calls in the Pine Editor.
Lot Size InfoLot Size Info – Quick Futures Lot Size Display
Overview:
The Lot Size Info indicator helps traders quickly determine the lot size of futures contracts for a given symbol.
How It Works:
- Automatically detects whether the current symbol is a futures contract.
- If a futures contract exists, it fetches and displays the lot size.
- If no futures contract is available, it doesn't display anything.
- The information is displayed in a non-intrusive table at the bottom-right of the chart.
Why Use This Indicator?
✅ Instant Futures Lot Size Visibility – No need to check manually.
✅ Prevents Confusion – Displays nothing when no futures contract exists.
✅ Minimal & Non-Distracting UI – Small floating table that updates in real-time.
🔹 Best for: Futures traders, scalpers, and positional traders who frequently switch between stock and futures charts.
🚀 Add this to your TradingView toolkit today!
XAUUSD Correlation IndicatorXAUUSD Correlation Indicator
Questo indicatore per TradingView calcola e visualizza la correlazione tra il prezzo di XAUUSD (oro) e una serie di altri asset finanziari, tra cui valute (EURUSD, AUDUSD, NZDUSD, GBPUSD), metalli preziosi (platino, argento), indici azionari (SPX500, DJI, NASDAQ) e il dollaro statunitense (DXY).
L'indicatore offre:
1. Correlazione: Calcola la correlazione tra XAUUSD e gli altri asset su un periodo personalizzabile, dove un numero superiore allo 0 indica una correlazione positiva ed un numero inferiore allo 0 indica una correlazione negativa.
2. Variazione percentuale: Mostra la variazione percentuale dei prezzi degli asset rispetto all'apertura.
3. Visualizzazione personalizzabile: Permette di ordinare i dati in base alla correlazione o alla variazione percentuale.
4. Tabella interattiva: I risultati sono visualizzati in una tabella colorata, con opzioni per personalizzare i colori di sfondo, testo e bordi.
Ideale per trader e analisti che vogliono monitorare le relazioni tra l'oro e altri mercati in tempo reale, questo strumento aiuta a identificare opportunità di trading basate su correlazioni e tendenze di mercato.