ali_he96This is a customized version of the HALFTREND indicator.
Trading Method:
Timeframe: 1-hour or higher.
Buy Signal: When a buy signal is generated, open a long position and set the stop loss just below the lowest level.
Sell Signal: When a sell signal is generated, open a short position and set the stop loss just above the highest level.
Risk Management:
Make sure to learn risk management principles before trading. Always maintain a minimum risk-to-reward ratio of 2
You can set alerts to receive notifications for buy and sell signals.
Volume
voss 1 of 1 Price Action Volumetric Order Blocks [voss]Indicator Name: Order Block Finder
Description:
This TradingView indicator automatically detects and highlights Order Blocks — key zones where large institutions or professional traders have placed significant buy or sell orders, often resulting in sharp price moves. Order Blocks represent areas of strong demand (bullish order blocks) or supply (bearish order blocks) that price tends to revisit or react to.
Features:
Bullish Order Blocks:
The indicator identifies and marks areas where price experiences a strong reversal or acceleration upward after an institutional buying spree. These are typically seen after a significant price drop followed by a consolidation before a sharp upward movement. The Bullish Order Block is marked with a green box or green shaded area.
Bearish Order Blocks:
These are zones of institutional selling pressure where price reverses or accelerates downward after a buying climax. The Bearish Order Block is marked with a red box or red shaded area.
Zone Validity:
The indicator will adjust the order block zones based on recent price action, providing dynamic updates to reflect the validity and relevance of the zone. Older order blocks that no longer hold relevance are faded or removed.
Trend Confirmation:
The Order Block Finder will also highlight trend direction using a simple moving average (SMA) or other trend indicators, giving users an idea of whether to focus on bullish or bearish order blocks.
Alerts:
Set custom alerts for when price approaches an identified order block or when a breakout from an order block occurs. This feature helps traders stay informed in real-time about critical market zones.
Color-Coded Zones:
The indicator will color code the order block zones (green for bullish, red for bearish) and provide adjustable opacity so traders can customize the visibility according to their preference.
Automatic Drawing:
The indicator automatically draws order block zones on the chart, saving traders the time and effort of manually plotting them. The zones are based on the concept of "last up candle before a down move" for bearish order blocks and "last down candle before an up move" for bullish order blocks.
Historical & Real-Time Data:
The Order Block Finder works with both real-time and historical data, allowing traders to identify potential entry or exit points not only for the current market conditions but also to review past market reactions.
How to Use:
Look for price action that approaches the identified order block zones.
If price retraces into a bullish order block in an uptrend, it could be an ideal buying opportunity.
Conversely, if price retraces into a bearish order block in a downtrend, it could signal a shorting opportunity.
Combine with other indicators (e.g., RSI, MACD, or volume analysis) to confirm signals.
Best for:
Swing traders, day traders, and institutional traders who rely on supply and demand-based strategies.
Traders looking to identify key zones for potential reversals or continuation patterns based on institutional order flow.
Volume to Candle Size Ratio - UpdatedBased on the script from but with some added features (more to come)
(don't mind that the screen shot above has 3 of the same indicator....I was testing/debugging when it took and published the screen shot)
What's new:
- Works across all time frames, not just the 5 minute
- Added a moving average line
- Added alerts so that you don't have to watch the charts
Soon to come:
- Add levels/zones to be shown on the chart and used with the indicator. The indicator will alert you when a volume/price ratio candle approaches your levels (would also be useful for automated backtesting)
- Using the volume profile and the indicator to automate finding levels/zones for you
Trend Volume * RMS BUY SELL * V4 By DemirkanThis indicator is a trading tool designed to assist in analyzing market trends. It primarily uses Hull Moving Average (HMA) and Root Mean Square (RMS) volume analysis to generate buy and sell signals. Below is a detailed explanation of the functions used and their purposes:
1. EMA and ATR User Settings
pine
Kodu kopyala
emaLength = input.int(10, title="EMA Length")
atrLength = input.int(14, title="ATR Length")
atrMin = input.float(0.1, title="ATR Min")
atrMax = input.float(1.5, title="ATR Max")
colorUp = input.color(color.green, title="Buy Color")
colorDown = input.color(color.red, title="Sell Color")
This section allows the user to customize the indicator's parameters:
EMA Length: The period length for the Exponential Moving Average (EMA).
ATR Length: The period length for the Average True Range (ATR) indicator.
ATR Min and ATR Max: Minimum and maximum values for ATR.
colorUp and colorDown: Colors for the buy and sell signals.
2. Hull Moving Average (HMA) Settings
pine
Kodu kopyala
src = input(close, title="Source")
length = input.int(55, title="Hull Length")
lengthMult = input.float(1.0, title="Length Multiplier")
useHtf = input.bool(false, title="Show Hull MA from X timeframe?")
htf = input.timeframe("240", title="Higher timeframe")
This section sets up the parameters for the Hull Moving Average (HMA):
Source: The price source to use for HMA calculation (e.g., close price).
Hull Length: The period length for HMA calculation.
Length Multiplier: Multiplier for the HMA period.
useHtf: Allows the user to display the HMA from a different time frame (e.g., 4-hour chart).
htf: The time frame for the HMA calculation.
3. Hull MA Function
pine
Kodu kopyala
HMA(_src, _length) =>
ta.wma(2 * ta.wma(_src, _length / 2) - ta.wma(_src, _length), math.round(math.sqrt(_length)))
Here, the function for calculating the Hull Moving Average (HMA) is defined:
WMA (Weighted Moving Average): The weighted moving average function used in HMA calculation.
math.sqrt: The square root of the period length is used to improve the accuracy of HMA.
4. RMS Volume Calculation
pine
Kodu kopyala
trendLength = input.int(20, title="RMS Trend Length")
rmsVolume = math.sqrt(ta.sma(math.pow(volume, 2), trendLength))
This section calculates the Root Mean Square (RMS) of volume:
RMS: The square root of the average of squared volume values is calculated to measure volume variability.
SMA (Simple Moving Average): The average volume is calculated over a specified period.
5. RMS Volume Categorization
pine
Kodu kopyala
rmsCategory = "Low"
if rmsVolume > 1.5
rmsCategory := "High"
else if rmsVolume > 0.5
rmsCategory := "Medium"
This code categorizes the RMS volume into Low, Medium, and High categories. It highlights the importance of price movements accompanied by high volume.
6. Buy and Sell Signals
pine
Kodu kopyala
buySignal = (close > HULL) and (rmsCategory == "High")
sellSignal = (close < HULL) and (rmsCategory == "High")
Buy Signal: A buy signal is generated when the price is above the HMA and the volume is high.
Sell Signal: A sell signal is generated when the price is below the HMA and the volume is high.
7. Plot Hull MA
pine
Kodu kopyala
plot(HULL, title="Hull MA", color=color.blue, linewidth=2)
The Hull Moving Average is plotted in blue with a line width of 2 pixels on the chart.
8. Buy/Sell Signals as Shapes
pine
Kodu kopyala
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=colorUp, style=shape.triangleup, size=size.small)
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=colorDown, style=shape.triangledown, size=size.small)
Buy and sell signals are displayed as triangle shapes with the specified colors on the chart.
9. Alert Conditions
pine
Kodu kopyala
alertcondition(buySignal, title="Buy Alert", message="Price crossed above Hull MA with High RMS")
alertcondition(sellSignal, title="Sell Alert", message="Price crossed below Hull MA with High RMS")
These alert conditions notify the user when a buy or sell signal is triggered based on the Hull MA and RMS volume criteria.
Purpose and Warnings:
This indicator analyzes market trends using Hull Moving Average and RMS volume analysis, generating buy and sell signals based on high volume and trend direction.
However, it should not be used as a standalone indicator. It must be complemented with other indicators and analysis methods. Always apply risk management and consider market conditions when making buy and sell decisions.
Zonas de Volumen, POC, Stop/Take ProfitEste indicador en TradingView, denominado "Zonas de Volumen, POC y Stop/Take Profit", permite visualizar las áreas clave de negociación en un activo, ayudando a identificar puntos estratégicos para gestionar posiciones.
Threshold-Based Delta Price-Volume StrategyThis strategy observed change in price with reference to change in volume.
Rising Price (Strong Buy):
Price change > 3%.
Volume change > 10%.
Falling Price (Strong Buy):
Price change < -4%.
Volume change < 4%.
10 EMA Break with Volume ConfirmationTracks when price breaks above or below 10 EMA with above average volume useful for meaningful breaks above or below as well as false breaks with easy to read icons
enjoy :)
MERCURY by Dr.Abiram Sivprasad - Adaptive Pivot and Ema AlertSYSThe MERCURY indicator is an advanced, adaptive indicator designed to support traders in detecting critical price movements and trend reversals in real time. Developed with precision by Dr. Abhiram Sivprasad, this tool combines a sophisticated Central Pivot Range (CPR), EMA crossovers, VWAP levels, and multiple support and resistance indicators into one streamlined solution.
Key Features:
Central Pivot Range (CPR): MERCURY calculates the central pivot along with below-central (BC) and top-central (TC) pivots, helping traders anticipate areas of potential reversal or breakout.
EMA Crossovers: The indicator includes up to nine EMAs with customizable lengths. An integrated EMA crossover alert system provides timely signals for potential trend shifts.
VWAP Integration: The VWAP levels are used in conjunction with EMA crossovers to refine trend signals, making it easier for traders to spot high-probability entries and exits.
Adaptive Alerts for Breakouts and Breakdowns: MERCURY continuously monitors the chart for conditions such as all EMAs turning green or red. The alerts trigger when a candle body closes above/below the VWAP and EMA1 and EMA2 levels, confirming a breakout or breakdown.
Customizable EMA Dashboard: An on-chart table displays the status of EMAs in real-time, with color-coded indicators for easy readability. It highlights long/short conditions based on the EMA setup, guiding traders in decision-making at a glance.
How to Use:
Trend Confirmation: Use the CPR and EMA alignment to identify uptrends and downtrends. The table colors and alerts provide a clear, visual cue for entering long or short positions.
Breakout and Breakdown Alerts: The alert system enables traders to set continuous alerts for critical price levels. When all EMAs align in one color (green for long, red for short), combined with a candle closing above or below VWAP and EMA levels, the indicator generates breakout or breakdown signals.
VWAP & EMA Filtering: VWAP acts as a dynamic support/resistance level, while the EMAs provide momentum direction. Traders can refine entry/exit points based on this multi-layered setup.
Usage Scenarios:
Day Trading & Scalping: Traders can use the CPR, VWAP, and EMA table to make swift, informed decisions. The multiple EMA settings allow scalpers to set shorter EMAs for quicker responses.
Swing Trading: Longer EMA settings combined with VWAP and CPR can provide insights into sustained trends, making it useful for holding positions over several days.
Risk Management: MERCURY dashboard and alert functionality allow traders to set clear boundaries, reducing impulsive decisions and enhancing trading discipline.
Indicator Composition:
Open-Source: The core logic for CPR and EMA crossovers is presented open-source, ensuring transparency and user adaptability.
Advanced Logic Integration: This indicator implements custom calculations and filtering, optimizing entry and exit signals by merging VWAP, CPR, and EMA in a logical and user-friendly manner.
Chart Requirements:
For best results, use MERCURY on a clean chart without additional indicators. The default settings are optimized for simplicity and clarity, so avoid cluttering the chart with other tools unless necessary.
Timeframes: MERCURY is suitable for timeframes as low as 5&15 minutes for intraday trading and up to daily timeframes for trend analysis.
Symbol Settings: Works well across forex, stocks, and crypto assets. Adjust EMA lengths based on the asset’s volatility.
Example Chart Settings:
Symbol/Timeframe: BTCUSD, 1-hour timeframe (or any symbol as per user preference).
Settings: Default settings for CPR and EMA table.
Chart Style: Clean chart with MERCURY as the primary indicator.
Publishing Considerations:
Invite-Only Access: If setting to invite-only, ensure compliance with the Vendor requirements.
Limit Claims: Avoid making unsubstantiated claims about accuracy, as MERCURY should be viewed as a tool to aid analysis, not as a guaranteed performance predictor.
Example Strategy
This indicator provides signals primarily for trend-following and reversal strategies:
1. Trend Continuation:
- Buy Signal: When the price crosses above both EMA1 and EMA2 and holds above the daily CPR level, a bullish trend continuation is confirmed.
- Sell Signal: When the price crosses below both EMA1 and EMA2 and holds below the daily CPR level, a bearish trend continuation is confirmed.
2. Reversal at Pivot Levels:
- If the price approaches a resistance (R1, R2, or R3) from below with an uptrend and then begins to cross under EMA1 or EMA2, it may signal a bearish reversal.
- If the price approaches a support (S1, S2, or S3) from above in a downtrend and then crosses above EMA1 or EMA2, it may signal a bullish reversal.
Example Setup
- Long Entry
- When the price crosses above the daily pivot point and closes above both EMA1 and EMA2.
- Hold the position if the price remains above the VWAP band and monitor for any EMA crossunder as an exit signal.
- Short Entry:
- When the price drops below the daily pivot and both EMA1 and EMA2 cross under the price.
- Consider covering the position if the price breaks above the VWAP band or if a crossover of EMA1 and EMA2 occurs.
Alerts
Alerts are customizable based on EMA1 & EMA2 crossovers to notify the trader of potential trend shifts.
Ichimoku + RSI + MACD Strategy1. Relative Strength Index (RSI)
Overview:
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. It ranges from 0 to 100 and is typically used to identify overbought or oversold conditions in a market.
How to Use with Ichimoku:
Long Entry: Look for RSI to be above 30 (indicating it is not oversold) when the price is above the Ichimoku Cloud.
Short Entry: Look for RSI to be below 70 (indicating it is not overbought) when the price is below the Ichimoku Cloud.
2. Moving Average Convergence Divergence (MACD)
Overview:
The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. It consists of the MACD line, signal line, and histogram.
How to Use with Ichimoku:
Long Entry: Enter a long position when the MACD line crosses above the signal line while the price is above the Ichimoku Cloud.
Short Entry: Enter a short position when the MACD line crosses below the signal line while the price is below the Ichimoku Cloud.
Combined Strategy Example
Here’s a brief outline of how to structure a trading strategy using Ichimoku, RSI, and MACD:
Long Entry Conditions:
Price is above the Ichimoku Cloud.
RSI is above 30.
MACD line crosses above the signal line.
Short Entry Conditions:
Price is below the Ichimoku Cloud.
RSI is below 70.
MACD line crosses below the signal line.
Exit Conditions:
Exit long when MACD line crosses below the signal line.
Exit short when MACD line crosses above the signal line.
First 5 Minutes Open/Close LinesThis very simple indicator paints lines at the high and low of the first 5m candle of the session. It is primarily intended for big cap NYSE traded stocks with high volume. I wrote this indicator to save me the trouble of manually drawing the lines each day.
The lines drawn at the 5m high/low will remain constant regardless of which timeframe you switch to. In the example screenshot, we are looking at the 1m timeframe. This helps us switch effortlessly between different timeframes to see if a given price movement meets our entry criteria.
In addition to drawing lines at the first 5m high/low, it will optionally paint two zones, one each around the high and low. The boundaries of this zone are configurable and expressed as a percentage of the total movement of the first 5m bar. By default, it is set to 25%.
This indicator is based on the concept that the first 5m bar always has massive volume which helps us infer that price may react around the extremes of that movement. The basic strategy works something like this:
- You identify the high timeframe (HTF) trend direction of the stock
- You wait for the first 5m candle of the session to close
- You wait for price to puncture through the outer boundary of the zone marked by the indicator.
- You enter when price retraces to the high, or low, which marks the midpoint of the punctured zone.
- Only enter long on stocks in a HTF uptrend, and short on stocks in an HTF downtrend.
- Use market structure to identify stop loss and take profit targets
Note: Use at your own risk. This indicator and the strategy described herein are not in any way financial advice, nor does the author of this script make any claims about the effectiveness of this strategy, which may depend highly on the discretion and skill of the trader executing it, among many other factors outside of the author's control. The author of this script accepts no liability, and is not responsible for any trading decisions that you may or may not make as a result of this indicator. You should expect to lose money if using this indicator.
Multiple EMA, SMA & VWAPThere is 4 EMAs - 5, 9, 21, 50; 4 SMAs - 5, 10, 50, 200; 1 VWAP which can be edited according yourself
Globex time (New York Time)This indicator is designed to highlight and analyze price movements within the Globex session. Primarily geared toward the Globex Trap trading strategy, this tool visually identifies the session's high and low prices, allowing traders to better assess price action during extended hours. Here’s a comprehensive breakdown of its features and functionality:
Purpose
The "Globex Time (New York Time)" indicator tracks price levels during the Globex trading session, providing a clear view of overnight market activity. This session, typically running from 6 p.m. ET (18:00) until the following morning at 8:30 a.m. ET, is a critical period where significant market positioning can occur before the regular session opens. In the Globex Trap strategy, the session high and low are essential levels, as price movements around these areas often indicate potential support, resistance, or reversal zones, which traders use to set up entries or exits when the regular trading session begins.
Key Features
Customizable Session Start and End Times
The indicator allows users to specify the exact start and end times of the Globex session in New York time. The default settings are:
Start: 6 p.m. ET (18:00)
End: 8:30 a.m. ET
These settings can be adjusted to align with specific market hours or personal preferences.
Session High and Low Identification
Throughout the defined session, the indicator dynamically calculates and tracks:
Session High: The highest price reached within the session.
Session Low: The lowest price reached within the session.
These levels are essential for the Globex Trap strategy, as price action around them can indicate likely breakout or reversal points when regular trading resumes.
Vertical Lines for Session Start and End
The indicator draws vertical lines at both the session start and end times:
Session Start Line: A solid line marking the exact beginning of the Globex session.
Session End Line: A similar vertical line marking the session’s conclusion.
Both lines are customizable in terms of color and thickness, making it easy to distinguish the session boundaries visually on the chart.
Horizontal Lines for Session High and Low
At the end of the session, the indicator plots horizontal lines representing the Globex session's high and low levels. Users can customize these lines:
Color: Define specific colors for the session high (default: red) and session low (default: green) to easily differentiate them.
Line Style: Options to set the line style (solid, dashed, or dotted) provide flexibility for visual preferences and chart organization.
Automatic Reset for Daily Tracking
To adapt to the next trading day, the indicator resets the session high and low data once the current session ends. This reset prepares it to start tracking new levels at the beginning of the next session without manual intervention.
Practical Application in the Globex Trap Strategy
In the Globex Trap strategy, traders are primarily interested in price behavior around the high and low levels established during the overnight session. Common applications of this indicator for this strategy include:
Breakout Trades: Watching for price to break above the Globex high or below the Globex low, indicating potential momentum in the breakout direction.
Reversal Trades: Monitoring for failed breakouts or traps where price tests and rejects the Globex high or low, suggesting a reversal as liquidity is trapped in these zones.
Support and Resistance Zones: Using the session high and low as key support and resistance levels during the regular trading session, with potential entry or exit points when price approaches these areas.
Additional Configuration Options
Vertical Line Color and Width: Define the color and thickness of the vertical session start and end lines to match your chart’s theme.
Upper and Lower Line Colors and Styles: Customize the appearance of the session high and low horizontal lines by setting color and line style (solid, dashed, or dotted), making it easy to distinguish these critical levels from other chart markings.
Summary
This indicator is a valuable tool for traders implementing the Globex Trap strategy. It visually segments the Globex session and marks essential price levels, helping traders analyze market behavior overnight. Through its customizable options and clear visual representation, it simplifies tracking overnight price activity and identifying strategic levels for potential trade setups during the regular session.
On Balance Volume Oscillator of Trading Volume TrendOn Balance Volume Oscillator of Trading Volume Trend
Introduction
This indicator, the "On Balance Volume Oscillator of Trading Volume Trend," is a technical analysis tool designed to provide insights into market momentum and potential trend reversals by combining the On Balance Volume (OBV) and Relative Strength Index (RSI) indicators.
Calculation and Methodology
* OBV Calculation: The indicator first calculates the On Balance Volume, which is a cumulative total of the volume of up days minus the volume of down days. This provides a running tally of buying and selling pressure.
* RSI of OBV: The RSI is then applied to the OBV values to smooth the data and identify overbought or oversold conditions.
* Exponential Moving Averages (EMAs): Two EMAs are calculated on the RSI of OBV. A shorter-term EMA (9-period in this case) and a longer-term EMA (100-period) are used to generate signals.
Interpretation and Usage
* EMA Crossovers: When the shorter-term EMA crosses above the longer-term EMA, it suggests increasing bullish momentum. Conversely, a downward crossover indicates weakening bullish momentum or increasing bearish pressure.
* RSI Divergences: Divergences between the price and the indicator can signal potential trend reversals. For example, if the price is making new highs but the indicator is failing to do so, it could be a bearish divergence.
* Overbought/Oversold Conditions: When the RSI of OBV is above 70, it suggests the market may be overbought and a potential correction could be imminent. Conversely, when it is below 30, it suggests the market may be oversold.
Visual Representation
The indicator is plotted on a chart with multiple lines and filled areas:
* Two EMAs: The shorter-term EMA and longer-term EMA are plotted to show the trend of the OBV.
* Filled Areas: The area between the two EMAs is filled with a color to indicate the strength of the trend. The color changes based on whether the shorter-term EMA is above or below the longer-term EMA.
* RSI Bands: Horizontal lines at 30 and 70 mark the overbought and oversold levels for the RSI of OBV.
Summary
The On Balance Volume Oscillator of Trading Volume Trend provides a comprehensive view of market momentum and can be a valuable tool for traders. By combining the OBV and RSI, this indicator helps identify potential trend reversals, overbought and oversold conditions, and the strength of the current trend.
Note: This indicator should be used in conjunction with other technical analysis tools and fundamental analysis to make informed trading decisions.
Delivery Volume IndicatorDelivery Volume Indicator
The Delivery Volume Indicator is designed to provide insights into trading volume specifically delivered on a daily basis, scaled in lakhs (hundreds of thousands) for ease of interpretation. This tool can be especially useful for traders looking to monitor delivery-based volume changes and trends, as it helps to distinguish between bullish and bearish volume flows.
Key Features:
Daily Volume in Lakhs: The indicator pulls daily volume data and scales it to lakhs for more readable values.
Bullish/Bearish Color Coding: The indicator color-codes volume columns to reflect market sentiment. Columns are displayed in green when the price closes higher than it opens (bullish) and in red when the price closes lower than it opens (bearish).
Adjustable EMA: A customizable Exponential Moving Average (EMA) is applied to the scaled delivery volume. The EMA line, displayed in blue, helps smooth out volume trends and allows traders to adjust the period for personal strategy alignment.
How to Use:
Observe the delivery volume changes to track market sentiment over time. Increased bullish delivery volume could indicate accumulating interest, while increased bearish delivery volume might suggest distribution.
Utilize the EMA to identify longer-term trends in delivery volume, with shorter EMA periods for quick volume shifts and longer periods for gradual trend changes.
This indicator is ideal for traders seeking volume-based insights that align closely with price action.
Multi VWAPs (Daily Weekly Monthly Yearly)This indicator calculates VWAP for daily, weekly, monthly, and yearly timeframes, which can be toggled on/off in the settings.
Each VWAP (Daily, Weekly, Monthly, and Yearly) is plotted with a different color for easy distinction:
Daily VWAP: Blue
Weekly VWAP: Green
Monthly VWAP: Purple
Yearly VWAP: Red
Updated Volume SuperTrend AI (Expo)// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
// © Zeiierman
//@version=5
indicator("Volume SuperTrend AI (Expo)", overlay=true)
// ~~ ToolTips {
t1="Number of nearest neighbors in KNN algorithm (k): Increase to consider more neighbors, providing a more balanced view but possibly smoothing out local patterns. Decrease for fewer neighbors to make the algorithm more responsive to recent changes. Number of data points to consider (n): Increase for more historical data, providing a broader context but possibly diluting recent trends. Decrease for less historical data to focus more on recent behavior."
t2="Length of weighted moving average for price (KNN_PriceLen): Higher values create a smoother price line, influencing the KNN algorithm to be more stable but less sensitive to short-term price movements. Lower values enhance responsiveness in KNN predictions to recent price changes but may lead to more noise. Length of weighted moving average for SuperTrend (KNN_STLen): Higher values lead to a smoother SuperTrend line, affecting the KNN algorithm to emphasize long-term trends. Lower values make KNN predictions more sensitive to recent SuperTrend changes but may result in more volatility."
t3="Length of the SuperTrend (len): Increase for a smoother trend line, ideal for identifying long-term trends but possibly ignoring short-term fluctuations. Decrease for more responsiveness to recent changes but risk of more false signals. Multiplier for ATR in SuperTrend calculation (factor): Increase for wider bands, capturing larger price movements but possibly missing subtle changes. Decrease for narrower bands, more sensitive to small shifts but risk of more noise."
t4="Type of moving average for SuperTrend calculation (maSrc): Choose based on desired characteristics. SMA is simple and clear, EMA emphasizes recent prices, WMA gives more weight to recent data, RMA is less sensitive to recent changes, and VWMA considers volume."
t5="Color for bullish trend (upCol): Select to visually identify upward trends. Color for bearish trend (dnCol): Select to visually identify downward trends. Color for neutral trend (neCol): Select to visually identify neutral trends."
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Input settings for K and N values
k = input.int(3, title = "Neighbors", minval=1, maxval=100,inline="AI", group="AI Settings")
n_ = input.int(10, title ="Data", minval=1, maxval=100,inline="AI", group="AI Settings", tooltip=t1)
n = math.max(k,n_)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Input settings for prediction values
KNN_PriceLen = input.int(20, title="Price Trend", minval=2, maxval=500, step=10,inline="AITrend", group="AI Trend")
KNN_STLen = input.int(100, title="Prediction Trend", minval=2, maxval=500, step=10, inline="AITrend", group="AI Trend", tooltip=t2)
aisignals = input.bool(true,title="AI Trend Signals",inline="signal", group="AI Trend")
Bullish_col = input.color(color.lime,"",inline="signal", group="AI Trend")
Bearish_col = input.color(color.red,"",inline="signal", group="AI Trend")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Define SuperTrend parameters
len = input.int(10, "Length", minval=1,inline="SuperTrend", group="Super Trend Settings")
factor = input.float(3.0,step=.1,inline="SuperTrend", group="Super Trend Settings", tooltip=t3)
maSrc = input.string("WMA","Moving Average Source", ,inline="", group="Super Trend Settings", tooltip=t4)
upCol = input.color(color.lime,"Bullish Color",inline="col", group="Super Trend Coloring")
dnCol = input.color(color.red,"Bearish Color",inline="col", group="Super Trend Coloring")
neCol = input.color(color.blue,"Neutral Color",inline="col", group="Super Trend Coloring", tooltip=t5)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Calculate the SuperTrend based on the user's choice
vwma = switch maSrc
"SMA" => ta.sma(close*volume, len) / ta.sma(volume, len)
"EMA" => ta.ema(close*volume, len) / ta.ema(volume, len)
"WMA" => ta.wma(close*volume, len) / ta.wma(volume, len)
"RMA" => ta.rma(close*volume, len) / ta.rma(volume, len)
"VWMA" => ta.vwma(close*volume, len) / ta.vwma(volume, len)
atr = ta.atr(len)
upperBand = vwma + factor * atr
lowerBand = vwma - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend
if na(atr )
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Collect data points and their corresponding labels
price = ta.wma(close,KNN_PriceLen)
sT = ta.wma(superTrend,KNN_STLen)
data = array.new_float(n)
labels = array.new_int(n)
for i = 0 to n - 1
data.set(i, superTrend )
label_i = price > sT ? 1 : 0
labels.set(i, label_i)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Define a function to compute distance between two data points
distance(x1, x2) =>
math.abs(x1 - x2)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Define the weighted k-nearest neighbors (KNN) function
knn_weighted(data, labels, k, x) =>
n1 = data.size()
distances = array.new_float(n1)
indices = array.new_int(n1)
// Compute distances from the current point to all other points
for i = 0 to n1 - 1
x_i = data.get(i)
dist = distance(x, x_i)
distances.set(i, dist)
indices.set(i, i)
// Sort distances and corresponding indices in ascending order
// Bubble sort method
for i = 0 to n1 - 2
for j = 0 to n1 - i - 2
if distances.get(j) > distances.get(j + 1)
tempDist = distances.get(j)
distances.set(j, distances.get(j + 1))
distances.set(j + 1, tempDist)
tempIndex = indices.get(j)
indices.set(j, indices.get(j + 1))
indices.set(j + 1, tempIndex)
// Compute weighted sum of labels of the k nearest neighbors
weighted_sum = 0.
total_weight = 0.
for i = 0 to k - 1
index = indices.get(i)
label_i = labels.get(index)
weight_i = 1 / (distances.get(i) + 1e-6)
weighted_sum += weight_i * label_i
total_weight += weight_i
weighted_sum / total_weight
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Classify the current data point
current_superTrend = superTrend
label_ = knn_weighted(data, labels, k, current_superTrend)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Plot
col = label_ == 1?upCol:label_ == 0?dnCol:neCol
plot(current_superTrend, color=col, title="Volume Super Trend AI")
upTrend = plot(superTrend==lowerBand?current_superTrend:na, title="Up Volume Super Trend AI", color=col, style=plot.style_linebr)
Middle = plot((open + close) / 2, display=display.none, editable=false)
downTrend = plot(superTrend==upperBand?current_superTrend:na, title="Down Volume Super Trend AI", color=col, style=plot.style_linebr)
fill_col = color.new(col,90)
fill(Middle, upTrend, fill_col, fillgaps=false,title="Up Volume Super Trend AI")
fill(Middle, downTrend, fill_col, fillgaps=false, title="Down Volume Super Trend AI")
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Ai Super Trend Signals
Start_TrendUp = col==upCol and (col !=upCol or col ==neCol) and aisignals
Start_TrendDn = col==dnCol and (col !=dnCol or col ==neCol) and aisignals
// ~~ Add buy and sell signals
plotshape(Start_TrendUp, title="Buy Signal", location=location.belowbar, color=Bullish_col, style=shape.labelup, text="BUY")
plotshape(Start_TrendDn, title="Sell Signal", location=location.abovebar, color=Bearish_col, style=shape.labeldown, text="SELL")
VWAP on Straddle & Strangle From Sandeep// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © AlgoTest
//@version=5
indicator("VWAP on Straddle & Strangle", overlay = false)
var bool first = true
var strike_gap = map.new()
if first
first := false
strike_gap.put("NIFTY", 50)
strike_gap.put("BANKNIFTY", 100)
strike_gap.put("FINNIFTY", 50)
strike_gap.put("MIDCPNIFTY", 25)
strike_gap.put("SENSEX", 100)
strike_gap.put("CRUDEOIL",50)
spot = input.string( "NIFTY" , title = "Spot Symbol", options = , group = "Index")
tooltip_day = "Enter the day of the expiry. Add 0 infront, if day is in single digit. For eg : 05 instead of 5"
tooltip_month = "Enter the month of the expiry. Add 0 infront, if month is in single digit. For eg : 06 instead of 6"
tooltip_year = "Enter the year of the expiry. Use last digit of the year. For eg : 24 instead of 2024"
_day = input.string( "11" , title = "Expiry Day", tooltip = tooltip_day, group="Expiry Date")
_month = input.string( "07" , title = "Expiry Month", tooltip = tooltip_month, group="Expiry Date")
_year = input.string( "24" , title = "Expiry Year", tooltip = tooltip_year, group="Expiry Date")
tooltip_ = "You can select any Strike, you can also have VWAP on Straddle, Strangle"
strike_ce = input.int(24300, "Call Strike", tooltip = tooltip_, group = "Select Strike")
strike_pe = input.int(24300, "Put Strike", tooltip = tooltip_, group = "Select Strike")
var string symbol_CE = ""
var string symbol_PE = ""
if(spot == "SENSEX")
symbol_CE := spot+"_"+_year+_month+_day+"_C_"+str.tostring(strike_ce)
symbol_PE := spot+"_"+_year+_month+_day+"_P_"+str.tostring(strike_pe)
if(spot != "SENSEX")
symbol_CE := spot+_year+_month+_day+"C"+str.tostring(strike_ce)
symbol_PE := spot+_year+_month+_day+"P"+str.tostring(strike_pe)
= request.security( symbol_CE, timeframe.period , )
= request.security( symbol_PE, timeframe.period , )
call_volume = request.security( symbol_CE, timeframe.period , volume )
put_volume = request.security( symbol_PE, timeframe.period , volume )
straddle_open = call_open + put_open
straddle_close = call_close + put_close
straddle_high = math.max(straddle_open, straddle_close)
straddle_low = math.min(straddle_open, straddle_close)
straddle_volume = call_volume + put_volume
var float sumPriceVolume = 0.0
var float sumVolume = 0.0
var float vwap = 0.0
if (dayofweek != dayofweek )
sumPriceVolume := 0.0
sumVolume := 0.0
vwap := 0.0
sumPriceVolume += straddle_close * straddle_volume
sumVolume += straddle_volume
vwap := sumPriceVolume / sumVolume
plotcandle ( straddle_open , straddle_high , straddle_low , straddle_close , title = "Straddle" , color = straddle_close > straddle_open ? color.green : color.red )
// vwap = ta.vwap(straddle_close)
plot ( vwap , title = "VWAP on Straddle" , color = color.blue , linewidth = 2 )
entry = straddle_close < vwap and straddle_close >= vwap
exit = straddle_close >= vwap and straddle_close < vwap
plotshape(exit, title = "Exit", text = 'Exit', style = shape.labeldown, location = location.top, color= color.red, textcolor = color.white, size = size.tiny)
plotshape(entry, title = "Entry", text = 'Entry', style = shape.labelup, location = location.bottom, color= color.green, textcolor = color.white, size = size.tiny)
alertcondition(exit, "Exit", "Exit")
alertcondition(entry, "Entry", "Entry")
ES Trend-following Strategy with ExitsES Trend-following Strategy with Exits
This Pine Script strategy is designed for trend-following in the ES futures market using the 9 EMA and 50 EMA crossovers, along with RSI and VWAP filters.
Features
Entry Signals:
Long: When the 9 EMA crosses above the 50 EMA, price is above VWAP, and RSI is within the oversold/overbought range.
Short: When the 9 EMA crosses below the 50 EMA, price is below VWAP, and RSI is within the oversold/overbought range.
Exit Signals:
The exit signals provided in this strategy are based on the 9 EMA crossing back below the 50 EMA for long positions, or above the 50 EMA for short positions. However, these exit signals may not be 100% accurate every time.
To ensure you are exiting at the right time, always confirm that the 9 EMA has crossed the 50 EMA before closing your position. If the crossover hasn't occurred, it’s better to wait for it to happen, as exiting too early might result in missed profits.
Note: The exit logic will be refined and updated in future versions to provide more effective and reliable trend reversal signals.
Alerts: Alerts are triggered for entry and exit signals for both long and short positions.
This strategy helps capture strong trends, and the exit logic will be improved for better trend reversal confirmation in future updates.
Note: This script is for educational purposes and should be used at your own discretion. Always test strategies thoroughly before live trading.
SOLUSDT for binance V2SOLUSDT 1시간 봉을 위한 전략
시그날 봇 거래를 위해서 만들어 봄
1거래씩만 하고 잔고 100% 사용, 커미션 0.06% 설정
수익 4%
손절 1.5%
트레이딩뷰 특징 상 딱 들어 맞지는 않습니다.
Volume Bars [jpkxyz]
Multi-Timeframe Volume indicator by @jpkxyz
This script is a Multi-Timeframe Volume Z-Score Indicator. It dynamically calculates /the Z-Score of volume over different timeframes to assess how significantly current
volume deviates from its historical average. The Z-Score is computed for each
timeframe independently and is based on a user-defined lookback period. The
script switches between timeframes automatically, adapting to the chart's current
timeframe using `timeframe.multiplier`.
The Z-Score formula used is: (current volume - mean) / standard deviation, where
mean and standard deviation are calculated over the lookback period.
The indicator highlights periods of "significant" and "massive" volume by comparing
the Z-Score to user-specified thresholds (`zScoreThreshold` for significant volume
and `massiveZScoreThreshold` for massive volume). The script flags buy or sell
conditions based on whether the current close is higher or lower than the open.
Visual cues:
- Dark Green for massive buy volume.
- Red for massive sell volume.
- Green for significant buy volume.
- Orange for significant sell volume.
- Gray for normal volume.
The script also provides customizable alert conditions for detecting significant or massive buy/sell volume events, allowing users to set real-time alerts.