Qty CalculatorThis Pine Script indicator, titled "Qty Calculator," is a customizable tool designed to assist traders in managing their trades by calculating key metrics related to risk management. It takes into account your total capital, entry price, stop-loss level, and desired risk percentage to provide a comprehensive overview of potential trade outcomes.
Key Features:
User Inputs:
Total Capital: The total amount of money available for trading.
Entry Price: The price at which the trader enters the trade.
Stop Loss: The price level at which the trade will automatically close to prevent further losses.
Risk Percentage: The percentage of the total capital that the trader is willing to risk on a single trade.
Customizable Table:
Position: The indicator allows you to choose the position of the table on the chart, with options including top-left, top-center, top-right, bottom-left, bottom-center, and bottom-right.
Size: You can adjust the number of rows and columns in the table to fit your needs.
Risk Management Calculations:
Difference Calculation: The difference between the entry price and the stop-loss level.
Risk Per Trade: Calculated as a percentage of your total capital.
Risk Levels: The indicator evaluates multiple risk levels (0.10%, 0.25%, 0.50%, 1.00%) and calculates the quantity, capital per trade, percentage of total capital, and the risk amount associated with each level.
R-Multiples Calculation:
The indicator calculates potential profit levels at 2x, 3x, 4x, and 5x the risk (R-Multiples), showing the potential gains if the trade moves in your favor by these multiples.
Table Display:
The table includes the following columns:
CapRisk%: Displays the risk percentage.
Qty: The quantity of the asset you should trade.
Cap/Trade: The capital allocated per trade.
%OfCapital: The percentage of total capital used in the trade.
Risk Amount: The monetary risk taken on each trade.
R Gains: Displays potential gains at different R-Multiples.
This indicator is particularly useful for traders who prioritize risk management and want to ensure that their trades are aligned with their capital and risk tolerance. By providing a clear and customizable table of critical metrics, it helps traders make informed decisions and better manage their trading strategies.
Statistics
Thrax - QuickStrike 5-Mins Scalping** Indicator Description **
1. Price Change Threshold (%) – The minimum price change required for a candle to be recognized as significant. Candles exceeding this threshold are considered potential candidates for zone creation. Default value for 5 min is 0.5%. As you move on higher timeframe the threshold should increase
2. Percentage Change for Zones (%) – The amount of price movement needed to form a dynamic support or resistance zone. Tweak this to control how sensitive the indicator is to price fluctuations. 5 min default value is 1%. For 15 min suggested is 2-3%.
3. Break Threshold for Zones (%) – Defines how much price must break above or below a zone for it to be removed from the chart/mitigated. Keeps the chart clean by removing invalidated zones. Default value is 0.1% in 5 min, for 15 min it is 0.5%.
4. Buy Zone Retracement Level (%) – The percentage retracement level for defining the inner buy zone within a broader bullish zone. Ideal for timing precision entries. Ideal value is 75%
5. Sell Zone Retracement Level (%) – The percentage retracement level used to determine the inner sell zone within a larger bearish zone. Helps in identifying potential reversal areas or exits. Ideal value is 25%
By tailoring these inputs, traders can fully customize the indicator to suit their scalping strategies, enhancing their ability to navigate fast-moving markets with confidence.
---------------------------------------------------------------------------
There are two primary approaches for scalping using this indicator:
1. Candle-Based Scalping:
a. Bullish Signal: When you observe a bullish candle highlighted in blue (by default), you can consider entering a long position at the close of this candle. It’s advisable to wait for the candle to close before taking action. For a more aggressive scalp, you might take profits based on your scalp target after a few subsequent candles. If the price remains stagnant or moves unfavorably in the next few candles, you can exit with a small loss. Alternatively, if you have a higher risk tolerance, you may hold the position even if the price initially declines within a set percentage.
b. Bearish Signal: For a bearish candle highlighted in yellow, you can enter a short trade at the close of the candle. Similar to the bullish setup, you have the option to exit after a few candles if the price doesn’t move as expected or hold the position with a higher risk tolerance if the price goes up initially.
2. Zone-Based Scalping:
Entering Zones: Monitor the price as it enters a defined support or resistance zone. If you are open to higher risk, you can enter a trade immediately upon the price entering the zone. For a more cautious approach with a smaller stop loss, wait for the price to reach a retracement level within the zone before initiating your trade. This approach allows for a more precise entry but may result in missing out on trades if the price reverses before hitting the retracement level. Conversely, entering at the zone’s boundary offers the potential for early trade capture but comes with a higher stop loss risk.
Adjust these strategies based on your risk tolerance and trading preferences to optimize your scalping opportunities.
AutocorrelationWhat is Autocorrelation?
Autocorrelation is a mathematical concept used to measure the degree of similarity between a given time series and a lagged version of itself over successive time intervals. Mathematically, it is the correlation of a signal with a delayed copy of itself as a function of delay. In simpler terms, autocorrelation helps us understand whether and how past values in a time series are related to future values.
Autocorrelation in Finance:
In finance, the autocorrelation is a tool used to analyze the behavior of time series data, such as asset prices or returns. It can reveal "patterns", trends, or cycles within the data.
Price Autocorrelation: When applied to prices, autocorrelations can indicate whether an asset price tends to follow a trend. On price you will typically observe positive autocorrelation because price often exhibits a momentum effect where today's price is positively correlated with past prices. As a result, when prices are trending, they tend to continue in the same direction, creating a positive autocorrelation.
Returns Autocorrelation: Returns on the other hand, generally show less autocorrelation than prices. This is because returns represent the change in prices over time, and in efficient markets, returns are often modeled as a random walk, leading to low or no significant autocorrelation. However, under certain market conditions, you may observe positive or negative autocorrelation in returns. Positive Autocorrelation of returns indicates a trend effect, where past returns can predict future returns. Negative Returns Autocorrelation suggest mean reversion, where large positive returns are often followed by negative returns and vice versa.
Critical Value Analysis:
This indicator comes with critical values based on user-selected confidence levels (90%,95%,99%). It assesses whether the autocorrelation at a particular lag is statistically significant, which is crucial for distinguishing between random noise and meaningful events.
Trading Based on Autocorrelation:
While this indicator was not really developed to be directly used for trading, this indicator is was instead to raise awareness on why you should avoid strategies involving mean reversion on price.
Relationship Exchange Rate and Inflation in UruguayThis Pine Script indicator, titled "Relationship Between Exchange Rate and Monthly Inflation in Uruguay," is designed to analyze the interaction between the exchange rate of the Uruguayan Peso (UYU) against the US Dollar (USD) and the monthly inflation rate in Uruguay.
Data Retrieval:
The script fetches the monthly exchange rate data for UYU/USD.
It also retrieves the Consumer Price Index (CPI) data for Uruguay.
Monthly Inflation Calculation:
The script calculates the monthly inflation rate using the CPI data by determining the percentage change from the previous month.
Formula Calculation:
A specific formula is calculated by dividing the inverse of the exchange rate by the monthly inflation rate.
Conditional Coloring:
The resulting value is plotted on the chart with a conditional color: green if the exchange rate is greater than the inflation rate, otherwise red.
This indicator provides a visual representation of how the exchange rate compares to the inflation rate, helping traders and analysts understand the economic dynamics between currency value and inflation in Uruguay.
Trade ScoreboardManually track your trade record and display your results in a handy table. Good for backtesting and for making a manual ritual out of tracking your trades. This way you are less likely to overtrade during your session. This can also nice as an addendum to your charts, to show off your results and record them for later review.
S&P 2024: Magnificent 7 vs. the rest of S&PThis chart is designed to calculate and display the percentage change of the Magnificent 7 (M7) stocks and the S&P 500 excluding the M7 (Ex-M7) from the beginning of 2024 to the most recent data point. The Magnificent 7 consists of seven major technology stocks: Apple (AAPL), Microsoft (MSFT), Amazon (AMZN), Alphabet (GOOGL), Meta (META), Nvidia (NVDA), and Tesla (TSLA). These stocks are a significant part of the S&P 500 and can have a substantial impact on its overall performance.
Key Components and Functionality:
1. Start of 2024 Baseline:
- The script identifies the closing prices of the S&P 500 and each of the Magnificent 7 stocks on the first trading day of 2024. These values serve as the baseline for calculating percentage changes.
2. Current Value Calculation:
- It then fetches the most recent closing prices of these stocks and the S&P 500 index to calculate their current values.
3. Percentage Change Calculation:
- The script calculates the percentage change for the M7 by comparing the sum of the current prices of the M7 stocks to their combined value at the start of 2024.
- Similarly, it calculates the percentage change for the Ex-M7 by comparing the current value of the S&P 500 excluding the M7 to its value at the start of 2024.
4. Plotting:
- The calculated percentage changes are plotted on the chart, with the M7’s percentage change shown in red and the Ex-M7’s percentage change shown in blue.
Use Case:
This indicator is particularly useful for investors and analysts who want to understand how much the performance of the S&P 500 in 2024 is driven by the Magnificent 7 stocks compared to the rest of the index. By showing the percentage change from the start of the year, it provides clear insights into the relative growth or decline of these two segments of the market over the course of the year.
Visualization:
- Red Line (M7 % Change): Displays the percentage change of the combined value of the Magnificent 7 stocks since the start of 2024.
- Blue Line (Ex-M7 % Change): Displays the percentage change of the S&P 500 excluding the Magnificent 7 since the start of 2024.
This script enables a straightforward comparison of the performance of the M7 and Ex-M7, highlighting which segment is contributing more to the overall movement of the S&P 500 in 2024.
3-Criteria StrategyThe "3-Criteria Strategy" is a simple yet effective trading strategy based on three criteria:
200-Day Moving Average: The first criterion checks whether the current price is above or below the 200-day moving average (SMA). A price above the 200-day line is considered bullish (thumbs up), while a price below is considered bearish (thumbs down).
5-Day Indicator: The second criterion evaluates the performance of the first five trading days of the year. If the closing price on the fifth trading day is higher than the closing price on the last trading day of the previous year, this is considered bullish (thumbs up). Otherwise, it's bearish (thumbs down).
Year-to-Date (YTD) Effect: The third criterion compares the current price with the closing price at the end of the previous year. A current price above the year-end price is bullish (thumbs up), while a price below is bearish (thumbs down).
Signal Interpretation:
Buy Signal: At least two of the three criteria must give a bullish signal (thumbs up).
Sell Signal: Zero or one bullish signal results in a bearish outlook.
The script provides visual cues with background colors:
Green background: Indicates a buy signal.
Red background: Indicates a sell signal.
Additionally, the script plots the 200-day moving average and the YTD line on the chart for better visualization.
Usage:
Apply the Script: Add the script to your TradingView chart.
Interpret Signals: Monitor the background color and the status label to determine trading actions.
Visual Aids: Use the 200-day line and YTD line plotted on the chart to confirm the criteria visually.
Scientific Research
The concepts used in this script—like the 200-day moving average and Year-to-Date effects—are well-documented in financial literature. However, the combination of these specific criteria as a trading strategy is more of a heuristic approach commonly used by traders rather than a subject of extensive academic research.
200-Day Moving Average: The 200-day moving average is widely regarded as a significant level in technical analysis, often serving as a demarcation between long-term bullish and bearish trends. Research has shown that long-term moving averages can be useful for trend-following strategies.
Reference: Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. Journal of Finance, 47(5), 1731-1764.
Year-to-Date and Calendar Effects: The Year-to-Date effect and early-year performance (such as the January effect) have been studied extensively in the context of seasonal market anomalies.
Reference: Rozeff, M. S., & Kinney, W. R. (1976). Capital Market Seasonality: The Case of Stock Returns. Journal of Financial Economics, 3(4), 379-402.
While these papers don't address the exact combination of criteria used in your strategy, they provide a solid foundation for understanding the underlying concepts.
RSI Strategy with Adjustable RSI and Stop-LossThis trading strategy uses the Relative Strength Index (RSI) and a Stop-Loss mechanism to make trading decisions. Here’s a breakdown of how it works:
RSI Calculation:
The RSI is calculated based on the user-defined length (rsi_length). This is a momentum oscillator that measures the speed and change of price movements.
Buy Condition:
The strategy generates a buy signal when the RSI value is below a user-defined threshold (rsi_threshold). This condition indicates that the asset might be oversold and potentially due for a rebound.
Stop-Loss Mechanism:
Upon triggering a buy signal, the strategy calculates the Stop-Loss level. The Stop-Loss level is set to a percentage below the entry price, as specified by the user (stop_loss_percent). This level is used to limit potential losses if the price moves against the trade.
Sell Condition:
A sell signal is generated when the current closing price is higher than the highest high of the previous day. This condition suggests that the price has reached a new high, and the strategy decides to exit the trade.
Plotting:
The RSI values are plotted on the chart for visual reference. A horizontal line is drawn at the RSI threshold level to help visualize the oversold condition.
Summary
Buying Strategy: When RSI is below the specified threshold, indicating potential oversold conditions.
Stop-Loss: Set based on a percentage of the entry price to limit potential losses.
Selling Strategy: When the price surpasses the highest high of the previous day, signaling a potential exit point.
This strategy aims to capture potential rebounds from oversold conditions and manage risk using a Stop-Loss mechanism. As with any trading strategy, it’s essential to test and optimize it under various market conditions to ensure its effectiveness.
Cumulative Gain/Loss Histogram This TradingView Pine Script indicator combines several analytical tools to assist traders in making informed investment decisions. It calculates and visualizes cumulative gain/loss percentage, standard deviation levels, and normalizes trading volume on a reversed scale.
Components:
Basis for Calculation:
Users can select the basis data for the calculations: Price, VIX (Volatility Index), VVIX (Volatility of Volatility Index), or MOVE (Volatility Index for Treasury Securities).
Cumulative Gain/Loss:
This is computed based on the selected basis. The script tracks the cumulative percentage change in the selected basis data. Positive changes are aggregated to track gains, while negative changes accumulate to track losses.
Standard Deviation Levels:
The script calculates standard deviation (StdDev) for the cumulative gain/loss data over a specified period. Two levels are determined:
Positive StdDev Level: Shows the upper threshold for gains.
Negative StdDev Level: Shows the lower threshold for losses.
These levels are useful for identifying extreme deviations in the data.
Normalized Volume:
The trading volume is normalized to fit within a -5 to 5 scale, but the scale is reversed. Higher trading volumes will be represented by lower values on this scale. This normalized volume is plotted as a gray line on the chart.
How to Use This Indicator:
Identify Trends and Extremes:
Cumulative Gain/Loss: Look for periods where the cumulative gain/loss exceeds the standard deviation levels. This can indicate significant trend changes or potential reversals. Standard Deviation Levels: Use these levels to gauge whether the market is experiencing extreme conditions. For example, if the cumulative gain/loss crosses above the positive StdDev level, it might suggest an overbought condition.
Volume Analysis:
Normalized Volume: Analyze the volume trends with the reversed scale. Higher normalized volume values (which are lower on the -5 to 5 scale) could indicate high trading activity or market interest, potentially signaling a strong move or trend. Conversely, lower normalized volume values (which are higher on the -5 to 5 scale) may suggest lower trading activity or consolidation.
Decision-Making:
Combine the insights from cumulative gain/loss and standard deviation levels with volume analysis to make more informed trading decisions.
Buy Signal: Consider entering a position when the cumulative gain/loss reaches or exceeds the negative StdDev level and volume analysis supports increased market activity.
Sell Signal: Consider exiting a position when the cumulative gain/loss exceeds the positive StdDev level, indicating possible overbought conditions, especially if volume trends also align with the potential reversal.
Summary:
This script is designed to help traders understand market dynamics through cumulative gain/loss trends, standard deviation thresholds, and volume analysis. By interpreting these elements together, traders can identify potential trading opportunities and make more informed decisions based on market conditions and trends.
Correlation Clusters [LuxAlgo]The Correlation Clusters is a machine learning tool that allows traders to group sets of tickers with a similar correlation coefficient to a user-set reference ticker.
The tool calculates the correlation coefficients between 10 user-set tickers and a user-set reference ticker, with the possibility of forming up to 10 clusters.
🔶 USAGE
Applying clustering methods to correlation analysis allows traders to quickly identify which set of tickers are correlated with a reference ticker, rather than having to look at them one by one or using a more tedious approach such as correlation matrices.
Tickers belonging to a cluster may also be more likely to have a higher mutual correlation. The image above shows the detailed parts of the Correlation Clusters tool.
The correlation coefficient between two assets allows traders to see how these assets behave in relation to each other. It can take values between +1.0 and -1.0 with the following meaning
Value near +1.0: Both assets behave in a similar way, moving up or down at the same time
Value close to 0.0: No correlation, both assets behave independently
Value near -1.0: Both assets have opposite behavior when one moves up the other moves down, and vice versa
There is a wide range of trading strategies that make use of correlation coefficients between assets, some examples are:
Pair Trading: Traders may wish to take advantage of divergences in the price movements of highly positively correlated assets; even highly positively correlated assets do not always move in the same direction; when assets with a correlation close to +1.0 diverge in their behavior, traders may see this as an opportunity to buy one and sell the other in the expectation that the assets will return to the likely same price behavior.
Sector rotation: Traders may want to favor some sectors that are expected to perform in the next cycle, tracking the correlation between different sectors and between the sector and the overall market.
Diversification: Traders can aim to have a diversified portfolio of uncorrelated assets. From a risk management perspective, it is useful to know the correlation between the assets in your portfolio, if you hold equal positions in positively correlated assets, your risk is tilted in the same direction, so if the assets move against you, your risk is doubled. You can avoid this increased risk by choosing uncorrelated assets so that they move independently.
Hedging: Traders may want to hedge positions with correlated assets, from a hedging perspective, if you are long an asset, you can hedge going long a negatively correlated asset or going short a positively correlated asset.
Grouping different assets with similar behavior can be very helpful to traders to avoid over-exposure to those assets, traders may have multiple long positions on different assets as a way of minimizing overall risk when in reality if those assets are part of the same cluster traders are maximizing their risk by taking positions on assets with the same behavior.
As a rule of thumb, a trader can minimize risk via diversification by taking positions on assets with no correlations, the proposed tool can effectively show a set of uncorrelated candidates from the reference ticker if one or more clusters centroids are located near 0.
🔶 DETAILS
K-means clustering is a popular machine-learning algorithm that finds observations in a data set that are similar to each other and places them in a group.
The process starts by randomly assigning each data point to an initial group and calculating the centroid for each. A centroid is the center of the group. K-means clustering forms the groups in such a way that the variances between the data points and the centroid of the cluster are minimized.
It's an unsupervised method because it starts without labels and then forms and labels groups itself.
🔹 Execution Window
In the image above we can see how different execution windows provide different correlation coefficients, informing traders of the different behavior of the same assets over different time periods.
Users can filter the data used to calculate correlations by number of bars, by time, or not at all, using all available data. For example, if the chart timeframe is 15m, traders may want to know how different assets behave over the last 7 days (one week), or for an hourly chart set an execution window of one month, or one year for a daily chart. The default setting is to use data from the last 50 bars.
🔹 Clusters
On this graph, we can see different clusters for the same data. The clusters are identified by different colors and the dotted lines show the centroids of each cluster.
Traders can select up to 10 clusters, however, do note that selecting 10 clusters can lead to only 4 or 5 returned clusters, this is caused by the machine learning algorithm not detecting any more data points deviating from already detected clusters.
Traders can fine-tune the algorithm by changing the 'Cluster Threshold' and 'Max Iterations' settings, but if you are not familiar with them we advise you not to change these settings, the defaults can work fine for the application of this tool.
🔹 Correlations
Different correlations mean different behaviors respecting the same asset, as we can see in the chart above.
All correlations are found against the same asset, traders can use the chart ticker or manually set one of their choices from the settings panel. Then they can select the 10 tickers to be used to find the correlation coefficients, which can be useful to analyze how different types of assets behave against the same asset.
🔶 SETTINGS
Execution Window Mode: Choose how the tool collects data, filter data by number of bars, time, or no filtering at all, using all available data.
Execute on Last X Bars: Number of bars for data collection when the 'Bars' execution window mode is active.
Execute on Last: Time window for data collection when the `Time` execution window mode is active. These are full periods, so `Day` means the last 24 hours, `Week` means the last 7 days, and so on.
🔹 Clusters
Number of Clusters: Number of clusters to detect up to 10. Only clusters with data points are displayed.
Cluster Threshold: Number used to compare a new centroid within the same cluster. The lower the number, the more accurate the centroid will be.
Max Iterations: Maximum number of calculations to detect a cluster. A high value may lead to a timeout runtime error (loop takes too long).
🔹 Ticker of Reference
Use Chart Ticker as Reference: Enable/disable the use of the current chart ticker to get the correlation against all other tickers selected by the user.
Custom Ticker: Custom ticker to get the correlation against all the other tickers selected by the user.
🔹 Correlation Tickers
Select the 10 tickers for which you wish to obtain the correlation against the reference ticker.
🔹 Style
Text Size: Select the size of the text to be displayed.
Display Size: Select the size of the correlation chart to be displayed, up to 500 bars.
Box Height: Select the height of the boxes to be displayed. A high height will cause overlapping if the boxes are close together.
Clusters Colors: Choose a custom colour for each cluster.
Navid-Time SeperatorTitle: Pine Script Guide: Creating 15 Customizable Vertical Lines with Labels
In this guide, we'll walk through how to create a TradingView script using Pine Script that draws 15 customizable vertical lines on your chart. Each line can be configured with specific time, color, width, style, and label options, making it a powerful tool for highlighting important moments during a trading session.
Key Features:
15 Customizable Vertical Lines: Each line is independently configurable, allowing for unique settings.
Time-Based Line Placement: Lines are drawn based on the user-defined time, making them applicable across different trading sessions without needing to specify dates.
Customizable Labels: Each line has an optional label that displays the time by default, but users can modify the text, color, background color, position, and font size of the label.
User-Friendly Inputs: The script uses Pine Script’s input functions, making it easy to adjust the parameters directly from the TradingView interface.
How It Works:
The script uses a loop structure to check the time of each bar on the chart. When a bar matches the user-defined time, a vertical line is drawn from the top to the bottom of the chart. A label is then placed on the line, displaying the time or custom text as defined by the user.
Code Overview:
The script is divided into 15 sections, one for each line. Each section contains input fields where users can specify the time, color, width, style, label text, label color, label background color, label position, and label font size.
This script is ideal for traders who need to mark key times during the trading day, such as market open/close, significant economic events, or custom-defined moments.
Conclusion:
This Pine Script provides a versatile tool for traders who want to enhance their chart analysis with precise, customizable markers. Whether you're tracking market opens or key price levels, this script helps keep your chart organized and informative.
Reward Ratio ValidatorThis PineScript code creates an indicator called "Reward Ratio Validator" that helps traders evaluate potential trade setups based on pivot points, standard deviation, and risk/reward ratios. Here's a breakdown of what the code does:
1. Input parameters:
- Pivot: Number of bars for pivot calculation
- STDEV Length: Number of bars for standard deviation calculation
- Risk / Reward: The desired risk-to-reward ratio
- STDEV Multiplier: Multiplier for the standard deviation
- On : Short | Off : Long: A toggle to switch between short and long trade analysis
2. Pivot point calculation:
- The code calculates pivot highs and lows using the specified pivot length
- It stores the last pivot high and low in an array
3. Standard deviation calculation:
- Calculates the standard deviation of closing prices over the specified length
4. Risk/Reward deviation calculation:
- For long trades (when show is false):
Calculates the price level where the reward would be 'rvr' times the risk, based on the last pivot low
- For short trades (when show is true):
Calculates the price level where the reward would be 'rvr' times the risk, based on the last pivot high
5. Plotting:
- Plots the calculated risk/reward levels for both long and short trades
- Plots the multiplied standard deviation
6. Visual representation:
- Fills the area between the risk/reward levels and the standard deviation plot
- Uses color coding to indicate whether the current price movement exceeds the standard deviation threshold:
- Green: The move is within the standard deviation threshold
- Red: The move exceeds the standard deviation threshold
This indicator helps traders visually assess whether a potential trade setup offers the desired risk/reward ratio while considering the recent price volatility (represented by the standard deviation). It can be used to identify possible entry points for both long and short trades that meet specific risk/reward criteria.
ICT - MTF Bias ProbabilityThe ICT - MTF Bias Probability Statistics is a sophisticated trading tool designed to help traders identify and leverage market bias across multiple timeframes. By analyzing price actions relative to key levels, such as the previous day's high and low, this indicator provides a clear directional bias—bullish, bearish, or neutral—based on specific market conditions.
Key Features
1. Multi-Timeframe Analysis
- The indicator evaluates price movements on various timeframes, including 15-minute, 1-hour, 4-hour, daily, and weekly charts.
- It determines the bias for each timeframe, helping traders understand the broader market context.
2. Bias Determination
- A bullish bias is established when the current price closes above the previous day’s high, while a bearish bias is indicated by a close below the previous day’s low.
- Additional conditions consider price wicks and closings within the previous day's range to refine the bias determination.
3. Advanced Probability Calculations
- The indicator employs a unique probability calculation that factors in proximity to key levels, price momentum, volatility, and time decay.
- These probabilities give traders an edge by quantifying the likelihood of the market reaching the previous day’s high or low, depending on the bias.
4. Visual Table Display
- A table is displayed on the chart, summarizing the bias and probability for each timeframe, alongside an overall market bias.
- This feature allows traders to quickly assess market conditions and make informed decisions.
5. Ideal Trade Levels
- For traders looking to optimize entry points, the indicator suggests ideal buy and sell levels based on New York midnight open prices, adjusted according to the overall bias.
The ICT - MTF Bias Probability Statistics is a powerful tool for traders who want to align their strategies with higher timeframe market trends while leveraging advanced probability analysis to improve decision-making.
LOT-R:R Multi Entries
This advanced TradingView indicator is designed to help traders manage multiple entry points with precise risk management and lot sizing calculations. It's particularly useful for scaling in and out of positions while maintaining a predetermined risk-to-reward ratio.
Key Features:
Multiple Entry Points: Supports up to 5 entry points, allowing for sophisticated scaling strategies.
Custom Risk Management: Set individual risk percentages for each entry point.
Automatic Lot Size Calculation: Calculates optimal lot sizes based on account balance and risk preferences.
Flexible Boundary Setting: Use custom or auto-calculated upper and lower boundaries for entries.
Stop Loss and Take Profit Visualization: Clearly displays SL and TP levels with customizable options.
Break-Even Point Calculation: Automatically computes and displays the break-even point.
Risk-to-Reward Ratio: Calculates and displays the overall risk-to-reward ratio for the trade.
Visual Aids: Includes lines, labels, and background colors to clearly represent different levels and zones.
Detailed Information Table: Provides a comprehensive table with entry prices, lot sizes, and risk percentages.
Multi-Instrument Support: Adapts pip value calculations for various forex pairs and instruments like XAUUSD and BTCUSD.
This indicator is perfect for traders who want to implement scaling strategies while maintaining strict risk management. It offers a visual and numerical breakdown of your trade plan, helping you make informed decisions about entries, exits, and position sizing.
Whether you're a scalper looking to refine your entries or a swing trader planning a complex position, this indicator provides the tools you need to execute your strategy with precision.
Monte Carlo (Polyline Traceback) [Kioseff Trading]Hello!
This script "Monte Carlo (Polyline Traceback) " performs a Monte Carlo simulation using polylines!
By using polylines, and tracing back the initial simulation to its origin point, we can better replicate the ideal output of a Monte Carlo simulation!
Such as:
The image above shows the output of a simulation (image sourced outside TV).
With this script, and polyline capabilities, we can come quite close on TradingView.
The image above shows the indicator in action! Not bad considering the ideal output.
Of course, the script is quite heavy and tries its best to circumvent limitations :D
You might run into load time errors, in which case you might try applying the built-in setting "Force Script Load". This setting will cut-off the visuals for some simulations, but has a higher chance of passing load-time limitations!
As shown in the image above, you can select to only show worst-case and best-case simulations. Using this option will reduce chart lag and improve load times.
Features
Monte Carlo Simulation: Performs Monte Carlo simulation to generate multiple future paths.
Asset Price: Can simulate future asset prices based on historical log returns.
Statistical Methods: Offers two simulation methods—Gaussian (Normal) distribution and Bootstrapping.
Adjustable Parameters: Offers numerous user-adjustable settings like number of simulations, forecast length, and more.
Historical Data Points: Option to specify the amount of historical data to be used in the simulation (price).
Best/Worst Case: Allows you to show only the best case / worst case outcome (range) for all simulations!
Thank you!
Tick CVD [Kioseff Trading]Hello!
This script "Tick CVD" employs live tick data to calculate CVD and volume delta! No tick chart required.
Features
Live price ticks are recorded
CVD calculated using live ticks
Delta calculated using live ticks
Tick-based HMA, WMA, EMA, or SMA for CVD and price
Key tick levels (S/R CVD & price) are recorded and displayed
Price/CVD displayable as candles or lines
Polylines are used - data visuals are not limited to 500 points.
Efficiency mode - remove all the bells and whistles to capitalize on efficiently calculated/displayed tick CVD and price
How it works
While historical tick-data isn't available to non-professional subscribers, live tick data is programmatically accessible. Consequently, this indicator records live tick data to calculate CVD, delta, and other metrics for the user!
Generally, Pine Scripts use the following rules to calculate volume/price-related metrics:
Bullish Volume: When the close price is greater than the open price.
Bearish Volume: When the close price is less than the open price.
This script, however, improves on that logic by utilizing live ticks. Instead of relying on time-series charts, it records up ticks as buying volume and down ticks as selling volume. This allows the script to create a more accurate CVD, delta, or price tick chart by tracking real-time buying and selling activity.
Price can tick fast; therefore, tick aggregation can occur. While tick aggregation isn't necessarily "incorrect", if you prefer speed and efficiency it's advised to enable "efficiency mode" in a fast market.
The image above highlights the tick CVD and price tick graph!
Green price tick graph = price is greater than its origin point (first script load)
Red price tick graph = price is less than its origin point
Blue tick CVD graph = CVD, over the calculation period, is greater than 0.
Red tick CVD graph = CVD is less than 0 over the calculation period.
The image above explains the right-oriented scales. The upper scale is for the price graph and the lower scale for the CVD graph.
The image above explains the circles superimposed on the scale lines for the price graph and the CVD graph.
The image above explains the "wavy" lines shown by the indicator. The wavy lines correspond to tick delta - whether the recorded tick was an uptick or down tick and whether buy volume or sell volume transpired.
The image above explains the blue/red boxes displayed by the indicator. The boxes offer an alternative visualization of tick delta, including the magnitude of buying/selling volume for the recorded tick.
Blue boxes = buying volume
Red boxes = selling volume
Bright blue = high buying volume (relative)
Bright red = high selling volume (relative)
Dim blue = low buying volume (relative)
Dim red = low selling volume (relative)
The numbers displayed in the box show the numbered tick and the volume delta recorded for the tick.
The image above further explains visuals for the CVD graph.
Dotted red lines indicate key CVD peaks, while dotted blue lines indicate key CVD bottoms.
The white dotted line reflects the CVD average of your choice: HMA, WMA, EMA, SMA.
The image above offers a similar explanation of visuals for the price graph.
The image above offers an alternative view for the indicator!
The image above shows the indicator when efficiency mode is enabled. When trading a fast market, enabling efficiency mode is advised - the script will perform quicker.
Of course, thank you to @RicardoSantos for his awesome library I use in almost every script :D
Thank you for checking this out!
LazyScalp Board by MalexThis indicator offers a quick view of essential trading parameters in a customizable table format.
The table displays key metrics such as daily volume, average volume over a chosen period, volatility (normalized ATR), correlation coefficient, and funding rate, all of which can be tailored to your preferences.
You can also adjust the table's appearance, style, and layout to better fit your needs.
Designed with intraday traders and scalpers in mind, this indicator helps you swiftly identify the most suitable trading instruments.
Based on LazyScalp Board by Aleksandr400
BTC Coinbase PremiumThis script is designed to compare the price of Bitcoin on two major exchanges: Coinbase and Binance. It helps you see if there’s a difference in the price of Bitcoin between these two exchanges, which is known as a “premium” or “discount.”
Here’s how it works in simple terms:
Getting the Prices:
The script first fetches the current price of Bitcoin from Coinbase and Binance. It looks at the closing price, which is the price at the end of the selected time period on your chart.
Calculating the Difference:
It then calculates the difference between these two prices. If Bitcoin is more expensive on Coinbase than on Binance, this difference will be positive, indicating a “premium.” If it’s cheaper on Coinbase, the difference will be negative, indicating a “discount.”
Visualizing the Difference:
The script creates a visual chart that shows this price difference over time. It uses green bars to show when there’s a premium (Coinbase is more expensive) and red bars to show when there’s a discount (Coinbase is cheaper).
Optional Table Display:
If you choose to, the script can also show this price difference in a small table at the top right corner of your chart. The table displays the words “Coinbase Premium” and the exact dollar amount of the premium or discount.
Why does it matter?
Traders and investors have spotted a correlation between bullish strength on BTC and a strong Coinbase premium along with the inverse of a strong Coinbase discount and BTC price weakness.
Total Bars CalculatorThis indicator simply plots how much bars are available to the user in the respective chart.
For Example if plot shows 5000 , therefore you have total 5000 bars of OHLC available.
US Market Real Value Adjusted for CPI and Dollar IndexUS Market Real Value Adjusted for CPI and Dollar Index
Provides quick access to this formula: (SP:SPX+NASDAQ_DLY:IXIC+TVC:DJI+CAPITALCOM:RTY)/4/(ECONOMICS:USCPI*TVC:DXY*100)
Overview:
This indicator provides a dynamic view of the US stock market's real value, adjusted for inflation and currency strength. It combines major stock indices including the S&P 500, NASDAQ, Dow Jones, and Russell 2000, and adjusts the composite index using the US Consumer Price Index (CPI) and the US Dollar Index (DXY). This adjustment helps to reveal the true market performance, stripped of inflationary effects and currency valuation changes.
Key Features:
Composite Index Calculation: Averages the prices of SPX, IXIC, DJI, and RTY to create a broad market overview.
Inflation Adjustment: Uses the CPI to adjust for the effects of inflation, ensuring that the real value changes in the stock market are highlighted.
Currency Strength Adjustment: Applies the DXY to account for fluctuations in the strength of the US dollar, providing insights into how currency variations impact market valuation.
Dynamic Base Calculation: Utilizes a rolling window to dynamically update base values, allowing for continuous reassessment of the market’s adjusted value as new data becomes available.
This indicator provides:
Real Value Insights: By adjusting for both inflation and currency strength, this indicator offers a more accurate measure of the underlying market conditions.
Dynamic Updates: With a rolling window approach, the indicator continually adapts, providing up-to-date information.
Strategic Decisions: Helps in identifying true market growth or decline periods, aiding in strategic investment planning.
Usage:
To use this indicator, simply add it to your chart, and it will automatically display the adjusted composite index. This index can be particularly useful for investors looking to understand underlying market trends beyond nominal price movements, helping in making more informed investment decisions when comparing certain tickers to an average of the major US stock market indexes, adjusted for inflation and the strength of the US dollar.
Example Use Case:
A typical use case might involve comparing periods of high inflation to see how the overall US stock market performed in real terms, not just nominal terms. This can indicate whether the market growth was genuine or merely a reflection of inflation. By comparing this result to an average of these major indexes without adjusting for inflation or currency strength changes, you can see how significantly these forces can impact real gains or losses.
Relative Performance AnalysisRelative Performance Analysis Script
This Pine Script creates a detailed table on your TradingView chart to compare the performance of a specified asset against a benchmark over multiple time frames. The table is fully customizable, allowing you to select its location on the chart and display performance metrics for different periods.
Features:
Customizable Table Location: Choose where the table appears on your chart from a range of predefined positions (e.g., bottom left, top center).
Dynamic Column Headers: The table includes columns for the ticker, description, and performance metrics for various time periods (1 day, 1 week, 1 month, 3 months, 6 months, and 1 year).
Performance Calculation: Calculates the percentage change in performance between the current close price and the previous close price for each time frame.
Color-Coded Performance: Uses a color scheme to highlight performance levels, with specific colors for positive and negative changes to easily visualize performance trends.
Benchmark and Asset Comparison: Displays performance metrics for both a benchmark (e.g., SPY) and the asset currently viewed on the chart, providing a clear comparison.
Inputs:
Benchmark Symbol: Specify the symbol of the benchmark asset (e.g., SPY).
Benchmark Description: Provide a description for the benchmark asset.
Chart Symbol: Automatically uses the symbol of the chart for comparison.
Usage:
Add the script to your TradingView chart.
Configure the benchmark symbol and description as needed.
The table will automatically populate with performance data and be positioned according to your selection.
Disclaimer:
This script is for informational and educational purposes only and is not intended as financial advice. The performance data displayed in the table is based on historical prices and is not indicative of future performance. Trading involves risk, and you should always do your own research and consult with a qualified financial advisor before making any investment decisions. The creator of this script assumes no responsibility for any losses or damages incurred as a result of using this tool.
SPX Mapped Gaps [Mxwll]Hello traders 👋
This indicator "SPX Mapped Gaps" detects gaps from the SPX (or the trader's choice of index/asset) and plots them for the asset on your chart!
Features
Selectable comparison symbol
Gaps from the selected symbol (SPX by default) are plotted for the asset on your chart - serving as potential support/resistance levels!
Closest gaps from comparison symbol displayed in upper-right table
Overlapped gaps deleted automatically - less clutter!
How this script works
The "SPX Mapped Gaps" is designed to help traders determine price levels for the asset on their chart where a major index (any asset) gapped up or down.
Of course, a gap that occurs on SPX (4-digit price) is incompatible with the price chart of BTC (5-digit price). To circumvent this, the percentage distance of the gap from SPX is determined, and a gap level is drawn equidistantly (up/down) from the open price of the asset on your chart. With this method, the proportion of the gap is maintained at the price area it occurred for the asset on your chart!
The image above outlines functionality for the indicator!
Key points:
Up gaps are denoted by green boxes
Down gaps are denoted by red boxes
All gaps are listed with their start and end price for the comparison asset (SPX for the example). These labels can be hidden at the user's discretion.
Gaps are expected to act as support/resistance during their lifetime
The image above explains the output of the script, including line style indications!
Solid lines indicate that the leverage used for at your entry price constitutes an active trade. Dotted lines mean the trade has already achieved your profit target for that leverage, or stopped out.
The image above explains the table attached to the indicator!
This table displays the closest gaps to the current asset price. The status (up gap or down gap) from the gap to the current price is also detailed.
Why are gaps on the SPX, or major index, relevant to BTC and other assets?
When a gap on the major indices occurs, it's expected that strong aggregate buying or selling pressure will transpire for BTC and other coins. Due to this, the presence of a gap on a major index might correspond to increased activity on smaller market-cap assets with some degree of positive correlation to the index. Consequently, the price level for the asset at which a gap for the major index occurred may function as support/resistance for future price!
That is all for this - thanks traders!
Liquidation Risk Suite [Mxwll]Hello traders 👋
This indicator "Liquidation Risk Suite" hosts various features that allow the trade to determine optimal position sizing, leverage, profit targets, and more!
Features
Customizable entry price and time
From the entry price, a user-defined number of liquidation levels by leverage are shown
From the entry price, a user-defined number of profit targets by leverage are shown
User-defined ROI % target. Liquidation levels and profit targets automatically change to account for the traders' desired profit percentage.
Calculate for long and short positions
Trader can set portfolio balance and investment per trade - indicator will warn the trader when the investment per trade is too high relative to the portfolio balance.
How this script works
The Liquidation Risk Suite is designed to help traders determine position sizing, appropriate risk for their position (leverage, etc.), and potential profit targets from their entry point.
Upon loading the script, the script will prompt you for an entry price and entry time. Simply click the screen at the appropriate locations (your entry price and entry bar) and, from there, the script will calculate various liquidation levels, determine whether your trade has achieved the desired profit at various leverages, and provide various trading metrics such as % risk of portfolio, ROI target %, profit at target, and more!
The image above outlines various trade-related metrics for your position!
These metrics include:
Status of trade (profit or loss) for various common leverage amounts
Portfolio balance
Investment amount
Price target (calculated from desired ROI%)
Profit at target (calculated from desired ROI% and leverage used)
Portfolio risk
Entry price
Entry time
ROI Target %
The image above explains the output of the script, including line style indications!
Solid lines indicate that the leverage used for at your entry price constitutes an active trade. Dotted lines mean the trade has already achieved your profit target for that leverage, or stopped out.
Additionally, the script can calculate pertinent metrics for short positions!
That's all, just a simple, sweet script to help traders figure out what leverage to use for their positions, the risk they're taking on, and potential stop and profit levels!
Thank you to kaigouthro for his colors library!