CAD CHF JPY (Index) vs USDDescription:
Analyze the combined performance of CAD, CHF, and JPY against the USD with this customized Forex currency index. This tool enables traders to gain a broader perspective of how these three currencies behave relative to the US Dollar by aggregating their movements into a single index. It’s a versatile tool designed for traders seeking actionable insights and trend identification.
Core Features:
Flexible Display Options:
Choose between Line Mode for a simplified view of the index trend or Candlestick Mode for detailed analysis of price action.
Custom Weight Adjustments:
Fine-tune the weight of each currency pair (USD/CAD, USD/CHF, USD/JPY) to better reflect your trading priorities or market expectations.
Moving Average Integration:
Add a moving average to smooth the data and identify trends more effectively. Choose your preferred type: SMA, EMA, WMA, or VWMA, and configure the number of periods to suit your strategy.
Streamlined Calculation:
The index aggregates data from USD/CAD, USD/CHF, and USD/JPY using a weighted average of their OHLC (Open, High, Low, Close) values, ensuring accuracy and adaptability to different market conditions.
Practical Applications:
Trend Identification:
Use the Line Mode with a moving average to confirm whether CAD, CHF, and JPY collectively show strength or weakness against the USD. A rising trendline signals currency strength, while a declining line suggests USD dominance.
Weight-Based Analysis:
If CAD is expected to lead, adjust its weight higher relative to CHF and JPY to emphasize its influence in the index. This customization makes the indicator adaptable to your market outlook.
Actionable Insights:
Identify key reversal points or breakout opportunities by analyzing the interaction of the index with its moving average. Combined with other technical tools, this indicator becomes a robust addition to any trader’s toolkit.
Additional Notes:
This indicator is a valuable resource for comparing the collective behavior of CAD, CHF, and JPY against the USD. Pair it with additional oscillators or divergence tools for a comprehensive market overview.
Perfect for both intraday analysis and swing trading strategies. Combine it with EUR GPB AUD (Index) indicator.
Good Profits!
Pine utilities
EUR GBP AUD (Index) vs USDDescription:
This indicator calculates a weighted index using three major Forex pairs (EUR/USD, GBP/USD, AUD/USD) to represent their collective performance against the US Dollar (USD). With added functionality for moving averages, it provides a comprehensive tool for analyzing market trends, tracking momentum, and customizing strategies. Offers a holistic view of how major currencies are performing relative to the USD, making it easier to identify market trends and their potential impacts.
Display Modes:
Line (Default): A dynamic line chart with color changes indicating whether the index is above or below 1 USD.
Candles: Japanese candlestick visualization for detailed price action analysis.
Customizable Weights:
Adjust the weight assigned to each currency pair (EUR/USD, GBP/USD, AUD/USD) to reflect your trading priorities. Default weights are balanced, but you can customize them to suit your strategy, ensuring the total does not exceed
Moving Average Integration:
Includes a fully customizable moving average:Choose from SMA, EMA, WMA, or VWMA.Adjust the period length (default: 50).The moving average is plotted alongside the index to help identify trends and key levels.
Weighted Average Calculation:
Uses OHLC (Open, High, Low, Close) data to compute a precise weighted average for the index.
How to Use:
The indicator is designed to track the collective performance of major currencies against the USD. Here are some examples of how it can be used:
Example 1: Trend Confirmation with Moving Averages
Overlay the index with the moving average to confirm trends:If the index is trading above the moving average and the line is green, it signals strength in the major currencies relative to the USD.If the index is below the moving average and the line is red, it suggests potential USD strength.
Example 2: Customize Analysis with Weighted Strategy
Adjust the weights for EUR/USD, GBP/USD, and AUD/USD based on your trading priorities. For instance:If you expect EUR/USD to outperform, increase its weight in the calculation.Use the candlestick mode to observe intraday price action near support/resistance levels for potential trade setups.
Example 3: Momentum Analysis with Trend CCI
Combine this index with your custom Trend CCI indicator to enhance momentum analysis and identify potential trading opportunities:
Rising Index + Trend CCI > +100: Indicates strong bullish momentum in major currencies against the USD. This could signal a continuation of the uptrend or a good time to hold long positions.
Falling Index + Trend CCI < -100: Suggests bearish momentum, indicating a potential continuation of USD strength and an opportunity for short trades or exiting long positions.
Trend CCI Divergence: If the index is rising but the Trend CCI starts to fall, this could indicate weakening bullish momentum and the potential for a reversal.
Explore More:
Check out my other scripts to find CAD CHF JPY (Index) vs USD as well.
es.tradingview.com
RSI Overbought/Oversold Strategy - Haisreeit should be work 4hrs 100% this 80 over bought and 20 over sold straregy.
Repeating Vertical LinesThe "Repeating Vertical Lines" indicator visualizes recurring points in time on the chart by drawing background highlights based on user-defined conditions, including specific weekdays, times, or their combination. Users can customize the color and transparency of the lines for seamless chart integration.
[Helper] Trade Journal TableThis indicator serves as a starting point for creating a customized trade journal that meets individual requirements. It provides a basic structure for visualizing trade data in table form which can be adapt to specific needs. The trade data must be maintained directly within the script using the Pine Editor.
Basic Structure:
The example table consists of six columns: Date, Entry Price, Exit Price, Profit/Loss (color-coded), Strategy, and Notes. It is displayed centrally on the chart and dynamically adjusts to the number of recorded trades.
Example Data:
To demonstrate its functionality, the indicator includes predefined example trades, which should be replaced with actual trading data. Additional information, such as strategies and notes, can be added to improve trade documentation.
Logarithmic WMA Buy-Sell StrategyPowerful, Smart, and Efficient Trading Solution!
Success in financial markets starts with the right tools! Introducing the Logarithmic WMA Buy-Sell Strategy: A unique approach to trend-following, smoothing price movements, and providing clarity to your trading decisions.
Features and Benefits
Logarithmic Precision:
Reduces price fluctuations and eliminates market noise for more accurate analysis.
Dual-Layer Moving Averages:
Identify market trends effortlessly with short- and long-term Weighted Moving Averages (WMA).
Accurate Buy-Sell Signals:
Buy Signal: When the short WMA crosses above the long WMA, it's time to act!
Sell Signal: When the short WMA crosses below the long WMA, manage your risks effectively!
Automated Execution:
The strategy automatically translates buy and sell signals into actions, saving you time.
Real-Time Alerts:
Stay informed at critical moments with TradingView's alert system, ensuring you never miss an opportunity.
Who Is It For?
Professionals using technical analysis in trading.
Investors seeking a reliable trend-following strategy.
Anyone looking for a balanced and efficient analysis tool.
How It Works
Logarithmic Price Transformation: Market data is processed on a logarithmic scale.
Moving Average Crossovers: The intersections between the short and long WMA highlight clear market trends.
Visual Representation: The short WMA (green) and long WMA (red) are plotted on the chart, providing visual clarity for decision-making.
Trade Execution: Buy or sell positions are automatically executed based on the defined signals.
Achieve Your Goals!
With the Logarithmic WMA Buy-Sell Strategy, stay ahead in your financial decisions. Simplify market complexities and pave the way for smarter, more profitable trading outcomes.
Ready for a profitable future? This strategy is built for you!
50 EMA & 100 EMA by dhirajInputs: Allows you to adjust the lengths of the 50 EMA and 100 EMA dynamically.
Calculations: Computes the 50 EMA and 100 EMA using the ta.ema function.
Plots: Displays the two EMAs on the chart with different colors.
Background Color: Optionally colors the background when the 50 EMA crosses above or below the 100 EMA.
Breakout Trading with ATR MenaVerseNombre del Indicador
Breakout Trading with ATR
Propósito del Script
Este indicador está diseñado para ayudar a los traders a identificar posibles rompimientos en los precios, ya sea al alza o a la baja, utilizando el ATR (Average True Range) como medida de volatilidad. Combina niveles de soporte y resistencia con la volatilidad del mercado para establecer puntos de entrada en operaciones de compra y venta.
Características Principales
Identificación de Soporte y Resistencia:
Utiliza un período definido por el usuario (lookback) para identificar el precio más alto (resistencia) y más bajo (soporte) en un rango específico de barras.
Niveles de Rompimiento:
Calcula dos niveles:
Rompimiento Superior: Para señales de compra.
Rompimiento Inferior: Para señales de venta.
Estos niveles se basan en la resistencia, el soporte y el ATR multiplicado por un factor ajustable (multiplier).
Señales de Compra y Venta:
Señal de Compra: Cuando el precio cierra por encima del nivel de rompimiento superior.
Señal de Venta: Cuando el precio cierra por debajo del nivel de rompimiento inferior.
Alertas de Trading:
Notificaciones automáticas para las señales de compra y venta:
"Señal de Compra: El precio rompió la resistencia."
"Señal de Venta: El precio rompió el soporte."
Visualización Intuitiva:
Líneas verdes y rojas para los niveles de rompimiento.
Líneas punteadas naranja y azul para los niveles originales de resistencia y soporte.
Flechas que indican claramente las señales de compra y venta en el gráfico.
Opcional: Mostrar ATR en el Gráfico:
Permite al usuario ver el valor del ATR como una línea adicional en el gráfico, para entender mejor la volatilidad del mercado.
Parámetros Personalizables
ATR Length: El número de períodos para calcular el ATR.
Predeterminado: 14.
ATR Multiplier: Factor que amplifica los niveles de rompimiento con base en la volatilidad.
Predeterminado: 1.5.
Lookback Period for Levels: Número de barras hacia atrás para calcular soporte y resistencia.
Predeterminado: 50.
Show ATR: Opción para mostrar o no el ATR en el gráfico.
Predeterminado: Desactivado.
Cálculos Importantes
ATR (Average True Range):
Calcula la volatilidad promedio de las últimas ATR Length barras.
Niveles de Soporte y Resistencia:
Resistencia: Precio más alto en el rango de lookback.
Soporte: Precio más bajo en el rango de lookback.
Niveles de Rompimiento:
Rompimiento Superior:
Resistencia
+
(
ATR
×
Multiplicador
)
Resistencia+(ATR×Multiplicador)
Rompimiento Inferior:
Soporte
−
(
ATR
×
Multiplicador
)
Soporte−(ATR×Multiplicador)
Visualización
Línea Verde: Nivel de rompimiento superior.
Línea Roja: Nivel de rompimiento inferior.
Línea Naranja: Nivel de resistencia original.
Línea Azul: Nivel de soporte original.
Flechas:
Verde hacia arriba para señales de compra.
Roja hacia abajo para señales de venta.
Uso Práctico
Identificación de Rompimientos:
Usa las líneas de colores para detectar cuando el precio supera los niveles clave.
Señales de Entrada:
Ejecuta operaciones de compra o venta basándote en las flechas y alertas.
Confirmación con ATR:
Utiliza el ATR para evaluar si el mercado tiene suficiente volatilidad para justificar el rompimiento.
Price Level Break & Candle Pattern DetectorPrice Level Break & Candle Pattern Detector
A powerful and customizable indicator that combines price level breakout detection with candlestick pattern analysis to generate precise trading signals.
Key Features
Monitors user-defined price levels for breakouts
Identifies bullish and bearish candle patterns
Generates real-time alerts when both conditions are met
Customizable alert settings for improved trade management
How It Works
The indicator continuously monitors price action around specified price levels. When price breaks through these levels AND forms either a bullish or bearish candle pattern (based on your settings), it triggers an alert. This dual-confirmation approach helps reduce false signals and provides more reliable trading opportunities.
Use Cases
Support/Resistance breakout trading
Key price level monitoring
Trend reversal identification
Breakout confirmation
Risk management tool
Benefits
Reduces false breakout signals through pattern confirmation
Saves time by automating price level monitoring
Helps identify higher-probability trading setups
Customizable to fit various trading strategies
Perfect for both day trading and swing trading
Alert Types
Price level break alerts
Candlestick pattern formation alerts
Combined confirmation alerts
Suggested Settings
Set price levels at major support/resistance zones
Adjust candle pattern sensitivity based on timeframe
Use with multiple timeframes for confirmation
Combine with volume analysis for better accuracy
Geo. Geo.
This library provides a comprehensive set of geometric functions based on 2 simple types for point and line manipulation, point array calculations, some vector operations (Borrowed from @ricardosantos ), angle calculations, and basic polygon analysis. It offers tools for creating, transforming, and analyzing geometric shapes and their relationships.
View the source code for detailed documentation on each function and type.
═════════════════════════════════════════════════════════════════════════
█ OVERVIEW
This library enhances TradingView's Pine Script with robust geometric capabilities. It introduces the Point and Line types, along with a suite of functions for various geometric operations. These functionalities empower you to perform advanced calculations, manipulations, and analyses involving points, lines, vectors, angles, and polygons directly within your Pine scripts. The example is at the bottom of the script. ( Commented out )
█ CONCEPTS
This library revolves around two fundamental types:
• Point: Represents a point in 2D space with x and y coordinates, along with optional 'a' (angle) and 'v' (value) fields for versatile use. Crucially, for plotting, utilize the `.to_chart_point()` method to convert Points into plottable chart.point objects.
• Line: Defined by a starting Point and a slope , enabling calculations like getting y for a given x, or finding intersection points.
█ FEATURES
• Point Manipulation: Perform operations like addition, subtraction, scaling, rotation, normalization, calculating distances, dot products, cross products, midpoints, and more with Point objects.
• Line Operations: Create lines, determine their slope, calculate y from x (and vice versa), and find the intersection points of two lines.
• Vector Operations: Perform vector addition, subtraction, multiplication, division, negation, perpendicular vector calculation, floor, fractional part, sine, absolute value, modulus, sign, round, scaling, rescaling, rotation, and ceiling operations.
• Angle Calculations: Compute angles between points in degrees or radians, including signed, unsigned, and 360-degree angles.
• Polygon Analysis: Calculate the area, perimeter, and centroid of polygons. Check if a point is inside a given polygon and determine the convex hull perimeter.
• Chart Plotting: Conveniently convert Point objects to chart.point objects for plotting lines and points on the chart. The library also includes functions for plotting lines between individual and series of points.
• Utility Functions: Includes helper functions such as square root, square, cosine, sine, tangent, arc cosine, arc sine, arc tangent, atan2, absolute distance, golden ratio tolerance check, fractional part, and safe index/check for chart plotting boundaries.
█ HOW TO USE
1 — Include the library in your script using:
import kaigouthro/geo/1
2 — Create Point and Line objects:
p1 = geo.Point(bar_index, close)
p2 = geo.Point(bar_index , open)
myLine = geo.Line(p1, geo.slope(p1, p2))
// maybe use that line to detect a crossing for an alert ... hmmm
3 — Utilize the provided functions:
distance = geo.distance(p1, p2)
intersection = geo.intersection(line1, line2)
4 — For plotting labels, lines, convert Point to chart.point :
label.new(p1.to_chart_point(), " Hi ")
line.new(p1.to_chart_point(),p2.to_chart_point())
█ NOTES
This description provides a concise overview. Consult the library's source code for in-depth documentation, including detailed descriptions, parameter types, and return values for each function and method. The source code is structured with comprehensive comments using the `//@` format for seamless integration with TradingView's auto-documentation features.
█ Possibilities..
Library "geo"
This library provides a comprehensive set of geometric functions and types, including point and line manipulation, vector operations, angle calculations, and polygon analysis. It offers tools for creating, transforming, and analyzing geometric shapes and their relationships.
sqrt(value)
Square root function
Parameters:
value (float) : (float) - The number to take the square root of
Returns: (float) - The square root of the input value
sqr(x)
Square function
Parameters:
x (float) : (float) - The number to square
Returns: (float) - The square of the input value
cos(v)
Cosine function
Parameters:
v (float) : (series float) - The value to find the cosine of
Returns: (series float) - The cosine of the input value
sin(v)
Sine function
Parameters:
v (float) : (series float) - The value to find the sine of
Returns: (series float) - The sine of the input value
tan(v)
Tangent function
Parameters:
v (float) : (series float) - The value to find the tangent of
Returns: (series float) - The tangent of the input value
acos(v)
Arc cosine function
Parameters:
v (float) : (series float) - The value to find the arc cosine of
Returns: (series float) - The arc cosine of the input value
asin(v)
Arc sine function
Parameters:
v (float) : (series float) - The value to find the arc sine of
Returns: (series float) - The arc sine of the input value
atan(v)
Arc tangent function
Parameters:
v (float) : (series float) - The value to find the arc tangent of
Returns: (series float) - The arc tangent of the input value
atan2(dy, dx)
atan2 function
Parameters:
dy (float) : (float) - The y-coordinate
dx (float) : (float) - The x-coordinate
Returns: (float) - The angle in radians
gap(_value1, __value2)
Absolute distance between any two float values
Parameters:
_value1 (float) : First value
__value2 (float)
Returns: Absolute Positive Distance
phi_tol(a, b, tolerance)
Check if the ratio is within the tolerance of the golden ratio
Parameters:
a (float) : (float) The first number
b (float) : (float) The second number
tolerance (float) : (float) The tolerance percennt as 1 = 1 percent
Returns: (bool) True if the ratio is within the tolerance, false otherwise
frac(x)
frad Fractional
Parameters:
x (float) : (float) - The number to convert to fractional
Returns: (float) - The number converted to fractional
safeindex(x, limit)
limiting int to hold the value within the chart range
Parameters:
x (float) : (float) - The number to limit
limit (int)
Returns: (int) - The number limited to the chart range
safecheck(x, limit)
limiting int check if within the chartplottable range
Parameters:
x (float) : (float) - The number to limit
limit (int)
Returns: (int) - The number limited to the chart range
interpolate(a, b, t)
interpolate between two values
Parameters:
a (float) : (float) - The first value
b (float) : (float) - The second value
t (float) : (float) - The interpolation factor (0 to 1)
Returns: (float) - The interpolated value
gcd(_numerator, _denominator)
Greatest common divisor of two integers
Parameters:
_numerator (int)
_denominator (int)
Returns: (int) The greatest common divisor
method set_x(self, value)
Set the x value of the point, and pass point for chaining
Namespace types: Point
Parameters:
self (Point) : (Point) The point to modify
value (float) : (float) The new x-coordinate
method set_y(self, value)
Set the y value of the point, and pass point for chaining
Namespace types: Point
Parameters:
self (Point) : (Point) The point to modify
value (float) : (float) The new y-coordinate
method get_x(self)
Get the x value of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point to get the x-coordinate from
Returns: (float) The x-coordinate
method get_y(self)
Get the y value of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point to get the y-coordinate from
Returns: (float) The y-coordinate
method vmin(self)
Lowest element of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point
Returns: (float) The lowest value between x and y
method vmax(self)
Highest element of the point
Namespace types: Point
Parameters:
self (Point) : (Point) The point
Returns: (float) The highest value between x and y
method add(p1, p2)
Addition
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (Point) - the add of the two points
method sub(p1, p2)
Subtraction
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (Point) - the sub of the two points
method mul(p, scalar)
Multiplication by scalar
Namespace types: Point
Parameters:
p (Point) : (Point) - The point
scalar (float) : (float) - The scalar to multiply by
Returns: (Point) - the multiplied point of the point and the scalar
method div(p, scalar)
Division by scalar
Namespace types: Point
Parameters:
p (Point) : (Point) - The point
scalar (float) : (float) - The scalar to divide by
Returns: (Point) - the divided point of the point and the scalar
method rotate(p, angle)
Rotate a point around the origin by an angle (in degrees)
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to rotate
angle (float) : (float) - The angle to rotate by in degrees
Returns: (Point) - the rotated point
method length(p)
Length of the vector from origin to the point
Namespace types: Point
Parameters:
p (Point) : (Point) - The point
Returns: (float) - the length of the point
method length_squared(p)
Length squared of the vector
Namespace types: Point
Parameters:
p (Point) : (Point) The point
Returns: (float) The squared length of the point
method normalize(p)
Normalize the point to a unit vector
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to normalize
Returns: (Point) - the normalized point
method dot(p1, p2)
Dot product
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the dot of the two points
method cross(p1, p2)
Cross product result (in 2D, this is a scalar)
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the cross of the two points
method distance(p1, p2)
Distance between two points
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the distance of the two points
method Point(x, y, a, v)
Point Create Convenience
Namespace types: series float, simple float, input float, const float
Parameters:
x (float)
y (float)
a (float)
v (float)
Returns: (Point) new point
method angle(p1, p2)
Angle between two points in degrees
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - the angle of the first point and the second point
method angle_between(p, pivot, other)
Angle between two points in degrees from a pivot point
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to calculate the angle from
pivot (Point) : (Point) - The pivot point
other (Point) : (Point) - The other point
Returns: (float) - the angle between the two points
method translate(p, from_origin, to_origin)
Translate a point from one origin to another
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to translate
from_origin (Point) : (Point) - The origin to translate from
to_origin (Point) : (Point) - The origin to translate to
Returns: (Point) - the translated point
method midpoint(p1, p2)
Midpoint of two points
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (Point) - The midpoint of the two points
method rotate_around(p, angle, pivot)
Rotate a point around a pivot point by an angle (in degrees)
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to rotate
angle (float) : (float) - The angle to rotate by in degrees
pivot (Point) : (Point) - The pivot point to rotate around
Returns: (Point) - the rotated point
method multiply(_a, _b)
Multiply vector _a with _b
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The result of the multiplication
method divide(_a, _b)
Divide vector _a by _b
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The result of the division
method negate(_a)
Negative of vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to negate
Returns: (Point) The negated point
method perp(_a)
Perpendicular Vector of _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The perpendicular point
method vfloor(_a)
Compute the floor of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The floor of the point
method fractional(_a)
Compute the fractional part of the elements from vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The fractional part of the point
method vsin(_a)
Compute the sine of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The sine of the point
lcm(a, b)
Least common multiple of two integers
Parameters:
a (int) : (int) The first integer
b (int) : (int) The second integer
Returns: (int) The least common multiple
method vabs(_a)
Compute the absolute of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The absolute of the point
method vmod(_a, _b)
Compute the mod of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
_b (float) : (float) The mod
Returns: (Point) The mod of the point
method vsign(_a)
Compute the sign of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The sign of the point
method vround(_a)
Compute the round of argument vector _a
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (Point) The round of the point
method normalize_y(p, height)
normalizes the y value of a point to an input height
Namespace types: Point
Parameters:
p (Point) : (Point) - The point to normalize
height (float) : (float) - The height to normalize to
Returns: (Point) - the normalized point
centroid(points)
Calculate the centroid of multiple points
Parameters:
points (array) : (array) The array of points
Returns: (Point) The centroid point
random_point(_height, _width, _origin, _centered)
Random Point in a given height and width
Parameters:
_height (float) : (float) The height of the area to generate the point in
_width (float) : (float) The width of the area to generate the point in
_origin (Point) : (Point) The origin of the area to generate the point in (default: na, will create a Point(0, 0))
_centered (bool) : (bool) Center the origin point in the area, otherwise, positive h/w (default: false)
Returns: (Point) The random point in the given area
random_point_array(_origin, _height, _width, _centered, _count)
Random Point Array in a given height and width
Parameters:
_origin (Point) : (Point) The origin of the area to generate the array (default: na, will create a Point(0, 0))
_height (float) : (float) The height of the area to generate the array
_width (float) : (float) The width of the area to generate the array
_centered (bool) : (bool) Center the origin point in the area, otherwise, positive h/w (default: false)
_count (int) : (int) The number of points to generate (default: 50)
Returns: (array) The random point array in the given area
method sort_points(points, by_x)
Sorts an array of points by x or y coordinate
Namespace types: array
Parameters:
points (array) : (array) The array of points to sort
by_x (bool) : (bool) Whether to sort by x-coordinate (true) or y-coordinate (false)
Returns: (array) The sorted array of points
method equals(_a, _b)
Compares two points for equality
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (bool) True if the points are equal, false otherwise
method max(origin, _a, _b)
Maximum of two points from origin, using dot product
Namespace types: Point
Parameters:
origin (Point)
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The maximum point
method min(origin, _a, _b)
Minimum of two points from origin, using dot product
Namespace types: Point
Parameters:
origin (Point)
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (Point) The minimum point
method avg_x(points)
Average x of point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The average x-coordinate
method avg_y(points)
Average y of point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The average y-coordinate
method range_x(points)
Range of x values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The range of x-coordinates
method range_y(points)
Range of y values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The range of y-coordinates
method max_x(points)
max of x values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The max of x-coordinates
method min_y(points)
min of x values in point array
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (float) The min of x-coordinates
method scale(_a, _scalar)
Scale a point by a scalar
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to scale
_scalar (float) : (float) The scalar value
Returns: (Point) The scaled point
method rescale(_a, _length)
Rescale a point to a new magnitude
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to rescale
_length (float) : (float) The new magnitude
Returns: (Point) The rescaled point
method rotate_rad(_a, _radians)
Rotate a point by an angle in radians
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to rotate
_radians (float) : (float) The angle in radians
Returns: (Point) The rotated point
method rotate_degree(_a, _degree)
Rotate a point by an angle in degrees
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to rotate
_degree (float) : (float) The angle in degrees
Returns: (Point) The rotated point
method vceil(_a, _digits)
Ceil a point to a certain number of digits
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to ceil
_digits (int) : (int) The number of digits to ceil to
Returns: (Point) The ceiled point
method vpow(_a, _exponent)
Raise both point elements to a power
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
_exponent (float) : (float) The exponent
Returns: (Point) The point with elements raised to the power
method perpendicular_distance(_a, _b, _c)
Distance from point _a to line between _b and _c
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
_b (Point) : (Point) The start point of the line
_c (Point) : (Point) The end point of the line
Returns: (float) The perpendicular distance
method project(_a, _axis)
Project a point onto another
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to project
_axis (Point) : (Point) The point to project onto
Returns: (Point) The projected point
method projectN(_a, _axis)
Project a point onto a point of unit length
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to project
_axis (Point) : (Point) The unit length point to project onto
Returns: (Point) The projected point
method reflect(_a, _axis)
Reflect a point on another
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to reflect
_axis (Point) : (Point) The point to reflect on
Returns: (Point) The reflected point
method reflectN(_a, _axis)
Reflect a point to an arbitrary axis
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to reflect
_axis (Point) : (Point) The axis to reflect to
Returns: (Point) The reflected point
method angle_rad(_a)
Angle in radians of a point
Namespace types: Point
Parameters:
_a (Point) : (Point) The point
Returns: (float) The angle in radians
method angle_unsigned(_a, _b)
Unsigned degree angle between 0 and +180 by given two points
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (float) The unsigned angle in degrees
method angle_signed(_a, _b)
Signed degree angle between -180 and +180 by given two points
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (float) The signed angle in degrees
method angle_360(_a, _b)
Degree angle between 0 and 360 by given two points
Namespace types: Point
Parameters:
_a (Point) : (Point) The first point
_b (Point) : (Point) The second point
Returns: (float) The angle in degrees (0-360)
method clamp(_a, _vmin, _vmax)
Restricts a point between a min and max value
Namespace types: Point
Parameters:
_a (Point) : (Point) The point to restrict
_vmin (Point) : (Point) The minimum point
_vmax (Point) : (Point) The maximum point
Returns: (Point) The restricted point
method lerp(_a, _b, _rate_of_move)
Linearly interpolates between points a and b by _rate_of_move
Namespace types: Point
Parameters:
_a (Point) : (Point) The starting point
_b (Point) : (Point) The ending point
_rate_of_move (float) : (float) The rate of movement (0-1)
Returns: (Point) The interpolated point
method slope(p1, p2)
Slope of a line between two points
Namespace types: Point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
Returns: (float) - The slope of the line
method gety(self, x)
Get y-coordinate of a point on the line given its x-coordinate
Namespace types: Line
Parameters:
self (Line) : (Line) - The line
x (float) : (float) - The x-coordinate
Returns: (float) - The y-coordinate
method getx(self, y)
Get x-coordinate of a point on the line given its y-coordinate
Namespace types: Line
Parameters:
self (Line) : (Line) - The line
y (float) : (float) - The y-coordinate
Returns: (float) - The x-coordinate
method intersection(self, other)
Intersection point of two lines
Namespace types: Line
Parameters:
self (Line) : (Line) - The first line
other (Line) : (Line) - The second line
Returns: (Point) - The intersection point
method calculate_arc_point(self, b, p3)
Calculate a point on the arc defined by three points
Namespace types: Point
Parameters:
self (Point) : (Point) The starting point of the arc
b (Point) : (Point) The middle point of the arc
p3 (Point) : (Point) The end point of the arc
Returns: (Point) A point on the arc
approximate_center(point1, point2, point3)
Approximate the center of a spiral using three points
Parameters:
point1 (Point) : (Point) The first point
point2 (Point) : (Point) The second point
point3 (Point) : (Point) The third point
Returns: (Point) The approximate center point
createEdge(center, radius, angle)
Get coordinate from center by radius and angle
Parameters:
center (Point) : (Point) - The center point
radius (float) : (float) - The radius of the circle
angle (float) : (float) - The angle in degrees
Returns: (Point) - The coordinate on the circle
getGrowthFactor(p1, p2, p3)
Get growth factor of spiral point
Parameters:
p1 (Point) : (Point) - The first point
p2 (Point) : (Point) - The second point
p3 (Point) : (Point) - The third point
Returns: (float) - The growth factor
method to_chart_point(point)
Convert Point to chart.point using chart.point.from_index(safeindex(point.x), point.y)
Namespace types: Point
Parameters:
point (Point) : (Point) - The point to convert
Returns: (chart.point) - The chart.point representation of the input point
method plotline(p1, p2, col, width)
Draw a line from p1 to p2
Namespace types: Point
Parameters:
p1 (Point) : (Point) First point
p2 (Point) : (Point) Second point
col (color)
width (int)
Returns: (line) Line object
method drawlines(points, col, ignore_boundary)
Draw lines between points in an array
Namespace types: array
Parameters:
points (array) : (array) The array of points
col (color) : (color) The color of the lines
ignore_boundary (bool) : (bool) The color of the lines
method to_chart_points(points)
Draw an array of points as chart points on the chart with line.new(chartpoint1, chartpoint2, color=linecolor)
Namespace types: array
Parameters:
points (array) : (array) - The points to draw
Returns: (array) The array of chart points
polygon_area(points)
Calculate the area of a polygon defined by an array of points
Parameters:
points (array) : (array) The array of points representing the polygon vertices
Returns: (float) The area of the polygon
polygon_perimeter(points)
Calculate the perimeter of a polygon
Parameters:
points (array) : (array) Array of points defining the polygon
Returns: (float) Perimeter of the polygon
is_point_in_polygon(point, _polygon)
Check if a point is inside a polygon
Parameters:
point (Point) : (Point) The point to check
_polygon (array)
Returns: (bool) True if the point is inside the polygon, false otherwise
method perimeter(points)
Calculates the convex hull perimeter of a set of points
Namespace types: array
Parameters:
points (array) : (array) The array of points
Returns: (array) The array of points forming the convex hull perimeter
Point
A Point, can be used for vector, floating calcs, etc. Use the cp method for plots
Fields:
x (series float) : (float) The x-coordinate
y (series float) : (float) The y-coordinate
a (series float) : (float) An Angle storage spot
v (series float) : (float) A Value
Line
Line
Fields:
point (Point) : (Point) The starting point of the line
slope (series float) : (float) The slope of the line
GOMTRY.
Lost Bar Locator v1 [Yaphott]Lost Bar Locator v1 helps you locate missing data on your chart.
It does this by looking for consecutive bars that have a delta time greater than the current interval.
Two lines are drawn for each group of one or more missing bars:
Bar before the missing bar(s).
Bar after the missing bar(s).
Chart InfoOVERVIEW
What would a general summary of the symbol on the chart look like? Here’s an example: This script was created to help you easily access the essential details of a symbol, which I believe are critical for daily use.
CONCEPTS
When using any indicator or analysing price movement, the characteristics of the chart become important. Each symbol has a unique character and the more we can quickly find out about it, the better. Instead of embedding those details within each individual indicator, it is often more practical to access these data through an external tool. This indicator presents the following results related to the symbol on your chart in a table format:
ID : Ticker ID (Exchange, Base Currency, and Quote Currency)
TIMEFRAME : The chart's time period
START : The starting date of the chart
FINISH : The finishing date of the chart
INTERVAL : The total time between the start and finish dates (based on timeframe). The current bar is not included in the total time until it is closed.
BAR INDEX : The total number of bars on the chart (can also be viewed in both forward and backward directions in the data window as a series type).
VOLATILITY : Percentage ratio of 14-bar ATR to close.
CHANGE : The daily percentage change.
HODL : The percentage return that would be gained if the symbol had been bought and held since the first bar.
DAILY BUY : The percentage return that would be gained if the same amount of buying was made daily (a kind of DCA).
MECHANICS
This is a very simple script. I didn't add user-defined timestamp inputs because I didn’t want to overwhelm the indicator with parameters. However, if requested, i can make improvements in this direction in a second version.
NOTES
I live in Istanbul, so I designed the default timezone offset as GMT+3. Please remember to adjust it according to your own timezone to ensure the date results are accurate.
I hope it helps everyone. Do not forget to manage your risk. And trade as safely as possible. Best of luck!
[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.
Pivot and Golden Crossover Swing Strategy### Strategy Description:
This **Pivot and Golden Crossover Swing Strategy** combines moving averages and pivot points to identify potential swing trade opportunities. It is designed for traders who want to leverage momentum and key price levels in their decisions.
#### Key Features:
1. **Golden Crossover**:
- A long position is triggered when the short moving average (50-period by default) crosses above the long moving average (200-period by default).
- A short position is triggered when the short moving average crosses below the long moving average.
2. **Pivot Points**:
- Identifies recent high and low pivot levels based on a user-defined lookback period (default is 5 candles).
- Pivot points are used to determine entry levels and calculate stop-loss and take-profit targets.
3. **Risk Management**:
- Stop-loss levels are set relative to pivot points with a user-defined multiplier (default: 1.5x).
- Take-profit targets are based on the distance between moving averages, adjusted by a multiplier (default: 2.0x).
4. **Visual Indicators**:
- Moving averages are plotted on the chart for trend visualization.
- Pivot points are marked with triangle shapes for easy identification.
#### Use Case:
This strategy works well in trending markets where golden crossovers indicate momentum shifts. The pivot points ensure precise trade management, making it suitable for swing traders aiming to capture medium-term price movements.
Let me know if you'd like any further details or adjustments!
TTZConcept GOLD XAUUSD Lot CalculatorThe Gold Lot Size Calculator for XAU/USD on TradingView is a powerful and user-friendly tool designed by TTZ Concept to help traders calculate the optimal lot size for their Gold trades based on their account size, risk tolerance, and the price movement of Gold (XAU/USD). Whether you're a beginner or an experienced trader, this tool simplifies position sizing, ensuring that your trades align with your risk management strategy.
Key Features:
Accurate Lot Size Calculation: Calculates the optimal lot size for XAU/USD trades based on your specified account balance and the percentage of risk per trade.
Flexible Risk Management**: Input your desired risk percentage (e.g., 1%, 2%) to ensure that you are not risking more than you're comfortable with on any single trade.
Customizable Inputs: Enter your account balance, risk percentage, stop loss (in pips), and leverage to get an accurate lot size recommendation.
Real-Time Data The tool uses real-time Gold price data to calculate the position size, ensuring that your risk management is always up to date with market conditions.
-Simple Interface: With easy-to-use sliders and input fields, you can quickly adjust your parameters and get the required lot size in seconds.
No Complicated Calculations Automatically factors in the pip value and contract specifications for XAU/USD, eliminating the need for manual calculations.
How It Works:
1. Input your trading account balance: The tool calculates based on your total equity.
2. Set your risk percentage: Choose how much of your account you want to risk on a single trade.
3. Define your stop loss in pips: Specify the distance of your stop loss from the entry point.
4. Get your recommended lot size: Based on your inputs, the tool will calculate the ideal lot size for your trade.
Why Use This Tool?
Precise Risk Management: Take control of your trading risk by ensuring that each trade is positioned according to your risk tolerance.
Save Time: No need for manual calculations — let the calculator handle the complex math and focus on your strategy.
Adapt to Changing Market Conditions: As the price of Gold (XAU/USD) fluctuates, your lot size adapts to ensure consistent risk management across different market conditions.
Perfect for:
- Gold traders (XAU/USD)
- Beginners seeking to understand position sizing and risk management
- Experienced traders looking to streamline their trading process
- Anyone who trades Gold futures, CFDs, or spot Gold in their trading account
Session Bar/Candle ColoringChange the color of candles within a user-defined trading session. Borders and wicks can be changed as well, not just the body color.
PREFACE
This script can be used an educational resource for those who are interested in learning Pine Script. Therefore, the script is published open source and is organized in a manner that follows the recommended Style Guide .
While the main premise of the indicator is rather simple, the script showcases various things that can be achieved such as conditional plotting, alignment of indicator settings, user input validation, script optimization, and more. The script also has examples of taking into consideration the chart timeframe and/or different chart types (Heikin Ashi, Renko, etc.) that a user might be running it on. Note: for complete beginners, I strongly suggest going through the Pine Script User Manual (possibly more than once).
FEATURES
Besides being able to select a specific time window, the indicator also provides additional color settings for changing the background color or changing the colors of neutral/indecisive candles, as shown in the image below.
This allows for a higher level of customization beyond the TradingView chart settings or other similar scripts that are currently available.
HOW TO USE
First, define the intraday trading session that will contain the candles to modify. The session can be limited to specific days of the week.
Next, select the parts of the candles that should be modified: Body, Borders, Wick, and/or Background.
For each of the candle parts that were enabled, you can select the colors that will be used depending on whether a candle is bullish (⇧), bearish (⇩), or neutral (⇆).
All other indicator settings will have a detailed tooltip to describe its usage and/or effect.
LIMITATIONS
The indicator is not intended to function on Daily or higher timeframes due to the intraday nature of session time windows.
The indicator cannot always automatically detect the chart type being used, therefore the user is requested to manually input the chart type via the " Chart Style " setting.
Depending on the available historical data and the selected choice for the " Portion of bar in session " setting, the indicator may not be able to update very old candles on the chart.
EXAMPLE USAGE
This section will show examples of different scenarios that the indicator can be used for.
Emphasizing a main trading session.
Defining a "Pre/post market hours background" like is available for some symbols (e.g., NASDAQ:AAPL ).
Highlighting in which bar the midnight candle occurs.
Hiding indecision bars (neutral candles).
Showing only "Regular Trading Hours" for a chart that does not have the option to toggle ETH/RTH. To achieve this, the actual chart data is hidden, and only the indicator is visible; alternatively, a 2nd instance of the indicator could change colors to match the chart background.
Using a combination of Bars and Japanese Candlesticks. Alternatively, this could be done by hiding the main chart data and using 2 instances of the indicator (one with " Chart Style " setting as Bars , and the other set to Candles ).
Using a combination of thin and thick bars on Range charts. Note: requires disabling the "Thin Bars" setting for Bar charts in the TradingView chart settings.
NOTES
If using more than one instance of this indicator on the same chart, you can use the TradingView "Save Indicator Template" feature to avoid having to re-configure the multiple indicators at a later time.
This indicator is intended to work "out-of-the-box" thanks to the behind_chart option introduced to Pine Script in October 2024. But you can always manually bring the indicator to the front just in case the color changes are not being seen (using the "More" option in the indicator status line: More > Visual Order > Bring to front ).
Many thanks to fikira for their help and inspiring me to create open source scripts.
Any feedback including bug reports or suggestions for improving the indicator (or source code itself) are always welcome in the comments section.
6 Band Parametric EQThis indicator implements a complete parametric equalizer on any data source using high-pass and low-pass filters, high and low shelving filters, and six fully configurable bell filters. Each filter stage features standard audio DSP controls including frequency, Q factor, and gain where applicable. While parametric EQ is typically used for audio processing, this implementation raises questions about the nature of filtering in technical analysis. Why stop at simple moving averages when you can shape your signal's frequency response with surgical precision? The answer may reveal more about our assumptions than our indicators.
Filter Types and Parameters
High-Pass Filter:
A high-pass filter attenuates frequency components below its cutoff frequency while passing higher frequencies. The Q parameter controls resonance at the cutoff point, with higher values creating more pronounced peaks.
Low-Pass Filter:
The low-pass filter does the opposite - it attenuates frequencies above the cutoff while passing lower frequencies. Like the high-pass, its Q parameter affects the resonance at the cutoff frequency.
High/Low Shelf Filters:
Shelf filters boost or cut all frequencies above (high shelf) or below (low shelf) the target frequency. The slope parameter determines the steepness of the transition around the target frequency , with a value of 1.0 creating a gentle slope and lower values making the transition more abrupt. The gain parameter sets the amount of boost or cut in decibels.
Bell Filters:
Bell (or peaking) filters create a boost or cut centered around a specific frequency. A bell filter's frequency parameter determines the center point of the effect, while Q controls the width of the affected frequency range - higher Q values create a narrower bandwidth. The gain parameter defines the amount of boost or cut in decibels.
All filters run in series, processing the signal in this order: high-pass → low shelf → bell filters → high shelf → low-pass. Each stage can be independently enabled or bypassed.
The frequency parameter for all filters represents the period length of the targeted frequency component. Lower values target higher frequencies and vice versa. All gain values are in decibels, where positive values boost and negative values cut.
The 6-Band Parametric EQ combines these filters into a comprehensive frequency shaping tool. Just as audio engineers use parametric EQs to sculpt sound, this indicator lets you shape market data's frequency components with surgical precision. But beyond its technical implementation, this indicator serves as a thought experiment about the nature of filtering in technical analysis. While traditional indicators often rely on simple moving averages or single-frequency filters, the parametric EQ takes this concept to its logical extreme - offering complete control over the frequency domain of price action. Whether this level of filtering precision is useful for analysis is perhaps less important than what it reveals about our assumptions regarding market data and its frequency components.
Fibonacci Retracement MTF/LOGIn Pine Script, there’s always a shorter way to achieve a result. As far as I can see, there isn’t an indicator among the community scripts that can produce Fibonacci Retracement levels (linear and logarithmic) as multiple time frame results based on a reference 🍺 This script, which I developed a long time ago, might serve as a starting point to fill this gap.
OVERVIEW
This indicator is a short and simple script designed to display Fibonacci Retracement levels on the chart according to user preferences, aiming to build the structure of support and resistance.
ORIGINALITY
This script:
Can calculate 'retracement' results from higher time frames.
Can recall previous time frame results using its reference parameter.
Performs calculations based on both linear and logarithmic scales.
Offers optional multipliers and appearance settings to simplify users’ tasks
CONCEPTS
Fibonacci Retracement is a technical analysis tool used to predict potential reversal points in an asset's price after a significant movement. This indicator identifies possible support and resistance levels by measuring price movements between specific points in a trend, using certain ratios derived from the Fibonacci sequence. It is based on impulsive price actions.
MECHANICS
This indicator first identifies the highest and lowest prices in the time frame specified by the user. Next, it determines the priority order of the bars where these prices occurred. Finally, it defines the trend direction. Once the trend direction is determined, the "Retracement" levels are constructed.
FUNCTIONS
The script contains two functions:
f_ret(): Generates levels based on the multiplier parameter.
f_print(): Handles the visualization by drawing the levels on the chart and positioning the labels in alignment with the levels. It utilizes parameters such as ordinate, confirmation, multiplier, and color for customization
NOTES
The starting bar for the time frame entered by the user must exist on the chart. Otherwise, the trend direction cannot be determined correctly, and the levels may be drawn inaccurately. This is also mentioned in the tooltip of the TimeFrame parameter.
I hope it helps everyone. Do not forget to manage your risk. And trade as safely as possible. Best of luck!
Outside Bar Strategy % (Alessio)Outside Bar Strategy %
This strategy is based on identifying Outside Bars, which occur when the current bar's high is higher than the previous bar's high and its low is lower than the previous bar's low. The strategy enters trades in the direction of the Outside Bar, offering a powerful way to capture price moves following a strong price expansion.
Key Features:
Long and Short Entries: The strategy enters a Long trade when the Outside Bar closes bullish (current close > open), and a Short trade when the Outside Bar closes bearish (current close < open).
Customizable Entry Levels: The entry point is calculated based on a customizable percentage of the Outside Bar's range, allowing flexibility for traders to fine-tune their entries at 50% or 70% of the bar's range.
Stop Loss (SL) and Take Profit (TP):
Stop Loss (SL) is automatically placed at the Outside Bar's low for Long trades and at its high for Short trades.
Take Profit (TP) is calculated as a percentage of the Outside Bar's range, with customizable settings for take-profit levels.
Visual Indicators:
Entry, Stop Loss, and Take Profit levels are plotted as lines on the chart, with customizable colors and widths for easy identification.
Labels are placed on the chart to indicate whether the trade is Long or Short, positioned above or below the Outside Bar's candlestick.
Alerts: Users can enable alerts to receive notifications when a trade is triggered, including details such as entry points and stop loss levels.
Strategy Parameters:
Entry Percentage: Set the entry level as a percentage of the Outside Bar's range (e.g., 50%, 70%).
Take Profit Percentage: Customize the Take Profit level as a percentage of the Outside Bar's range.
Customizable Colors and Line Widths: Adjust the colors and thickness of the entry, stop loss, and take profit lines to fit your preferences.
Alerts: Enable alerts to be notified when a trade is executed or when the entry level is reached.
This strategy is ideal for traders who want to capitalize on significant price moves after a breakout, with clear risk management through Stop Loss and Take Profit levels. The customizable features make it suitable for various market conditions and trading styles.
nifty supertrend tritonTrend based Strategy based on EMA , ATR and supertrend . Currently being used and testing on Nifty and Banknifty with adjusted parameters .
Do backtest before taking any trade
Bitcoin vs Mag7 Combined IndexThis Mag7 Combined Index script is a custom TradingView indicator that calculates and visualizes the collective performance of the Magnificent 7 (Mag7) stocks—Apple, Microsoft, Alphabet, Amazon, NVIDIA, Tesla, and Meta (red line) compared to Bitcoin (blue line). It normalizes the daily closing prices of each stock to their initial value on the chart, scales them into percentages, and then computes their simple average to form a combined index. The result is plotted as a single line, offering a clear view of the aggregated performance of these influential stocks over time compared to Bitcoin.
This indicator is ideal for analyzing the overall market impact of the Mag7 compared to Bitcoin.
Solid Background for Current CandleWhat Does This Script Do?
Background Reflects Current Candle:
The entire chart background changes to green if the current candle is bullish (close > open).
It changes to red if the current candle is bearish (close < open).
Solid Background Without Per-Candle Behavior:
The background doesn't depend on individual candle colors. It applies one unified color for the entire chart based on the current candle's direction.
Uses a Box to Cover the Chart:
Instead of using bgcolor (which applies per candle), this script creates a large invisible rectangle (box) that spans the entire chart area.
The box dynamically updates its color with each new candle.
Swing Points AlertSwing Points Alert with Adjustable Delay
Description:
This script is designed to detect and alert traders about significant swing highs and lows on the chart. The script is equipped with customizable pivot detection settings and an innovative **Alert Delay** mechanism, allowing users to fine-tune their notifications to reduce noise and focus on key price movements.
Key Features:
1. **Swing High/Low Detection:**
- Identifies swing highs and lows based on user-defined pivot length.
- Visualizes these points with customizable labels for clarity.
2. **Customizable Alerts:**
- Enables real-time alerts for swing highs and lows.
- Users can adjust the delay for alerts to avoid false signals during volatile periods.
3. **Dynamic Label Management:**
- Automatically manages the number of displayed swing point labels.
- Removes crossed or outdated labels based on user preferences.
4. **Flexible Label Styling:**
- Provides multiple label styles (e.g., triangles, circles, arrows) and color customization for both swing highs and lows.
How the Alert Delay Works:
The **Alert Delay** helps filter signals by introducing a delay before triggering alerts. The delay is calculated as follows:
**Alert Delay (%) x Time Frame = Alert Delay in Time Frame Units**
For example:
- If the **Alert Delay** is set to 30% and the timeframe is **15 minutes**, the alert will be triggered after a delay of:
\
This ensures the alert is triggered only if the swing high/low condition remains valid for at least 4.5 minutes.
Important Notes:
1. **Timeframe Sensitivity:**
- This script is optimized for use across various timeframes, but users must adjust the **Alert Delay** percentage to match their trading style and timeframe.
- For example, higher timeframes may require lower delay percentages for timely alerts.
2. **Customization Options:**
- Easily customize pivot detection length, alert delay, label styles, and colors to suit your preferences.
3. **Support:**
- If you encounter any challenges or need help optimizing the script for your specific trading scenario, feel free to reach out for assistance.