IU Trailing Stop Loss MethodsThe 'IU Trailing Stop Loss Methods' it's a risk management tool which allows users to apply 12 trailing stop-loss (SL) methods for risk management of their trades and gives live alerts when the trailing Stop loss has hit. Below is a detailed explanation of each input and the working of the Script.
Main Inputs:
- bar_time: Specifies the date from which the trade begins and entry price will be the open of the first candle.
- entry_type: Choose between 'Long' or 'Short' positions.
- trailing_method: Select the trailing stop-loss method. Options include ATR, Parabolic SAR, Supertrend, Point/Pip based, Percentage, EMA, Highest/Lowest, Standard Deviation, and multiple target-based methods.
- exit_after_close: If checked, exits the trade only after the candle closes.
Optional Inputs:
ATR Settings:
- atr_Length: Length for the ATR calculation.
- atr_factor: ATR multiplier for SL calculation.
Parabolic SAR Settings:
- start, increment, maximum: Parameters for the Parabolic SAR indicator.
Supertrend Settings:
- supertrend_Length, supertrend_factor: Length and factor for the Supertrend indicator.
Point/Pip Based:
- point_base: Set trailing SL in points/pips.
Percentage Based:
- percentage_base: Set SL as a percentage of entry price.
EMA Settings:
- ema_Length: Length for EMA calculation.
Standard Deviation Settings:
- std_Length, std_factor: Length and factor for standard deviation calculation.
Highest/Lowest Settings:
- highest_lowest_Length: Length for the highest/lowest SL calculation.
Target-Based Inputs:
- ATR, Point, Percentage, and Standard Deviation based target SL settings with customizable lengths and multipliers.
Entry Logic:
- Trades initiate based on the entry_type selected and the specified bar_time.
- If Long is selected, a long trade is initiated when the conditions match, and vice versa for Short.
Trailing Stop-Loss (SL) Methods Explained:
The strategy dynamically adjusts stop-loss based on the chosen method. Each method has its calculation logic:
- ATR: Stop-loss calculated using ATR multiplied by a user-defined factor.
- Parabolic SAR: Uses the Parabolic SAR indicator for trailing stop-loss.
- Supertrend: Utilizes the Supertrend indicator as the stop-loss line.
- Point/Pip Based: Fixed point-based stop-loss.
- Percentage Based: SL set as a percentage of entry price.
- EMA: SL based on the Exponential Moving Average.
- Highest/Lowest: Uses the highest high or lowest low over a specified period.
- Standard Deviation: SL calculated using standard deviation.
Exit Conditions:
- If exit_after_close is enabled, the position will only close after the candle confirms the stop-loss hit.
- If exit_after_close is disabled, the strategy will close the trade immediately when the SL is breached.
Visualization:
The script plots the chosen trailing stop-loss method on the chart for easy visualization.
Target-Based Trailing SL Logic:
- When a position is opened, the strategy calculates the initial stop-loss and progressively adjusts it as the price moves favorably.
- Each SL adjustment is stored in an array for accurate tracking and visualization.
Alerts and Labels:
- When the Entry or trailing stop loss is hit this scripts draws a label and give alert to the user that trailing stop has been hit for the trade.
Note - on the historical data The Script will show nothing if the entry and the exit has happened on the same candle, because we don't know what was hit first SL or TP (basically how the candle was formed on the lower timeframe).
Summary:
This script offers flexible trailing stop-loss options for traders who want dynamic risk management in their strategies. By offering multiple methods like ATR, SAR, Supertrend, and EMA, it caters to various trading styles and risk preferences.
Indicators and strategies
Month Separator
Month Separator Indicator
This Pine Script indicator separates each month on the chart by visually marking the change between months.
Features:
The indicator detects when the month changes.
It highlights the background with a semi-transparent blue color to differentiate the months.
A small red triangle is plotted at the top of the chart at the beginning of each new month, providing a clear visual cue.
Customization:
You can easily adjust the colors or styles in the script by modifying the bgcolor and plotshape functions.
The indicator works on all timeframes, but it is especially useful on higher timeframes (like daily or weekly charts) to track monthly transitions.
This script is ideal for traders who want a clear visual representation of month boundaries to analyze trends and key levels more effectively.
RShar Seasonal RSISeasonal RSI
This indicator, Seasonal RSI, is designed to enhance trading decisions by combining the **Relative Strength Index (RSI)** with insights derived from historical **seasonality patterns**. It not only calculates RSI but also overlays seasonality data for the current week of the year, providing traders with a more contextualized view of market conditions.
---
### **Key Features**
#### 1. **Relative Strength Index (RSI) Calculation**
- The script calculates the RSI for a user-defined period (`RSI Length`), which is an oscillator used to measure the speed and magnitude of price changes.
- RSI values are plotted on the chart, helping traders identify **overbought** and **oversold** conditions.
- Thresholds for **Overbought** and **Oversold** levels are customizable, with default values of 70 and 30, respectively.
---
#### 2. **Dynamic RSI Coloring Based on Seasonality**
- The color of the RSI line dynamically adjusts based on historical **win rates** for the current week of the year:
- **Bright Green** for win rates > 65%.
- **Green** for win rates between 50-65%.
- **Red** for win rates between 35-50%.
- **Dark Red** for win rates < 35%.
- This feature gives traders a quick visual cue about whether the historical performance of the current week tends to be bullish, neutral, or bearish.
---
#### 3. **Overbought and Oversold Level Visualization**
- Overbought and oversold levels are displayed as dotted horizontal lines on the RSI chart.
- These levels act as visual guides for potential price reversals:
- **Overbought (default 70)**: Indicates potential selling pressure.
- **Oversold (default 30)**: Indicates potential buying pressure.
---
#### 4. **Seasonality Data Integration**
- Historical **seasonality data** is used to analyze price performance patterns for each week of the year:
- **Win Rate**: The percentage of years in which prices closed higher during the current week.
- **Average Weekly Change**: The average price percentage change during the current week over historical data.
- This data provides additional context to RSI readings, helping traders align their strategies with seasonal tendencies.
---
#### 5. **Information Table Overlay**
- A table is displayed in the **top-right corner** of the chart, summarizing seasonality data for the current week:
- **Week Win Rate**: Displays the percentage of historical years where prices rose during this week.
- **Avg Weekly Change**: Shows the average percentage price change for the current week. Positive values are displayed in green, and negative values are shown in red.
- This overlay provides actionable insights without cluttering the chart.
---
### **How It Works**
1. **Seasonality Data**:
- A function (`getSeasonalityForWeek`) fetches or uses predefined mock seasonality data for each week of the year.
- For each week, it calculates:
- The **Win Rate** (percentage of years with positive performance).
- The **Mean Change** (average price percentage change).
2. **RSI Plot**:
- The RSI line is plotted on the chart.
- The line's color is determined by the win rate for the current week, providing a visual representation of historical performance trends.
3. **Threshold Visualization**:
- Horizontal lines for overbought and oversold levels are drawn to assist in identifying potential reversal points.
4. **Information Table**:
- The table summarizes the current week's seasonality data for quick reference, helping traders make data-driven decisions.
---
### **Use Cases**
- **Short-Term Traders**:
Use the dynamic RSI colors and seasonality table to align short-term trades with historical patterns of weekly performance.
- **Swing Traders**:
Identify whether a stock or market is in an overbought/oversold condition while considering the seasonal tendency for the week.
- **Contextual Decision-Making**:
Combine traditional RSI signals with historical data to reduce false signals and improve timing.
---
### **Limitations**
- The script uses **mock seasonality data** in its default state. To make it fully functional, replace the mock data with actual historical performance metrics for your specific ticker or market.
- The indicator does not fetch real-time external data due to Pine Script’s limitations, so all seasonality data must be manually updated or hardcoded.
---
This indicator provides a powerful way to combine technical analysis with historical trends, offering a unique edge to traders by adding seasonal context to RSI signals.
MA RSI MACD Signal SuiteThis Pine Script™ is designed for use in Trading View and generates trading signals based on moving average (MA) crossovers, RSI (Relative Strength Index) signals, and MACD (Moving Average Convergence Divergence) indicators. It provides visual markers on the chart and can be configured to suit various trading strategies.
1. Indicator Overview
The indicator includes signals for:
Moving Averages (MA): It tracks crossovers between different types of moving averages.
RSI: Signals based on RSI crossing certain levels or its signal line.
MACD: Buy and sell signals generated by MACD crossovers.
2. Inputs and Customization
Moving Averages (MAs):
You can customize up to 6 moving averages with different types, lengths, and colors.
MA Type: Choose from different types of moving averages:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
HMA (Hull Moving Average)
SMMA (RMA) (Smoothed Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume Weighted Moving Average)
T3, DEMA, TEMA
Source: Select the price to base the MA on (e.g., close, open, high, low).
Length: Define the number of periods for each moving average.
Examples:
MA1: Exponential Moving Average (EMA) with a period of 9
MA2: Exponential Moving Average (EMA) with a period of 21
RSI Settings:
RSI is calculated based on a user-defined period and is used to identify potential overbought or oversold conditions.
RSI Length: Lookback period for RSI (default 14).
Overbought Level: Defines the overbought threshold for RSI (default 70).
Oversold Level: Defines the oversold threshold for RSI (default 30).
You can also adjust the smoothing for the RSI signal line and customize when to trigger buy and sell signals based on the RSI crossing these levels.
MACD Settings:
MACD is used for identifying changes in momentum and trends.
Fast Length: The period for the fast moving average (default 12).
Slow Length: The period for the slow moving average (default 26).
Signal Length: The period for the signal line (default 9).
Smoothing Method: Choose between SMA or EMA for both the MACD and the signal line.
3. Signal Logic
Moving Average (MA) Crossover Signals:
Crossover: A bullish signal is generated when a fast MA crosses above a slow MA.
Crossunder: A bearish signal is generated when a fast MA crosses below a slow MA.
The crossovers are plotted with distinct colors, and the chart will display markers for these crossover events.
RSI Signals:
Oversold Crossover: A bullish signal when RSI crosses over its signal line below the oversold level (30).
Overbought Crossunder: A bearish signal when RSI crosses under its signal line above the overbought level (70).
RSI signals are divided into:
Aggressive (Early) Entries: Signals when RSI is crossing the oversold/overbought levels.
Conservative Entries: Signals when RSI confirms a reversal after crossing these levels.
MACD Signals:
Buy Signal: Generated when the MACD line crosses above the signal line (bullish crossover).
Sell Signal: Generated when the MACD line crosses below the signal line (bearish crossunder).
Additionally, the MACD histogram is used to identify momentum shifts:
Rising to Falling Histogram: Alerts when the MACD histogram switches from rising to falling.
Falling to Rising Histogram: Alerts when the MACD histogram switches from falling to rising.
4. Visuals and Alerts
Plotting:
The script plots the following on the price chart:
Moving Averages (MA): The selected MAs are plotted as lines.
Buy/Sell Shapes: Triangular markers are displayed for buy and sell signals generated by RSI and MACD.
Crossover and Crossunder Markers: Crosses are shown when two MAs crossover or crossunder.
Alerts:
Alerts can be configured based on the following conditions:
RSI Signals: Alerts for oversold or overbought crossover and crossunder events.
MACD Signals: Alerts for MACD line crossovers or momentum shifts in the MACD histogram.
Alerts are triggered when specific conditions are met, such as:
RSI crosses over or under the oversold/overbought levels.
MACD crosses the signal line.
Changes in the MACD histogram.
5. Example Usage
1. Trend Reversal Setup:
Buy Signal: Use the RSI oversold crossover and MACD bullish crossover to identify potential entry points in a downtrend.
Sell Signal: Use the RSI overbought crossunder and MACD bearish crossunder to identify potential exit points or short entries in an uptrend.
2. Momentum Strategy:
Combine MACD and RSI signals to identify the strength of a trend. Use MACD histogram analysis and RSI levels for confirmation.
3. Moving Average Crossover Strategy:
Focus on specific MA crossovers, such as the 9-period EMA crossing above the 21-period EMA, for buy signals. When a longer-term MA (e.g., 50-period) crosses a shorter-term MA, it may indicate a strong trend change.
6. Alerts Conditions
The script includes several alert conditions, which can be triggered and customized based on the user’s preferences:
RSI Oversold Crossover: Alerts when RSI crosses over the signal line below the oversold level (30).
RSI Overbought Crossunder: Alerts when RSI crosses under the signal line above the overbought level (70).
MACD Buy/Sell Crossover: Alerts when the MACD line crosses the signal line for a buy or sell signal.
7. Conclusion
This script is highly customizable and can be adjusted to suit different trading strategies. By combining MAs, RSI, and MACD, traders can gain multiple perspectives on the market, enhancing their ability to identify potential buy and sell opportunities.
4x Stochastic and 1x RSI Buy and Sell SignalsBuy signal (green), when Stochastic 9, 14, 40 and 60 are bellow 20.
Sell signal (red), when Stochastic 9, 14, 40 and 60 are above 80.
Buy signal is larger, when RSI is also bellow 30.
Sell signal is larger, when RSI is also above 70.
Using RSI is optional and can be disabled.
Use this signals when confirmed by another indicators, like support and resistance levels, EMAs and fundamental analysis.
MTF RSI CandlesThis Pine Script indicator is designed to provide a visual representation of Relative Strength Index (RSI) values across multiple timeframes. It enhances traditional candlestick charts by color-coding candles based on RSI levels, offering a clearer picture of overbought, oversold, and sideways market conditions. Additionally, it displays a hoverable table with RSI values for multiple predefined timeframes.
Key Features
1. Candle Coloring Based on RSI Levels:
Candles are color-coded based on predefined RSI ranges for easy interpretation of market conditions.
RSI Levels:
75-100: Strongest Overbought (Green)
65-75: Stronger Overbought (Dark Green)
55-65: Overbought (Teal)
45-55: Sideways (Gray)
35-45: Oversold (Light Red)
25-35: Stronger Oversold (Dark Red)
0-25: Strongest Oversold (Bright Red)
2. Multi-Timeframe RSI Table:
Displays RSI values for the following timeframes:
1 Min, 2 Min, 3 Min, 4 Min, 5 Min
10 Min, 15 Min, 30 Min, 1 Hour, 1 Day, 1 Week
Helps traders identify RSI trends across different time horizons.
3. Hoverable RSI Values:
Displays the RSI value of any candle when hovering over it, providing additional insights for analysis.
Inputs
1. RSI Length:
Default: 14
Determines the calculation period for the RSI indicator.
2. RSI Levels:
Configurable thresholds for RSI zones:
75-100: Strongest Overbought
65-75: Stronger Overbought
55-65: Overbought
45-55: Sideways
35-45: Oversold
25-35: Stronger Oversold
0-25: Strongest Oversold
How It Works:
1. RSI Calculation:
The RSI is calculated for the current timeframe using the input RSI Length.
It is also computed for 11 additional predefined timeframes using request.security.
2. Candle Coloring:
Candles are colored based on their RSI values and the specified RSI levels.
3. Hoverable RSI Values:
Each candle displays its RSI value when hovered over, via a dynamically created label.
Multi-Timeframe Table:
A table at the bottom-left of the chart displays RSI values for all predefined timeframes, making it easy to compare trends.
Usage:
1. Trend Identification:
Use candle colors to quickly assess market conditions (overbought, oversold, or sideways).
2. Timeframe Analysis:
Compare RSI values across different timeframes to determine long-term and short-term momentum.
3. Signal Confirmation:
Combine RSI signals with other indicators or patterns for higher-confidence trades.
Best Practices
Use this indicator in conjunction with volume analysis, support/resistance levels, or trendline strategies for better results.
Customize RSI levels and timeframes based on your trading strategy or market conditions.
Limitations
RSI is a lagging indicator and may not always predict immediate market reversals.
Multi-timeframe analysis can lead to conflicting signals; consider your trading horizon.
Ultra Round NumbersThe Ultra Round Numbers indicator is designed to improve your market analysis by visually emphasizing significant price levels. These round numbers often act as psychological levels where traders and investors tend to make decisions. With this tool, you can easily spot these levels, adjust their precision, and customize their appearance.
Detailed Description
Ultra Round Numbers dynamically plots horizontal lines at key price intervals based on user-defined step sizes. These intervals represent round-numbered price levels, which can serve as critical support and resistance zones.
Step Configurations
The indicator features three customizable steps: Biggest, Middle, and Smallest.
Each step allows you to define:
The step size in price to determine the intervals for the lines.
The maximum number of lines above and below the current price.
The color, style, and thickness of the lines for better visualization.
The script efficiently handles the creation and deletion of lines to prevent clutter on the chart. It ensures only the relevant lines (from biggest step to lowest step) are displayed based on your settings and the current price movement.
This indicator is a powerful yet user-friendly indicator for identifying psychological price levels on your charts. With fully customizable steps, dynamic line management, and clean visuals, this tool empowers traders of all skill levels to make more informed trading decisions.
MATA GOLD RATIOMata Gold Instrument: User Guide
The Instrument to Gold Oscillator is a technical analysis tool that normalizes the ratio of an instrument's price (e.g., BTC/USD) to the price of gold (XAU/USD) into a 0-100 scale. This provides a clear and intuitive way to evaluate the relative performance of an instrument compared to gold over a specified period.
---
How It Works
1. Calculation of the Ratio:
The ratio is calculated as:
\text{Ratio} = \frac{\text{Instrument Price}}{\text{Gold Price}}
2. Normalization:
The ratio is normalized using the highest and lowest values over a user-defined period (length), typically 14 periods:
\text{Normalized Ratio} = \frac{\text{Ratio} - \text{Min(Ratio)}}{\text{Max(Ratio)} - \text{Min(Ratio)}} \times 100
3. Overbought/Oversold Levels:
Above 80: The instrument is relatively expensive compared to gold (overbought).
Below 20: The instrument is relatively cheap compared to gold (oversold).
---
How to Use the Oscillator
1. Identify Overbought and Oversold Levels:
If the oscillator rises above 80, the instrument may be overvalued relative to gold. This could signal a potential reversal or correction.
If the oscillator falls below 20, the instrument may be undervalued relative to gold. This could signal a buying opportunity.
2. Track Trends:
Rising oscillator values indicate the instrument is gaining value relative to gold.
Falling oscillator values indicate the instrument is losing value relative to gold.
3. Crossing the Midline (50):
When the oscillator crosses above 50, the instrument's value is gaining strength relative to gold.
When it crosses below 50, the instrument is weakening relative to gold.
4. Combine with Other Indicators:
Use this oscillator alongside other technical indicators (e.g., RSI, MACD, STOCH) for more robust decision-making.
Confirm signals from the oscillator with price action or volume analysis.
---
Example Scenarios
1. Trading Cryptocurrencies Against Gold:
If BTC/USD's oscillator value is above 80, Bitcoin may be overvalued relative to gold. Consider reducing exposure or looking for short opportunities.
If BTC/USD's oscillator value is below 20, Bitcoin may be undervalued relative to gold. This could be a good time to accumulate.
2. Commodities vs. Gold:
Analyze the relative strength of commodities (e.g., oil, silver) against gold using the oscillator to identify periods of overperformance or underperformance.
---
Advantages of the Oscillator
Relative Performance Insight: Tracks the performance of an instrument relative to gold, providing a macro perspective.
Clear Visual Representation: The 0-100 scale makes it easy to identify overbought/oversold conditions and trend shifts.
Customizable Periods: The user-defined length allows flexibility in analyzing short- or long-term trends.
---
Limitations
Dependence on Gold: As the oscillator is based on gold prices, any external shocks to gold (e.g., geopolitical events) can influence its signals.
No Absolute Buy/Sell Signals: The oscillator should not be used in isolation but as part of a broader analysis strategy.
---
By using the Instrument to Gold Oscillator effectively, traders and investors can gain valuable insights into the relative valuation and performance of assets compared to gold, enabling more informed trading and investment decisions.
Volume Footprint POC for Every CandleCalculating and plotting the Point of Control (POC) for every candle on a volume footprint chart can provide valuable insights for traders. Here are some interpretations and uses of this information:
1. Identify Key Price Levels
Highest Traded Volume: The POC represents the price level with the highest traded volume for each candle. This level often acts as a significant support or resistance level.
Confluence Zones: When multiple POCs align at similar price levels over several candles, it indicates strong support or resistance zones.
2. Gauge Market Sentiment
Buyer and Seller Activity: High volume at certain price levels can indicate where buyers and sellers are most active. A rising POC suggests stronger buying activity, while a falling POC suggests stronger selling activity.
Volume Profile: Analyzing the volume profile helps in understanding the distribution of traded volume across different price levels, providing insights into market sentiment and potential reversals.
3. Spot Trends and Reversals
Trend Continuation: Consistent upward or downward shifts in POC levels can indicate a trend continuation. Traders can use this information to stay in trending positions.
Reversal Signals: A sudden change in the POC direction may signal a potential reversal. This can be used to take profits or enter new positions.
4. Intraday Trading Strategies
Short-Term Trading: Intraday traders can use the POC to make informed decisions on entry and exit points. For example, buying near the POC during an uptrend or selling near the POC during a downtrend.
Scalping Opportunities: High-frequency traders can use shifts in the POC to scalp small profits from price movements around these key levels.
5. Volume-Based Indicators
Confirmation of Other Indicators: The POC can be used in conjunction with other technical indicators (e.g., moving averages, RSI) to confirm signals and improve trading accuracy.
Support and Resistance: Combining the POC with traditional support and resistance levels can provide a more comprehensive view of the market dynamics.
In summary, the Point of Control (POC) is a valuable tool for traders to understand market behavior, identify key levels, and make more informed trading decisions. If you have specific questions or need further details on how to use this information in your trading strategy, feel free to ask! 😊
BTC ETF Inflows and Outflows with Combined BTC CorrelationThis script tracks Bitcoin Spot ETF inflows and outflows, calculating their correlation with Bitcoin's price to identify market trends and sentiment. It provides visual insights into ETF flows and the relationship with BTC price movements.
NOTE: The script relies on volume and opens / closes for calculating inflows and outflows. An ETF might issue more shares, which would skew the numbers.
KwakPineHelperLibrary "KwakPineHelper"
TODO: add library description here
fun(x)
TODO: add function description here
Parameters:
x (float) : TODO: add parameter x description here
Returns: TODO: add what function returns
all_opentrades_size()
get all opentrades size
Returns: (float) size
recent_opentrade_profit()
get recent opentrade profit
Returns: (float) profit
all_opentrades_profit()
get all opentrades profit
Returns: (float) profit
recent_closedtrade_profit()
get recent closedtrade profit
Returns: (float) profit
recent_opentrade_max_runup()
get recent opentrade max runup
Returns: (float) runup
recent_closedtrade_max_runup()
get recent closedtrade max runup
Returns: (float) runup
recent_opentrade_max_drawdown()
get recent opentrade maxdrawdown
Returns: (float) mdd
recent_closedtrade_max_drawdown()
get recent closedtrade maxdrawdown
Returns: (float) mdd
max_open_trades_drawdown()
get max open trades drawdown
Returns: (float) mdd
recent_opentrade_commission()
get recent opentrade commission
Returns: (float) commission
recent_closedtrade_commission()
get recent closedtrade commission
Returns: (float) commission
qty_by_percent_of_equity(percent)
get qty by percent of equtiy
Parameters:
percent (float) : (series float) percent that you want to set
Returns: (float) quantity
qty_by_percent_of_position_size(percent)
get size by percent of position size
Parameters:
percent (float) : (series float) percent that you want to set
Returns: (float) size
is_day_change()
get bool change of day
Returns: (bool) day is change or not
is_in_trade(numberOfBars)
get bool using number of bars
Parameters:
numberOfBars (int)
Returns: (bool) allowedToTrade
api_msg_system(chat_id, message)
Parameters:
chat_id (string)
message (string)
is_first_day()
Check if today is the first day
Returns: (bool) true if today is the first day, false otherwise
is_last_day()
Check if today is the last day
Returns: (bool) true if today is the last day, false otherwise
is_entry()
Check if trade is open
Returns: (bool) true if trade is open, false otherwise
is_close()
Check if trade is closed
Returns: (bool) true if trade is closed, false otherwise
is_win()
Check if trade is win
Returns: (bool) true if trade is win, false otherwise
is_loss()
Check if trade is loss
Returns: (bool) true if trade is loss, false otherwise
[Helper] Color Table for Manual SelectionThis indicator displays the colors of the color picker from the indicator configuration menu on a large scale. It also shows the RGB values in decimal and as a hexadecimal code for each color. This color table provides a better overview of different colors compared to the color picker built into the Pine Editor, making it a useful alternative. Since cell contents cannot yet be selected with the mouse, the desired color code must be manually transferred to the Pine code.
4 Bar FractalThis indicator is a simple yet powerful tool that tracks potential trend reversals by checking whether the closing price of the last candle in a four-candle sequence finishes above or below the highs or lows of both the immediately preceding candle and the first candle in that sequence. If the closing price breaks above those prior highs, a green triangle appears above the chart to indicate bullish momentum; if it breaks below those lows, a red triangle appears below the chart to signal bearish momentum. Not only is it beneficial for scalping or other short-term trading, but it also works well for swing trades and longer-term trends, making it one of the most effective indicators for catching significant market shifts. However, to avoid false breakouts, it is advisable to confirm signals with volume or additional trend indicators and to maintain disciplined risk management.
RSI + ADX + ATR 18-01-25Combining RSI (Relative Strength Index), ADX (Average Directional Index), and ATR (Average True Range) creates a synergistic approach to technical analysis. This powerful trio covers momentum, trend strength, and volatility, providing comprehensive insights into market conditions. Here's a deeper exploration of their combined results:
1. Momentum Assessment with RSI
Purpose: RSI measures the speed and magnitude of recent price changes to determine overbought or oversold levels.
Benefit in Combination:
When RSI indicates overbought (above 70) or oversold (below 30) levels, it signals a potential reversal or correction.
However, these signals can be false in strongly trending markets, which is why ADX is used alongside it.
2. Trend Strength Confirmation with ADX
Purpose: ADX confirms the presence and strength of a trend.
Benefit in Combination:
If RSI shows a potential reversal but ADX indicates a strong trend (above 25), the trend is likely to continue, and RSI signals may need to be approached with caution.
Conversely, if ADX is below 20 (weak trend), RSI signals are more likely to indicate genuine reversals, as the market lacks a strong directional push.
3. Volatility Analysis with ATR
Purpose: ATR evaluates the level of price volatility.
Benefit in Combination:
High ATR values indicate volatile conditions where prices can move significantly; this helps in setting wider stop-loss levels to avoid premature exits.
Low ATR values suggest quieter markets, where tighter stop-losses and profit targets are more suitable.
StockInfo ManualScript Description:
The StockInfo Manual is designed to display detailed stock information directly on the chart for the selected symbol. It processes user-provided input data, including
stock symbols
Industries
Relative Strength (RS) values
Band information
Key Features:
1. Symbol-Specific Data Display: Displays information only for the current chart symbol.
2. Customizable Table: Adjust the table's position, text size, colors, and headers to match your preferences.
3. Low RS/Band Conditions: Highlights critical metrics (RS < 50 or Band < 6) with a red background for quick visual cues.
4. Toggle Information: Choose to show or hide RS, Band, and Industry columns based on your needs.
How to Use the Script:
1. Use any platform (ex: chartsmaze) to get Industry,RS and Band information of any Stock. Prepare the data as separate column of excel
2. Configure Inputs:
- Stock Symbols (`Stock`): Enter a comma-separated list of stock symbols (e.g.,
NSE:ABDL,
NSE:ABFRL,
NSE:ABREL,
NSE:ABSLAMC,
NSE:ACC,
NSE:ACE,
- Industries (`Industry`): Provide a comma-separated list of industries for the stocks (e.g., 103-Brewerie,
109-Retail-D,
92-Paper & ,
19-Asset Ma,
62-Cement,
58-Industri,
- Relative Strength (`RS`): Input RS values for each stock (e.g.,
83,
52,
51,
81,
23,
59,
- Band Information (`Band`): Specify Band values for each stock. Use "No Band" if 10,
No Band,
20,
20,
No Band,
20,
3. Customize the Table:
-Display Options: Toggle the visibility of `RS`, `Band`, and `Industry` using the input checkboxes.
-Position and Appearance: Choose the table's position on the chart (e.g., top-right, bottom-center). Customize text size, background colors, header display, and other visual elements.
4. Interpret the Table:
- The table will dynamically display information for the current chart symbol only.
- If the `RS` is below 50 or the Band is below 6, the corresponding row is highlighted with a red background for immediate attention.
One need to enter details at least weekly for a correct result
[LeonidasCrypto]Volume Force IndexVolume Force Index (VFI)
Overview
The Volume Force Index (VFI) is a technical indicator that measures the balance between buying and selling pressure in the market by analyzing volume patterns. It helps traders identify potential trend reversals and confirm trend strength.
What It Measures
Buying vs. selling volume pressure
Market momentum
Potential overbought/oversold conditions
Volume trend strength
How to Read the Indicator
Main Components:
Main Line (Green/Red)
Green: Buying pressure is dominant
Red: Selling pressure is dominant
The steeper the slope, the stronger the pressure
Signal Line (Yellow)
Fast EMA that helps identify trend changes
Acts as an early warning system for potential reversals
Dynamic Bands (Red/Green lines)
Adapt to market volatility
Help identify extreme conditions
Based on actual market volatility rather than fixed levels
Signals to Watch
Trend Direction:
Rising oscillator = Increasing buying pressure
Falling oscillator = Increasing selling pressure
Signal Line Crossovers:
Main line crosses above signal line = Potential bullish signal
Main line crosses below signal line = Potential bearish signal
Band Touches:
Touching upper band = Possible buying exhaustion
Touching lower band = Possible selling exhaustion
Color Changes:
Green to Red = Shift to selling pressure
Red to Green = Shift to buying pressure
Best Practices
When to Use:
Trend confirmation
Identifying potential reversals
Volume analysis
Market strength assessment
Tips:
Use in conjunction with price action
Look for divergences with price
More reliable on higher timeframes
Consider market context
Default Settings:
MA Period: 14 (volume calculation)
Smooth Length: 3 (noise reduction)
EMA Period: 4 (signal line)
Volatility Period: 20 (band calculation)
Volatility Multiplier: 1.5 (band width)
Best Markets to Apply
Any market with reliable volume data
Summary
The VFI is a powerful tool that combines volume analysis with trend identification. Its adaptive nature makes it suitable for various market conditions, but it should be used as part of a complete trading strategy, not in isolation.
Alternate RTH Background OnlyThis “Alternate RTH Background Only” script highlights the chart background in alternating colors for each new day during the regular trading session (9:30–16:00 EST). It detects the start of a new calendar day (midnight) to increment its day counter, then applies a different semi-transparent color to the 9:30–16:00 bars for easy daily separation. No lines or indicators are plotted—only the background shading changes each day.
BITCOIN Optimized Scalping by NHBprod -check out strategy reportHey everyone, here's a new scalping trading strategy script for Bitcoin, and I’m super excited to share it with you. It’s called the "BITCOIN BTC Optimized Scalping Strategy by NHBprod." It uses a modified version of RSI in conjunction with EMA to create a single buy and sell signal. These buy and sell signals are easier to read than traditional RSI + EMA indicators, because of the modification done to the RSI. Essentially, instead of having two zones in the RSI for oversold and overbought, I replaced it with a single zone. Once you have the EMA and RSI working together, then it can be tuned for BITCOIN which I have done as the default settings.This is the strategy script, but I also have the indicator script which can be used to automate buy and sell signals directly to your phone, email, or your bot.
What It Does
RSI: Measures momentum (like, is the market pumped or tired?).
EMA: Follows the big trend (like the market’s vibe over time).
Then, it smooshes all this data together and spits out 2 plot lines (EMA and RSI + RSI threshold line).
Backtest Results
Some notables:
I included slippage & I included commission.
Nearly 3% per order!
Pyramiding is turned on, since this is a scalping strategy.
10% capital per order.
Hundreds of trades, and covers the maximum amount of time allowed in tradingview.
The script is ready for BITCOIN and I deploy it on the 3 hour timeframe because for these indicators, 3 hours gives the indicators enough data and reduces the noise.
How to Use It
You may be able to use it in different ways, such as looking at the plot lines and determining when they are increasing or decreasing, or possibly when they are over/under certain values.
This strategy (and the pairing indicator script) is able to be used to trade long only. If you right click, you can set a 'buy' alert, and a 'sell' alert so that it can automatically remind you when to buy and sell, at ANY time of the day. Or, you can setup these alerts to be automatically sent to your broker if you are into automated trading :)
Advanced Swing High/Low Trend Lines# Advanced Swing High/Low Trend Lines Indicator
## Features:
### Dynamic Trend Lines
This indicator dynamically identifies swing highs and swing lows based on the user-defined `Swing Length`. It then connects these points to create trend lines that visualize the market's direction and key support/resistance levels.
### Customizable Settings
- **Swing Length**: Define the sensitivity for detecting swing highs and lows.
- **Points Required to Draw Trend**: Specify the minimum number of swing highs or lows required to establish a valid trend line.
- **Show Old Trends**: Toggle the visibility of previous trend lines to focus on the current market structure.
- **Line Appearance**: Customize the color, style (`solid`, `dotted`, `dashed`), and width of both trend and support lines.
### Trend Break Detection
- Automatically detects and highlights when the price breaks above a high trend line or below a low trend line.
- The broken trend line changes its color to indicate a trend break, helping traders quickly identify significant market shifts.
### Continuous Updates
- As new swing highs or lows are detected, the indicator updates existing trend lines or creates new ones, ensuring relevance in dynamic market conditions.
- Trend lines extend into the future, projecting potential areas of interest for traders.
## Benefits:
1. **Enhanced Market Visualization**:
- Provides a clear view of market trends, swing points, and potential reversal zones.
2. **Trend Reversal Alerts**:
- Identifies and visually emphasizes trend breaks, enabling proactive trading decisions.
3. **Fully Customizable**:
- Adjust settings to suit your trading style and strategy, ensuring compatibility with various markets and timeframes.
4. **Real-Time Adaptation**:
- Automatically adapts to changing market conditions, maintaining accuracy and relevance.
## Use Cases:
- **Trend Following**: Identify and trade in the direction of established trends.
- **Breakout Trading**: Spot trend breaks and capitalize on momentum shifts.
- **Support and Resistance Analysis**: Use trend lines to identify key levels where price may react.
This indicator is an essential tool for traders seeking to combine technical precision with visual clarity in their analysis.
BTC-SPX Momentum Gauge + EMA SignalHere's an explanation of the market dynamics and signal benefits of this script:
Momentum and Sentiment Indicator:
The script uses the momentum of the S&P 500 to change the chart's background color, providing a quick visual cue of market sentiment. Green indicates potential bullish momentum in the broader market, while red suggests bearish momentum. This can help traders gauge overall market direction at a glance.
Bitcoin Trend Analysis:
By plotting the scaled TEMA of Bitcoin (BTC), traders can see how Bitcoin's trend correlates or diverges from the current asset being analyzed. Since Bitcoin is often viewed as a hedge against traditional financial systems or inflation, its trend can signal broader economic shifts or investor sentiment towards alternative investments.
Dual Trend Confirmation:
The script offers two trend lines: one for Bitcoin and one for the current ticker. When these lines move in tandem, it might indicate a strong market trend across both traditional and crypto markets. Divergence between these lines can highlight potential market anomalies or opportunities for arbitrage or hedging.
Smoothness vs. Reactivity:
The use of TEMA for Bitcoin provides a smoother signal than a simple moving average, reducing lag while still reacting to price changes. This can be particularly useful for identifying longer-term trends in Bitcoin's volatile market. The 20-period EMA for the current ticker, on the other hand, gives a quicker response to price changes in the asset you're directly trading.
Cross-Asset Correlation:
By overlaying Bitcoin's trend on another asset's chart, traders can analyze how these markets might influence each other. For instance, if Bitcoin is in an uptrend while a traditional asset is declining, it might suggest capital rotation into cryptocurrencies.
Trading Signals:
Crossovers or divergences between the TEMA of Bitcoin and the EMA of the current ticker could be used as signals for entry or exit points. For example, if the BTC TEMA crosses above the current ticker's EMA, it might suggest a shift towards crypto assets.
Risk Management:
The visual cues from the background color and moving averages can aid in risk management. For example, trading in the direction of the momentum indicated by the background color might be seen as going with the market flow, potentially reducing risk.
Macro-Economic Insights:
The relationship between Bitcoin and traditional markets can offer insights into macroeconomic conditions, particularly related to inflation, monetary policy, and investor sentiment towards fiat currencies.
Headwind and tailwind:
Currently BTC correlated trade instruments experience headwind or tailwind from the broader market. This indicator lets the user see it to help their trade decision process.
Additional Statement:
As the market realizes the dangers of the fiat that its construct is built upon and evolves and migrates into stable money, incorruptible by inflation, this indicator will reveal the external influence of that corruptible and the internal influence of the incorruptible; having diminishing returns as the rise of stable money overtakes the treasuries of the fiat construct.
Volume profile [Signals] - By Leviathan [Mindyourbuisness]Market Sessions and Volume Profile with Sweep Signals - Based on Leviathan's Volume Profile
This indicator is an enhanced version of Leviathan's Volume Profile indicator, adding session-based value area analysis and sweep detection signals. It combines volume profile analysis with market structure concepts to identify potential reversal opportunities.
Features
- Session-based volume profiles (Daily, Weekly, Monthly, Quarterly, Yearly)
- Forex sessions support (Tokyo, London, New York)
- Value Area analysis with POC, VAH, and VAL levels
- Extended level visualization for the last completed session
- Sweep detection signals for key value area levels
Sweep Signals Explanation
The indicator detects two types of sweeps at VAH, VAL, and POC levels:
Bearish Sweeps (Red Triangle Down)
Conditions:
- Price makes a high above the level (VAH/VAL/POC)
- Closes below the level
- Closes below the previous candle's low
- Previous candle must be bullish
Trading Implication: Suggests a failed breakout and potential reversal to the downside. These sweeps often indicate stop-loss hunting above key levels followed by institutional selling.
Bullish Sweeps (Green Triangle Up)
Conditions:
- Price makes a low below the level (VAH/VAL/POC)
- Closes above the level
- Closes above the previous candle's high
- Previous candle must be bearish
Trading Implication: Suggests a failed breakdown and potential reversal to the upside. These sweeps often indicate stop-loss hunting below key levels followed by institutional buying.
Trading Guidelines
1. Use sweep signals in conjunction with the overall trend
2. Look for additional confirmation like:
- Volume surge during the sweep
- Price action patterns
- Support/resistance levels
3. Consider the session's volatility and time of day
4. More reliable signals often occur at VAH and VAL levels
5. POC sweeps might indicate stronger reversals due to their significance as fair value levels
Notes
- The indicator works best on higher timeframes (1H and above)
- Sweep signals are more reliable during active market hours
- Consider using multiple timeframe analysis for better confirmation
- Past performance is not indicative of future results
Credits: Original Volume Profile indicator by Leviathan
Sunil 2 Bar Breakout StrategyDetailed Explanation of the Sunil 2 Bar Breakout Strategy
Introduction
The Sunil 2 Bar Breakout Strategy is a simple yet effective price-action-based approach designed to identify breakout opportunities in financial markets. This strategy analyzes the movement of the last three candles to detect momentum and initiates trades in the direction of the breakout. It is equipped with a built-in stop-loss mechanism to protect capital, making it suitable for traders looking for a structured and disciplined trading system.
The strategy works well across different timeframes and asset classes, including indices, stocks, forex, and cryptocurrencies. Its versatility makes it ideal for both intraday and swing trading.
Core Concept
The strategy revolves around two primary conditions: breakout identification and risk management.
Breakout Identification:
Long Trade Setup: The strategy identifies bullish breakouts when:
The current candle's closing price is higher than the previous candle's closing price.
The high of the previous candle is greater than the highs of the two candles before it.
Short Trade Setup: The strategy identifies bearish breakouts when:
The current candle's closing price is lower than the previous candle's closing price.
The low of the previous candle is lower than the lows of the two candles before it.
Risk Management:
Stop-Loss: For each trade, a stop-loss is automatically set:
For long trades, the stop-loss is set to the low of the previous candle.
For short trades, the stop-loss is set to the high of the previous candle.
This ensures that losses are minimized if the breakout fails.
Exit Logic:
The trade is closed automatically when the stop-loss is hit.
This approach maintains discipline and prevents emotional trading.
Strategy Workflow
Entry Criteria:
Long Entry: A long trade is triggered when:
The current close is greater than the previous close.
The high of the previous candle exceeds the highs of the two candles before it.
Short Entry: A short trade is triggered when:
The current close is less than the previous close.
The low of the previous candle is below the lows of the two candles before it.
Stop-Loss Placement:
For long trades, the stop-loss is set at the low of the previous candle.
For short trades, the stop-loss is set at the high of the previous candle.
Trade Management:
Trades are exited automatically if the stop-loss level is hit.
The strategy avoids re-entering trades until new breakout conditions are met.
Default Settings
Position Sizing:
The default position size is set to 1% of the account equity. This ensures proper risk management and prevents overexposure to the market.
Stop-Loss:
Stop-loss levels are automatically calculated based on the previous candle’s high or low.
Timeframes:
The strategy is versatile and works across multiple timeframes. However, it is recommended to test it on 15-minute, 1-hour, and daily charts for optimal performance.
Key Features
Automated Trade Execution:
The strategy handles both trade entry and exit automatically based on pre-defined conditions.
Built-In Risk Management:
The automatic stop-loss placement ensures losses are minimized on failed breakouts.
Works Across Markets:
The strategy is compatible with a wide range of instruments, including indices, stocks, forex, and cryptocurrencies.
Clear Signals:
Entry and exit points are straightforward and based on objective conditions, reducing ambiguity.
Versatility:
Can be used for both day trading and swing trading, depending on the chosen timeframe.
Best Practices for Using This Strategy
Backtesting:
Test the strategy on your chosen instrument and timeframe using TradingView's Strategy Tester to evaluate its performance.
Market Conditions:
The strategy performs best in trending markets or during periods of high volatility. Avoid using it in range-bound or choppy markets.
Position Sizing:
Use the default position size (1% of equity) or adjust based on your risk tolerance and account size.
Instrument Selection:
Focus on instruments with good liquidity and volatility, such as indices (e.g., NIFTY, BANKNIFTY), forex pairs, or major cryptocurrencies (e.g., Bitcoin, Ethereum).
Potential Enhancements
To make the strategy even more robust, consider adding the following optional features:
Stop-Loss Multiplier:
Allow users to customize the stop-loss distance as a multiple of the default level (e.g., 1.5x the low or high of the previous candle).
Take-Profit Levels:
Add user-defined take-profit levels, such as a fixed risk-reward ratio (e.g., 1:2).
Time Filter:
Include an option to restrict trading to specific market hours (e.g., avoid low-liquidity times).
Conclusion
The Sunil 2 Bar Breakout Strategy is an excellent tool for traders looking to capitalize on breakout opportunities while maintaining disciplined risk management. Its simplicity, combined with its effectiveness, makes it suitable for traders of all experience levels. By adhering to the clearly defined rules, traders can achieve consistent results while avoiding emotional trading decisions.
This strategy is a reliable addition to any trader’s toolbox and is designed to work seamlessly across different market conditions and instruments.
Trendilo ARTrendilo AR is a custom trading indicator designed to identify market trends using advanced techniques such as the Arnaud Legoux Moving Average (ALMA), volume confirmations, and dynamic volatility bands. This indicator provides a clear visualization of trends, including significant changes and custom alerts.
Review of Indicators Used
1. ALMA
Description:
ALMA is a moving average that applies an advanced filter to smooth price data, reducing noise and focusing on actual trends.
Usage in the Indicator:
Used to calculate the smoothed percentage price change and determine trend direction. Customizable parameters include:
- Length: Defines the number of bars to consider.
- Offset: Adjusts sensitivity toward recent prices.
- Sigma: Controls the degree of smoothing.
Advantages:
- Reduced lag in trend detection.
- Resistance to market noise.
2. ATR
Description:
ATR measures the market’s average volatility by considering the range between high and low prices over a given period.
Usage in the Indicator:
ATR is used to calculate "dynamic smoothing", adjusting the indicator’s sensitivity based on current market volatility.
Advantages:
- Adapts to high or low volatility conditions.
- Helps define dynamic support and resistance levels.
3. SMA
Description:
SMA calculates the average of prices or volume over a specific time period.
Usage in the Indicator:
Used to calculate the volume moving average (Volume SMA) to confirm whether the current volume supports the detected trend.
Advantages:
- Easy to understand and calculate.
- Provides volume-based trend confirmation.
4. RMS Bands
Description:
RMS Bands calculate the standard deviation of percentage price changes, creating upper and lower levels that act as overbought and oversold indicators.
Usage in the Indicator:
- Define the range within which the market is considered neutral.
- Crosses above or below the bands indicate trend changes.
Advantages:
- Visual identification of strong trends.
- Helps filter false signals.
Colors and Visuals Used in the Indicator
1. ALMA Line
Colors:
- Green: Indicates a confirmed uptrend (with sufficient volume).
- Red: Indicates a confirmed downtrend (with sufficient volume).
- Gray: Indicates a neutral phase or insufficient volume to confirm a trend.
2. RMS Bands
- Upper and Lower Lines:
- Purple (with transparency): These lines represent the RMS bands (upper and lower) and
adjust opacity based on trend strength.
- Stronger trends result in less transparency (more solid colors).
3. Highlighted Background (Strong Trends)
- Color:
- Light Green (transparent): Highlights a strong trend when the smoothed percentage change (ALMA) exceeds 1.5 times the RMS.
4. Horizontal Lines
- Baseline (0):
- Dark Gray: Serves as a central reference to identify the directionality of percentage changes.
- Additional Line (0.1):
- Blue: A customizable line to mark user-defined key levels.
5. Bar Colors
- Bar Colors:
- Green: When the price is in a confirmed uptrend.
- Red: When the price is in a confirmed downtrend.
- No color: When there is insufficient volume or no clear trend.
How to Use the Indicator
1. Initial Setup
1. Add the Indicator to Your Chart: Copy the code into the Pine Editor on TradingView and apply it to your chart.
2. Customize Parameters: Adjust values based on your trading strategy:
- Smoothing: Controls the level of smoothing for percentage changes.
- Lookback Length: Defines the observation period for calculations.
- Band Multiplier: Adjusts the width of RMS bands.
2. Signal Interpretation
1. Indicator Colors:
- Green: Confirmed uptrend.
- Red: Confirmed downtrend.
- Gray: No clear trend or insufficient volume.
2. RMS Bands:
- If the ALMA line (smoothed percentage change) crosses above the upper RMS band, it signals a potential uptrend.
- If it crosses below the lower RMS band, it signals a potential downtrend.
3. Volume Confirmation:
- The indicator's color activates only if the current volume exceeds the Volume SMA.
3. Alerts and Decisions
1. Trend Change Alerts:
- The indicator automatically triggers alerts when an uptrend or downtrend is detected.
- Configure these alerts to receive real-time notifications.
2. Strong Trend Signals:
- When the magnitude of the percentage change exceeds 1.5 times the RMS, the chart background highlights the strong trend.
4. Trading Strategies
1. Buy:
- Enter long positions when:
- The indicator turns green.
- Volume confirms the trend.
- Consider placing a stop-loss just below the lower RMS band.
2. Sell:
- Enter short positions when:
- The indicator turns red.
- Volume confirms the trend.
- Consider placing a stop-loss just above the upper RMS band.
3. Neutral:
- Avoid trading when the indicator is gray, as no clear trend or insufficient volume is present.
Disclaimer: As this is my first published indicator, please use it with caution. Feedback is highly appreciated to improve its performance.
Happy Trading!