RSI MACD Combined Color StrategyOverview
This indicator combines RSI and MACD signals to create a powerful visual trading system, inspired by TrendSpider's AI Strategy Coder examples. It colors candles based on the alignment of three key technical conditions, providing clear visual signals for potential trend strength and direction.
Technical Components
Core Conditions
RSI (Relative Strength Index) > 50
Indicates bullish momentum when price is trading above the centerline
Traditional indicator of trend strength
MACD Line > Signal Line
Shows positive momentum
Classic signal for potential upward movement
MACD Line > 0
Confirms bullish territory
Indicates overall positive momentum
Color Coding System
🟢 Green Candles: All three conditions are met
Strongest bullish signal
Suggests high probability trading opportunities
⚪ Grey Candles: One or two conditions are met
Neutral or transitioning market
Suggests caution or waiting for stronger confirmation
🔴 Red Candles: No conditions are met
Bearish signal
Suggests potential downward pressure
How to Use This Indicator
For Entry Signals
Look for transitions from red or grey to green candles
Green candles suggest strong bullish alignment
Consider entering long positions when candles turn green
For Exit Signals
Watch for color transitions from green to grey or red
Consider taking profits when candles change from green to grey
Consider stop losses when candles turn red
Risk Management
Use color transitions as part of your broader strategy
Don't rely solely on color changes for trading decisions
Combine with other technical analysis tools and risk management practices
Customizable Parameters
RSI Length (default: 14)
MACD Fast Length (default: 12)
MACD Slow Length (default: 26)
MACD Signal Length (default: 9)
Best Practices
Use multiple timeframes for confirmation
Look for confluences with support/resistance levels
Consider volume and market context
Start with default settings and adjust based on your trading style
Backtest different parameter combinations
Notes
This indicator works best in trending markets
Grey candles can indicate transition periods
Consider market conditions and volatility when interpreting signals
Credits
Inspired by TrendSpider's AI Strategy Coder examples and adapted for TradingView using Pine Script v5.
Disclaimer
This technical indicator is for informational purposes only. Always conduct your own analysis and consider risk management principles before making trading decisions. Past performance does not guarantee future results.
Индикаторы и стратегии
Intrablast Strategy Advance-RanjeetThe "Intrablast Strategy Advance-Ranjeet" indicator is a custom Pine Script that identifies buy and sell signals based on Weighted Moving Averages (WMAs) and an Exponential Moving Average (EMA). It calculates two WMAs with user-defined lengths (default: 8 and 13) and a 21-period EMA. A buy signal is generated when the shorter WMA crosses above the longer WMA (golden cross) and the price is above the EMA. Conversely, a sell signal is triggered when the shorter WMA crosses below the longer WMA (death cross) and the price is below the EMA. The indicator visually plots the EMA line and marks buy/sell signals on the chart with green and red arrows.
OPEX2025Credit to "ochlocracy" for the initial build of this.
Shows monthly and quarterly expirations
I have updated with 2025 dates
Enjoy
Relative Risk MetricOVERVIEW
The Relative Risk Metric is designed to provide a relative measure of an asset's price, within a specified range, over a log scale.
PURPOSE
Relative Position Assessment: Visualizes where the current price stands within a user-defined range, adjusted for log scale.
Logarithmic Transformation: Utilizes the natural log to account for a log scale of prices, offering a more accurate representation of relative positions.
Calculation: The indicator calculates a normalized value via the function Relative Price = / log(UpperBound) − log(LowerBound) . The result is a value between 0 and 1, where 0 corresponds to the lower bound and 1 corresponds to the upper bound on a log scale.
VISUALIZATION
The indicator plots three series:
Risk Metric - a plot of the risk metric value that’s computed from an asset's relative price so that it lies within a logarithmic range between 0.0 & 1.0.
Smoothed Risk Metric - a plot of the risk metric that’s been smoothed.
Entry/Exit - a scatter plot for identified entry and exit. Values are expressed as percent and are coded as red being exit and green being entity. E.g., a red dot at 0.02 implies exit 2% of the held asset. A green dot at 0.01 implies use 1% of a designated capital reserve.
USAGE
Risk Metric
The risk metric transformation function has several parameters. These control aspects such as decay, sensitivity, bounds and time offset.
Decay - Acts as an exponent multiplier and controls how quickly dynamic bounds change as a function of the bar_index.
Time Offset - provides a centering effect of the exponential transformation relative to the current bar_index.
Sensitivity - controls how sensitive to time the dynamic bound adjustments should be.
Baseline control - Serves as an additive offset for dynamic bounds computation which ensures that bounds never become too small or negative.
UpperBound - provides headroom to accomodate growth an assets price from the baseline. For example, an upperbound of 3.5 accommodates a 3.5x growth from the baseline value (e.g., $100 -> $350).
LowerBound - provides log scale compression such that the overall metric provides meaningful insights for prices well below the average whilst avoiding extreme scaling. A lowerbound of 0.25 corresponds to a price that is approx one quarter of a normalised baseline in a log context.
Weighted Entry/Exit
This feature provides a weighted system for identifying DCA entry and exit. This weighting mechanism adjusts the metric's interpretation to highlight conditions based on dynamic thresholds and user-defined parameters to identify high-probability zones for entry/exit actions and provide risk-adjusted insights.
Weighting Parameters
The weighting function supports fine-tuning of the computed weighted entry/exit values
Base: determines the foundational multiplier for weighting the entry/exit value. A higher base amplifies the weighting effect, making the weighted values more pronounced. It acts as a scaling factor to control the overall magnitude of the weighting.
Exponent: adjusts the curve of the weighting function. Higher exponent values increase sensitivity, emphasizing differences between risk metric values near the entry or exit thresholds. This creates a steeper gradient for the computed entry/exit value making it more responsive to subtle shifts in risk levels.
Cut Off: specifies the maximum percentage (expressed as a fraction of 1.0) that the weighted entry/exit value can reach. This cap ensures the metric remains within a meaningful range and avoids skewing
Exit condition: Defines a threshold for exit. When the risk metric is below the exit threshold (but above the entry threshold) then entry/exit is neutral.
Entry condition: Defines a threshold for entry. When the risk metric is above the entry threshold (but below the exit threshold) then entry/exit is neutral.
Weighting Behaviour
For entry conditions - value is more heavily weighted as the metric approaches the entry threshold, emphasizing lower risk levels.
For exit conditions - value is more heavily weighted as the metric nears the exit threshold, emphasizing increased risk levels.
USE-CASES
Identifying potential overbought or oversold conditions within the specified logarithmic range.
Assisting in assessing how the current price compares to historical price levels on a logarithmic scale.
Guiding decision-making processes by providing insights into the relative positioning of prices within a log context
CONSIDERATIONS
Validation: It's recommended that backtesting over historical data be done before acting on any identified entry/exit values.
User Discretion: This indicator focus on price risk. Consider other risk factors and general market conditions as well.
Adaptive Weight Price Oscillator -Aynet# Adaptive Weight Price Oscillator (AWPO) - Aynet
## Core Components
### 1. Input Parameters
- `fastLength`: Period for the fast EMA calculation (default: 10)
- `slowLength`: Period for the slow EMA calculation (default: 21)
- `adaptiveLength`: Period for calculating volatility-based adaptation (default: 34)
- `smoothing`: Smoothing factor for the adaptive weight (default: 2)
### 2. Price and Weight Calculations
#### Median Price
The indicator uses median price as its base calculation:
```pine
medianPrice = (high + low) / 2
```
#### Volatility-Based Weight
The `getVolatilityRatio` function calculates a volatility ratio:
```pine
getVolatilityRatio(length) =>
std = ta.stdev(medianPrice, length)
ratio = std != 0 ? ta.ema(math.abs(ta.change(medianPrice)), length) / std : 0
math.max(math.min(ratio, 1), 0)
```
This function:
1. Calculates standard deviation of median price
2. Computes the ratio of EMA of price changes to standard deviation
3. Constrains the result between 0 and 1
### 3. AWPO Calculation
The main AWPO value is calculated as:
```pine
awpo = (fastMA - slowMA) * adaptiveWeight
```
Where:
- `fastMA`: EMA of median price using fast length
- `slowMA`: EMA of median price using slow length
- `adaptiveWeight`: Smoothed volatility ratio
## Signal Generation
### 1. Signal Line
- Calculated as an EMA of the AWPO with default length of 9
- Used for generating trading signals
### 2. Trading Signals
The indicator generates several types of signals:
#### Crossover Signals
- Buy signal: When AWPO crosses above the signal line
- Sell signal: When AWPO crosses below the signal line
#### Divergence Signals
- Bearish Divergence: Price makes higher high while AWPO makes lower high
- Bullish Divergence: Price makes lower low while AWPO makes higher low
## Visual Components
### 1. Main Plots
- AWPO line (green/red based on direction)
- Signal line (yellow)
- Zero line (gray, dotted)
- Overbought/Oversold levels (dotted lines)
### 2. Color Fills
- AWPO to Signal line fill (green/red)
- AWPO to Zero line fill (green/red)
- Overbought/Oversold zone fills
### 3. Trade Signals
- Triangle up/down shapes for buy/sell signals
- Diamond shapes for divergence signals
## Anti-Repainting Measures
The code includes measures to prevent repainting:
```pine
var float safe_awpo = na
if barstate.isconfirmed
safe_awpo := awpo
```
This ensures signals only appear on confirmed bars.
## Alert Conditions
The indicator includes two alert conditions:
1. AWPO crossing above signal line (buy)
2. AWPO crossing below signal line (sell)
Candlestick and Line Chart Patterns AnalyseDas Skript generiert Kaufen und Verkaufen Signale anhand der Analyse auf die gängistetn Kerzenmuster und der gängisten Chartlinienmuster
Jaakko's Keltner StrategyA version of the Keltner Channel's strategy. Only taking long entries because they perform better. No shorts adviced. Performs very well on cryptos and stocks, where is more volatility included. Beats buy and hold strategy in 70% of US stocks in 30 minutes interval.
Edit: Now allow both long and short strategies to be selected. Set Margins to zero from settings to make it work for shorting.
8 en 1 SM, DMI, Koncorde, RSI, MACD, CMF, Estocástico y Aroon.Con este indicador podrás ver 8 osciladores diferentes al mismo tiempo y activar o desactivar el que quieras, también personalizarlos. Los osciladores que trae son los siguientes: Squeeze Momentum, DMI, Koncorde, RSI, MACD, CMF, Estocástico y Aroon.
Double Bottom AlertAlerts you the second a double bottom condition is met, no need to wait for a closed candle
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.
Volume Weighted Average Price_kumaran//@version=6
indicator(title="Volume Weighted Average Price", shorttitle="VWAP", overlay=true, timeframe="", timeframe_gaps=true)
hideonDWM = input(false, title="Hide VWAP on 1D or Above", group="VWAP Settings", display = display.data_window)
var anchor = input.string(defval = "Session", title="Anchor Period",
options= , group="VWAP Settings")
src = input(title = "Source", defval = hlc3, group="VWAP Settings", display = display.data_window)
offset = input.int(0, title="Offset", group="VWAP Settings", minval=0, display = display.data_window)
BANDS_GROUP = "Bands Settings"
CALC_MODE_TOOLTIP = "Determines the units used to calculate the distance of the bands. When 'Percentage' is selected, a multiplier of 1 means 1%."
calcModeInput = input.string("Standard Deviation", "Bands Calculation Mode", options = , group = BANDS_GROUP, tooltip = CALC_MODE_TOOLTIP, display = display.data_window)
showBand_1 = input(true, title = "", group = BANDS_GROUP, inline = "band_1", display = display.data_window)
bandMult_1 = input.float(1.0, title = "Bands Multiplier #1", group = BANDS_GROUP, inline = "band_1", step = 0.5, minval=0, display = display.data_window)
showBand_2 = input(false, title = "", group = BANDS_GROUP, inline = "band_2", display = display.data_window)
bandMult_2 = input.float(2.0, title = "Bands Multiplier #2", group = BANDS_GROUP, inline = "band_2", step = 0.5, minval=0, display = display.data_window)
showBand_3 = input(false, title = "", group = BANDS_GROUP, inline = "band_3", display = display.data_window)
bandMult_3 = input.float(3.0, title = "Bands Multiplier #3", group = BANDS_GROUP, inline = "band_3", step = 0.5, minval=0, display = display.data_window)
cumVolume = ta.cum(volume)
if barstate.islast and cumVolume == 0
runtime.error("No volume is provided by the data vendor.")
new_earnings = request.earnings(syminfo.tickerid, earnings.actual, barmerge.gaps_on, barmerge.lookahead_on, ignore_invalid_symbol=true)
new_dividends = request.dividends(syminfo.tickerid, dividends.gross, barmerge.gaps_on, barmerge.lookahead_on, ignore_invalid_symbol=true)
new_split = request.splits(syminfo.tickerid, splits.denominator, barmerge.gaps_on, barmerge.lookahead_on, ignore_invalid_symbol=true)
isNewPeriod = switch anchor
"Earnings" => not na(new_earnings)
"Dividends" => not na(new_dividends)
"Splits" => not na(new_split)
"Session" => timeframe.change("D")
"Week" => timeframe.change("W")
"Month" => timeframe.change("M")
"Quarter" => timeframe.change("3M")
"Year" => timeframe.change("12M")
"Decade" => timeframe.change("12M") and year % 10 == 0
"Century" => timeframe.change("12M") and year % 100 == 0
=> false
isEsdAnchor = anchor == "Earnings" or anchor == "Dividends" or anchor == "Splits"
if na(src ) and not isEsdAnchor
isNewPeriod := true
float vwapValue = na
float upperBandValue1 = na
float lowerBandValue1 = na
float upperBandValue2 = na
float lowerBandValue2 = na
float upperBandValue3 = na
float lowerBandValue3 = na
if not (hideonDWM and timeframe.isdwm)
= ta.vwap(src, isNewPeriod, 1)
vwapValue := _vwap
stdevAbs = _stdevUpper - _vwap
bandBasis = calcModeInput == "Standard Deviation" ? stdevAbs : _vwap * 0.01
upperBandValue1 := _vwap + bandBasis * bandMult_1
lowerBandValue1 := _vwap - bandBasis * bandMult_1
upperBandValue2 := _vwap + bandBasis * bandMult_2
lowerBandValue2 := _vwap - bandBasis * bandMult_2
upperBandValue3 := _vwap + bandBasis * bandMult_3
lowerBandValue3 := _vwap - bandBasis * bandMult_3
plot(vwapValue, title="VWAP", color=#2962FF, offset=offset)
upperBand_1 = plot(upperBandValue1, title="Upper Band #1", color=color.green, offset=offset, display = showBand_1 ? display.all : display.none)
lowerBand_1 = plot(lowerBandValue1, title="Lower Band #1", color=color.green, offset=offset, display = showBand_1 ? display.all : display.none)
fill(upperBand_1, lowerBand_1, title="Bands Fill #1", color= color.new(color.green, 95) , display = showBand_1 ? display.all : display.none)
upperBand_2 = plot(upperBandValue2, title="Upper Band #2", color=color.olive, offset=offset, display = showBand_2 ? display.all : display.none)
lowerBand_2 = plot(lowerBandValue2, title="Lower Band #2", color=color.olive, offset=offset, display = showBand_2 ? display.all : display.none)
fill(upperBand_2, lowerBand_2, title="Bands Fill #2", color= color.new(color.olive, 95) , display = showBand_2 ? display.all : display.none)
upperBand_3 = plot(upperBandValue3, title="Upper Band #3", color=color.teal, offset=offset, display = showBand_3 ? display.all : display.none)
lowerBand_3 = plot(lowerBandValue3, title="Lower Band #3", color=color.teal, offset=offset, display = showBand_3 ? display.all : display.none)
fill(upperBand_3, lowerBand_3, title="Bands Fill #3", color= color.new(color.teal, 95) , display = showBand_3 ? display.all : display.none)
EMA 68 with Trailing Stop-Loss 9430018561EMA 68 with Trailing Stop-Loss 9430018561
EMA Crossover ke upar buy and sell
Isme stop loss bhi hain aur traling stop loss bhi
EMA Crossover PredictionThis scripts predicts if a crossover of a short EMA (e.g. 20) over a long EMA (e.g. 200) is going to happen within the next foreseen periods (e.g. 50) and provides the predicted value in terms of number of periods and price when the crossover would happen.
Simplified Buy/Sell StrategyThis Pine Script implements a Simplified Buy/Sell Strategy based on the Moving Average Crossover technique. Here's a breakdown of the functionality:
Description:
Purpose:
The script generates Buy and Sell signals on the chart to help traders identify potential entry and exit points based on short-term and long-term price trends.
Indicators Used:
Short Moving Average (Short MA): Calculates the average closing price over a shorter period (default: 5).
Long Moving Average (Long MA): Calculates the average closing price over a longer period (default: 10).
Buy Signal:
A buy signal is generated when the Short MA crosses above the Long MA. This suggests a potential upward trend in price.
Sell Signal:
A sell signal is generated when the Short MA crosses below the Long MA. This indicates a possible downward trend.
Visualization:
Buy signals are shown as green arrows below the price bars with the label "BUY."
Sell signals are displayed as red arrows above the price bars with the label "SELL."
The Short and Long MAs are plotted on the chart for visual confirmation of trends (blue for Short MA, orange for Long MA).
Customization:
Traders can adjust the lengths of the moving averages to fit different timeframes or assets using the input fields.
GOLDMASK Indicator (SO + Days Break)//@version=6
indicator("GOLDMASK Indicator (SO + Days Break)", overlay=true)
// Vstupy pro přizpůsobení stylu čar
lineStyleInput = input.string(title="Styl čáry", defval="Dashed", options= )
lineWidthInput = input.int(title="Šířka čáry", defval=1, minval=1)
sundayLineColor = input.color(title="Nedělní vertikální otevírací čára", defval=color.new(#00BFFF, 50)) // Světle modrá barva pro neděli
dayBreakColor = input.color(title="Čára přerušení dne", defval=color.new(#ADD8E6, 50)) // Světle modrá barva pro přerušení dne
weekStartColor = input.color(title="Čára začátku týdne", defval=color.new(#FF8C00, 50)) // Tmavě oranžová barva pro nový týden
// Definice funkce getLineStyle
getLineStyle(style) =>
switch style
"Dotted" => line.style_dotted
"Dashed" => line.style_dashed
"Solid" => line.style_solid
// Proměnná pro uložení ceny otevření v neděli
var float sundayOpenPrice = na
// Určení a vykreslení ceny otevření v neděli
if (dayofweek == dayofweek.sunday and hour == 17 and minute == 0)
sundayOpenPrice := open
// Vykreslení ceny otevření v neděli s 50% průhledností
plot(sundayOpenPrice, title="Sunday Open", style=plot.style_linebr, linewidth=lineWidthInput, color=sundayLineColor, trackprice=true)
// Funkce pro vykreslení vertikálních čar pro přerušení dne
drawVerticalLineForDay(dayOffset, isSunday) =>
int dayTimestamp = na(time) ? na : time - dayOffset * 86400000 + (17 - 5) * 3600000
if not na(dayTimestamp) and hour(time ) < 17 and hour >= 17
lineColor = isSunday ? weekStartColor : dayBreakColor
line.new(x1=bar_index, y1=low, x2=bar_index, y2=high, width=lineWidthInput, color=lineColor, style=line.style_dotted, extend=extend.both)
// Vykreslení čar pro poslední čtyři dny a použití jiné barvy pro neděli
for dayOffset = 0 to 3 by 1
isSunday = dayOffset == 0 and dayofweek == dayofweek.sunday
drawVerticalLineForDay(dayOffset, isSunday)
Custom EMA (5)The Custom EMA (5) indicator is a versatile tool for traders that provides five fully adjustable Exponential Moving Averages (EMAs) to suit various trading strategies and timeframes. With customizable lengths and enable/disable toggles for each EMA, this script empowers traders to focus on the EMAs that matter most to their strategy.
Features:
Five Adjustable EMAs:
EMA 1 (Default: 20, Red)
EMA 2 (Default: 50, Orange)
EMA 3 (Default: 100, Aqua)
EMA 4 (Default: 200, Blue)
EMA 5 (Default: 9, Green)
Customize each EMA length based on your trading style or specific market conditions.
Enable/Disable Each EMA:
Toggle any of the five EMAs on or off directly from the settings panel, allowing you to declutter your chart or focus on specific trends.
Dynamic Trend Analysis:
Use shorter EMAs (e.g., EMA 5 and EMA 20) to capture immediate price action and crossovers.
Leverage longer EMAs (e.g., EMA 100 and EMA 200) for identifying medium- to long-term market trends.
Clean Visualization:
Each EMA is color-coded for easy trend identification:
EMA 1: Red
EMA 2: Orange
EMA 3: Aqua
EMA 4: Blue
EMA 5: Green
How to Use:
Scalping:
Use shorter EMAs like EMA 5 and EMA 20 for quick momentum signals.
Day Trading/Swing Trading:
Combine EMA 20, EMA 50, and EMA 100 to follow medium-term trends and retracements.
Position Trading:
Use EMA 200 to identify long-term trend direction and key support/resistance levels.
Ideal For:
Traders of all levels—scalpers, day traders, swing traders, and position traders.
Anyone looking for a flexible and customizable EMA indicator to fit their trading needs.
Pro Tip: Combine the Custom EMA (5) with other indicators like RSI, MACD, or volume analysis to refine your entries and exits.
Roc & Atr & MAROC - ATR and comparison of 3 moving averages.
Buy signal if 3 Moving Averages cross ATR band.
Downward Sell signal.
And comparison to each other.
Volatility - ATR and Averages.
Ultimate Precision Buy/Sell Signals - Advanced Edition V1.01Ultimate Precision Buy/Sell Signals - Advanced Edition V1.01
Overview
This powerful TradingView indicator is designed for maximum precision in trading by utilizing a combination of EMA, RSI, ATR, ADX, Fibonacci extensions, and divergence detection to identify optimal buy and sell opportunities. The script is designed to help traders maximize profits while minimizing risk with advanced risk calculations and stop-loss mechanisms.
How to Use the Indicator
1. Buy and Sell Signals
BUY Signal (Green Label Below Candles):
RSI crosses above 30 (indicating an oversold recovery).
Price is below the EMA (indicating undervaluation).
ADX confirms a strong trend (if enabled).
📌 Action: Open a long position and set a stop-loss based on the risk level.
SELL Signal (Red Label Above Candles):
RSI crosses below 70 (indicating an overbought condition).
Price is above the EMA (indicating overextension).
ADX confirms a strong trend (if enabled).
📌 Action: Open a short position and set a stop-loss based on the risk level.
2. Risk and Profit Calculations
Risk Level is determined using ATR × Risk Multiplier.
Potential Profit is calculated as Risk Level × Risk-Reward Ratio.
These values are displayed in a floating label to help manage your trades efficiently.
📌 Tip: A higher Risk Multiplier means wider stop-losses, useful for volatile markets.
3. Trend Confirmation (ADX Filter)
If trend filtering is enabled, buy/sell signals will only appear in strong trends.
ADX must be above 25 to confirm that the market is trending.
📌 Tip: Use this to avoid false signals in ranging markets.
4. Divergence Detection
Bullish Divergence (Blue Circle Below Candles): Indicates a potential reversal upwards.
Bearish Divergence (Orange Circle Above Candles): Indicates a potential downward reversal.
📌 Tip: Divergences provide early warnings before market reversals.
5. Heatmap Visualization
Green Background: Indicates a high-confidence buy zone.
Red Background: Indicates a high-confidence sell zone.
📌 Tip: Use heatmaps to spot high-conviction trades.
6. Fibonacci-Based Take Profit (Optional)
If enabled, the script will use Fibonacci extensions instead of fixed risk-reward levels.
📌 Tip: Fibonacci-based TP works well in trending markets.
7. Alerts (No Need to Stare at the Charts!)
Set alerts for BUY and SELL signals.
TradingView will notify you when a perfect trade setup appears.
📌 Tip: Enable alerts in TradingView settings.
Socials & Live Stream Promotion 🚀
If you love this indicator and want to see it in action, check out my live trading sessions and content here:
🎥 YouTube: www.YouTube.com
🎮 Kick: www.Kick.com
🎥 Twitch: twitch.tv
👀 Follow me for more trading insights, strategies, and live action!
Funny Trading Joke to Brighten Your Day 😆
💬 Trader: "I lost my whole account today!"💬 Friend: "What happened?!"💬 Trader: "Well... I kept seeing those green candles and thought they were money-growing trees. Turns out they were just market traps!"😂😂😂
🚀 Smash that FOLLOW button if this indicator helps your trading! Let’s dominate the markets together! 📈🔥
Squeeze Momentum + ADX Trading Latino By GastonGilSanchezGente este es una union entre dos indicadores para poder seguir la estrategia de trading latino con una version gratuita
Kalango Trader 7.0
// Sinais visuais no gráfico
plotshape(series=long_signal, location=location.belowbar, color=color.green, style=shape.labelup, title="Long Signal", text="LONG")
plotshape(series=short_signal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Short Signal", text="SHORT")
plotshape(series=lt
Buy Sell Indicator by KCMLong when Price is above Blue Line and White Lines has a Bullish crossover, Short when Price is below Blue Line and White Lines has a Bearish crossover.