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.
Exitstrategy
ATR Range Pivot LinesDescription:
This Pine Script calculates and plots pivot lines based on ATR (Average True Range) value and closing price. It uses the previous trading day's ATR value to set static pivot levels for the current trading day. These pivot lines help traders identify potential support and resistance levels based on historical volatility. The script includes two main pivot lines—ATR High and ATR Low —and two midpoint lines between them for additional context. Labels are added to show the exact pivot values, with options to customize label positions.
Intended Use:
The script is designed to help traders forecast potential price ranges for the current trading day based on the previous day’s volatility. By adding and subtracting the previous day's ATR from the prior close, the script identifies key levels where price action may encounter support or resistance. It is useful for setting realistic price targets or entry/exit points. Since the ATR-based pivot lines are static for the entire day, they provide a reliable range for intraday trading strategies.
Disclosure:
This script was generated using AI. It is recommended to review and test the script thoroughly before applying it in live trading scenarios.
RSI of Zero Lag MA (ValueRay)The RSI of a Zero Lag Moving Average a powerful tool for for reliable exit signals.
The Relative Strength Index (RSI) is a widely recognized momentum oscillator that measures the speed and change of price movements. It provides valuable insights into overbought and oversold conditions, enabling traders to identify potential reversal points and take advantage of market inefficiencies.
The RSI of a Zero Lag Indicator takes this concept a step further by incorporating the Zero Lag Moving Average. The Zero Lag Moving Average is a cutting-edge indicator that minimizes lag and provides a smoother representation of price action, allowing for quicker and more precise responses to market movements.
By combining the RSI with the Zero Lag Moving Average, this indicator offers traders a superior exit strategy. When the RSI reaches extreme levels of overbought or oversold conditions, it indicates a potential reversal in the market. The Zero Lag Moving Average further enhances this signal by reducing delays and providing timely exit points.
Moreover, the RSI of a Zero Lag Indicator is not limited to mean reversion strategies. While it excels in identifying mean reversion opportunities, it can also be used in conjunction with other trading approaches. Traders can take advantage of its objective signals to exit trades profitably, regardless of their chosen strategy.
With its ability to accurately pinpoint overbought and oversold conditions, the RSI of a Zero Lag Indicator offers traders a competitive edge in the market. By providing timely exit signals and minimizing lag, it helps traders optimize their trading decisions and increase their chances of success.
Consolidated IndicatorI have attempted to combine all the parameters to decide on the entry and exit points for stocks. The indicator combines
1) EMAs
2)PSAR
3)ATR
The script also attempts to show the risk-reward
CarlLibLibrary "CarlLib"
LastLowRedHighGreen(open, close, high, close, reqChangePerc) returns values representing the high of the most recent green and the low of the most recent red
Parameters:
open : open series
close : close series
high : high series
close : close series
reqChangePerc : the minimum require change percentage for the values to switch to new ones.
Returns:
DCA RSI Add funds exit simulatorThis script helps with planning on how to exit DCA deals that are in the negative.
The following deal information is required
- Current average position price
- Funds invested
- Required take profit
Additional indicator settings are
- The date/time on which to start the simulator
- Minimum deviation % to start adding funds
- Expected bounceback from when funds are added
The RSI trigger
Adding funds is triggered when the selected RSI settings yield a value that is at or beyond the selected threshold.
How it works
The amount of funds needed are calculated based on the supplied settings, such that the new average price matches the expected bounceback.
It will also show if the exit strategy has failed to hit the TP (this happens when the RSI threshold is hit again)