Price Action Plus [tambangEA]Price Action Plus is all-in-one indicator toolkit which includes various features specifically based on Price Action Plus Moving Average.
Order Blocks with volumetric data, real-time market structure, a MTF dashboard, and much more detailed customization to get an edge trading price action automatically.
Mostly all of the features within this script are generated purely from price action with moving averages as a trend indicator, which allows users to automate their analysis of price action for any market / timeframe.
🔶 FEATURES
This script includes many features based on Price Action; these are highlighted below:
Market structure (BOS, CHoCH, CHoCH+) (Internal & Swing)
Volumetric Order Blocks (Bullish & Bearish)
Previous Highs/Lows (Daily, Weekly, Monthly, Quarterly)
Premium & Discount Zones
Fair Value Gaps
Multi-Timeframe Dashboard
EMA Multi Timeframe Settings
Fibonacci : Volume , Levels
Volume
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.
Bullish-Bearish Volume Sum Histogram with EMAsum volume for bullish and bearish candles for the last x candles and display the gap
13/200 EMA Cross with pullback entry (Trend Filter)This indicator first tracks a 13/200 ema cross
then provides a trend affirming dot as the price pulls back to the 13 ema
allowing for optimal trend following entry opportunities.
Indicator includes a 13 and 200 ema and customizable icons to your liking
Also the indicator does not include signals contrary to the trend
(only bullish pullbacks above 200 ema and only bearish below)
as per trend following rules
enjoy :)
Buyer-Seller VolumeThe indicator is based on a simple logic. It separates buy volume and sell volume according to the Price % change rate between the previous bar and the default bar. Positive change rate is called buy volume, negative change is called sell volume.
Fill Area: Shows buyer and seller dominance.
Green-Red Lines: Shows buyer and seller pressure according to the previous bar in the forward movement.
Reptile Candle Marker with ArrowsReptile Candle Marker
The Reptile Candle Marker is a custom indicator designed to identify a specific pattern in price action, known as the "reptile candle." This pattern is characterized by a small body with long wicks on both the upper and lower sides. These candles often indicate indecision or a reversal in the market, making them useful for traders looking for potential turning points.
Key Features:
Small Body and Large Wicks: The indicator highlights candles with a small body relative to the overall candle range, accompanied by long upper and lower wicks. This is achieved by comparing the size of the wicks to the body and the overall candle range.
Volume Confirmation: The indicator ensures that the identified candles are accompanied by high volume, which serves as confirmation of the significance of the price action.
Visual Highlighting: When a "reptile" candle is detected, the body of the candle and the wicks are both colored yellow. This allows for easy identification on the chart.
Custom Wick Lines: To ensure the wicks stand out, the indicator draws yellow lines above and below the candles, representing the upper and lower wicks. These lines remain fixed in place even as the chart is scaled or moved.
How It Works:
The indicator identifies candles where:
The upper wick is longer than the body by a specified ratio.
The lower wick is longer than the body by the same ratio.
The candle's body size is small compared to the total candle range (less than 30% of the range).
The volume is significantly higher than the 20-period moving average volume, indicating increased market activity.
When these conditions are met, the indicator marks the candle by coloring its body and wicks yellow. Additionally, it draws custom yellow wick lines to visually represent the wick size.
How to Use:
This indicator is designed to highlight potential reversal points or periods of indecision in the market. Traders can use it to spot possible turning points, especially when accompanied by other technical analysis tools such as support/resistance levels or trend indicators.
Customizable Parameters:
Wick to Body Ratio: Controls the sensitivity for detecting large wicks relative to the candle body.
Volume Factor: Adjusts the threshold for identifying candles with significantly higher volume than the moving average.
Chart VWAPChart VWAP 2 for testing reason that allow as to know if trading view allow us using pine editor in cutome web page
FOLLOW TREND CUANTEROUSSS//@version=5
indicator("Follow Trend EMA Volume", overlay=true)
/// Mengatur panjang EMA yang dibutuhkan
ema5 = ta.ema(close, 5)
ema7 = ta.ema(close, 7)
ema21 = ta.ema(close, 21)
ema34 = ta.ema(close, 34)
ema55 = ta.ema(close, 55)
ema90 = ta.ema(close, 90)
ema100 = ta.ema(close, 100)
ema161 = ta.ema(close, 161)
ema200 = ta.ema(close, 200)
/// Menghitung rata-rata EMA untuk menentukan tren dominan
ema_avg = (ema5 + ema7 + ema21 + ema34 + ema55 + ema90 + ema100 + ema161 + ema200) / 9
/// Menghitung volume rata-rata untuk menyaring sinyal
vol_avg = ta.sma(volume, 20) // Volume rata-rata 20 periode
/// Aturan untuk trend dominan berdasarkan posisi harga terhadap EMA rata-rata
bullish_trend = close > ema_avg and volume > vol_avg
bearish_trend = close < ema_avg and volume > vol_avg
/// Warna berdasarkan trend dominan
color_trend = bullish_trend ? color.blue : bearish_trend ? color.red : na
/// Plot garis trend dengan warna yang berubah
plot(ema_avg, color=color_trend, linewidth=3, title="Trend Line")
Bullish-Bearish Volume Sum Cross EmasBullish-Bearish Volume Sum Histogram with Two EMAs and Cross Circles
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 :)
Cuanterousss Trend//@version=5
indicator("Follow Trend EMA Volume", overlay=true)
/// Mengatur panjang EMA yang dibutuhkan
ema5 = ta.ema(close, 5)
ema7 = ta.ema(close, 7)
ema21 = ta.ema(close, 21)
ema34 = ta.ema(close, 34)
ema55 = ta.ema(close, 55)
ema90 = ta.ema(close, 90)
ema100 = ta.ema(close, 100)
ema161 = ta.ema(close, 161)
ema200 = ta.ema(close, 200)
/// Menghitung rata-rata EMA untuk menentukan tren dominan
ema_avg = (ema5 + ema7 + ema21 + ema34 + ema55 + ema90 + ema100 + ema161 + ema200) / 9
/// Menghitung volume rata-rata untuk menyaring sinyal
vol_avg = ta.sma(volume, 20) // Volume rata-rata 20 periode
/// Aturan untuk trend dominan berdasarkan posisi harga terhadap EMA rata-rata
bullish_trend = close > ema_avg and volume > vol_avg
bearish_trend = close < ema_avg and volume > vol_avg
Multiple Moving Average Vol 1.Popular strategy in technical analysis, where traders use moving averages (MAs) to identify trends and potential entry or exit points for trades. Moving averages help smooth out price data over a specified period, making it easier to see price trends by filtering out short-term fluctuations
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
Directional Volatility and Volume with Three ATR Bandsadded some effects on @PuguForex indiactor " Directional Volatility and Volume "using chatgpt
would like some help crating exiting stuff since am lazy on these kind of stuff but consider of having of some what some brain
long/short price hits red
high win-rate or breakeven low losses (AT YOUR OWN COST)
small percentage add up
play with yellow on your cost
better using DCA on reds to see better result to avoid extreme case seniors multiplying it
exept if your going oppisite of the narritive / cycle / market / flow than your a ignorrant / cursed / stupid (sorry)
(maybe some updated edits coming on the way)
THANK ALLAH ALL TIME AND ASK FOR HIS FORGIVNESS AS YOUR A LIVE NO TIME LEFT
WORSHIP HIM ALONE WITH NO CAMPANIONS
PEACE AND MERCY AND BLESSING TO YOU
Rupee Volume in CroreThis indicator show the Rupees volume in crore.
How its calculated
Rupee Volume = Price of Security * Total volume of shares traded that day
This indicator also has a moving average to show average rupee volume over a period which you can customize
Reptile Candle MarkerReptile Candle Marker
The Reptile Candle Marker is a custom indicator designed to identify a specific pattern in price action, known as the "reptile candle." This pattern is characterized by a small body with long wicks on both the upper and lower sides. These candles often indicate indecision or a reversal in the market, making them useful for traders looking for potential turning points.
Key Features:
Small Body and Large Wicks: The indicator highlights candles with a small body relative to the overall candle range, accompanied by long upper and lower wicks. This is achieved by comparing the size of the wicks to the body and the overall candle range.
Volume Confirmation: The indicator ensures that the identified candles are accompanied by high volume, which serves as confirmation of the significance of the price action.
Visual Highlighting: When a "reptile" candle is detected, the body of the candle and the wicks are both colored yellow. This allows for easy identification on the chart.
Custom Wick Lines: To ensure the wicks stand out, the indicator draws yellow lines above and below the candles, representing the upper and lower wicks. These lines remain fixed in place even as the chart is scaled or moved.
How It Works:
The indicator identifies candles where:
The upper wick is longer than the body by a specified ratio.
The lower wick is longer than the body by the same ratio.
The candle's body size is small compared to the total candle range (less than 30% of the range).
The volume is significantly higher than the 20-period moving average volume, indicating increased market activity.
When these conditions are met, the indicator marks the candle by coloring its body and wicks yellow. Additionally, it draws custom yellow wick lines to visually represent the wick size.
How to Use:
This indicator is designed to highlight potential reversal points or periods of indecision in the market. Traders can use it to spot possible turning points, especially when accompanied by other technical analysis tools such as support/resistance levels or trend indicators.
Customizable Parameters:
Wick to Body Ratio: Controls the sensitivity for detecting large wicks relative to the candle body.
Volume Factor: Adjusts the threshold for identifying candles with significantly higher volume than the moving average.
VWAPs [crlmx]VWAP indicator triple with daily weekly monthly averages and none of the gap connecting segment that hurt the eye
Custom AO with Open Difference**Custom AO with Open Difference Indicator**
This indicator, *Custom AO with Open Difference*, is designed to help confirm trend direction based on the relationship between the daily open price and recent 4-hour open prices. It calculates the Awesome Oscillator (AO) based on the difference between the daily open price and the average of the previous six 4-hour open prices. This approach provides insight into whether the current open price is significantly diverging from recent short-term opens, which can indicate a trend shift or continuation.
### Technical Analysis and Features
1. **Trend Confirmation**: By comparing the daily open with the mean of six previous 4-hour open prices, this indicator helps identify trends. When the current daily open is below the average of recent opens, the AO value will plot as green, signaling potential upward momentum. Conversely, if the daily open is above the recent average, the histogram will plot red, suggesting possible downward momentum.
2. **Non-Repainting**: Since it relies on completed 4-hour and daily open prices, this indicator does not repaint, ensuring that all values remain fixed after the close of each period. This non-repainting feature makes it suitable for backtesting and reliable for trend confirmation without fear of historical changes.
3. **AO Mean Calculation**: The indicator calculates the average of six previous 4-hour open prices, providing a smoothed value to reduce short-term noise. This helps in identifying meaningful deviations, making the AO values a more stable basis for trend determination than using just the latest 4-hour or daily open.
4. **Histogram for Visual Clarity**: The indicator is displayed as a histogram, making it easy to identify trend changes visually. If the AO bar turns green, it’s a signal that the 4-hour average is below the daily open, suggesting an uptrend or bullish momentum. Red bars indicate that the daily open is above the recent 4-hour averages, potentially signaling a downtrend or bearish momentum.
### Practical Application
The *Custom AO with Open Difference* is a versatile tool for confirming the open price trend without needing complex oscillators or lagging indicators. Traders can use this tool to gauge the market sentiment by observing open price variations and use it as a foundation for decision-making in both short-term and daily timeframes. Its non-repainting nature adds reliability for traders using this indicator as part of a broader trading strategy.
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")
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.
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.