Liquidity VisualizerThe "Liquidity Visualizer" indicator is designed to help traders visualize potential areas of liquidity on a price chart. In trading, liquidity often accumulates around key levels where market participants have placed their stop orders or pending orders. These levels are commonly found at significant highs and lows, where traders tend to set their stop-losses or take-profit orders. The indicator aims to highlight these areas by drawing unbroken lines that extend indefinitely until breached by the price action.
Specifically, this indicator identifies and marks pivot highs and pivot lows, which are price levels where a trend changes direction. When a pivot high or pivot low is formed, it is represented on the chart with a horizontal line that continues to extend until the price touches or surpasses that level. The line remains in place as long as the level remains unbroken, which means there is potential liquidity still resting at that level.
The concept behind this indicator is that liquidity is likely to be resting at unbroken pivot points. These levels are areas where stop-loss orders or pending buy/sell orders may have accumulated, making them attractive zones for large market participants, such as institutions, to target. By visualizing these unbroken levels, traders can gain insight into where liquidity might be concentrated and where potential price reversals or significant movements could occur as liquidity is taken out.
The indicator helps traders make more informed decisions by showing them key price levels that may attract significant market activity. For instance, if a trader sees multiple unbroken pivot high lines above the current price, they might infer that there is a cluster of liquidity in that area, which could lead to a price spike as those levels are breached. Similarly, unbroken pivot lows may indicate areas where downside liquidity is concentrated.
In summary, this indicator acts as a "liquidity visualizer," providing traders with a clear, visual representation of potential liquidity resting at significant pivot points. This information can be valuable for understanding where price might be drawn to, and where large movements might occur as liquidity is targeted and removed by market participants.
Loss
Trailing Stop ProTrailing Stop Pro is a sophisticated TradingView indicator designed to enhance your trading strategy by dynamically managing trailing stops based on market volatility. This tool leverages the Average True Range (ATR) to adjust stop levels, providing traders with a robust mechanism to protect profits and minimize losses.
Key Features:
Dynamic Trailing Stops: Automatically adjusts stop levels using ATR, allowing for responsive and adaptive risk management.
Customizable Inputs: Tailor the indicator to your trading style with adjustable parameters such as ATR Length, ATR Multiplier, and Source Vector.
Visual Clarity: Distinct color settings for long and short stops, with adjustable line thickness and transparency, ensuring clear visualization on your charts.
Professional Grade: The "Pro" designation signifies advanced features suitable for both novice and experienced traders seeking reliable and efficient stop management.
How It Works:
To set up the indicator, begin by defining the Chrono Point, which specifies the exact time you want the trailing stop mechanism to activate. This allows for precise control over when your stops begin to trail. Next, set the Credit Unit as the initial entry price for your trade, serving as the baseline from which the trailing stops will adjust.
The indicator uses ATR-based adjustments to determine stop levels. Customize the sensitivity of the trailing stop by adjusting the ATR Length (default is 14) and ATR Multiplier (default is 0.5). A longer ATR length smooths out volatility, while a higher multiplier increases the distance of the stop from the price.
Select your Source Vector from "High/Low," "Close," or "Open" prices as the basis for stop calculation. This flexibility allows you to align the indicator with your preferred trading strategy. The indicator plots trailing stops directly on the chart, with color-coded lines indicating long (teal) and short (red) positions. You can adjust the line thickness and transparency for optimal visibility.
The Mission Status feature automatically detects whether the trade is long or short and adjusts the trailing stop accordingly. If the price hits the trailing stop, the trade is considered exited, and the indicator calculates the profit or loss percentage.
Benefits:
Risk Management: Protect your trades from adverse market movements while locking in profits as prices move favorably.
Automation: Reduce manual intervention with automatic stop adjustments, allowing you to focus on strategic decision-making.
User-Friendly Interface: Intuitive settings and clear visual cues make it easy to integrate into your existing trading workflow.
Conclusion:
Trailing Stop Pro is an essential tool for traders looking to enhance their risk management strategies with precision and ease. By automating the trailing stop process and providing clear visual feedback, this indicator empowers you to navigate the markets with confidence. Whether you're a seasoned trader or just starting, Trailing Stop Pro offers the functionality and flexibility needed to optimize your trading performance.
The Trailing Stop Pro indicator is a tool designed to assist traders in managing risk and optimizing their trading strategies. However, it should not be considered as financial advice or a guarantee of profitability. Trading involves significant risk, and it is possible to lose more than your initial investment. Users are encouraged to thoroughly test the indicator in a demo environment and consider their own financial situation and risk tolerance before using it in live trading. Past performance is not indicative of future results, and users should seek advice from a qualified financial advisor if needed.
Fibonacci-Only StrategyFibonacci-Only Strategy
This script is a custom trading strategy designed for traders who leverage Fibonacci retracement levels to identify potential trade entries and exits. The strategy is versatile, allowing users to trade across multiple timeframes, with built-in options for dynamic stop loss, trailing stops, and take profit levels.
Key Features:
Custom Fibonacci Levels:
This strategy calculates three specific Fibonacci retracement levels: 19%, 82.56%, and the reverse 19% level. These levels are used to identify potential areas of support and resistance where price reversals or breaks might occur.
The Fibonacci levels are calculated based on the highest and lowest prices within a 100-bar period, making them dynamic and responsive to recent market conditions.
Dynamic Entry Conditions:
Touch Entry: The script enters long or short positions when the price touches specific Fibonacci levels and confirms the move with a bullish (for long) or bearish (for short) candle.
Break Entry (Optional): If the "Use Break Strategy" option is enabled, the script can also enter positions when the price breaks through Fibonacci levels, providing more aggressive entry opportunities.
Stop Loss Management:
The script offers flexible stop loss settings. Users can choose between a fixed percentage stop loss or an ATR-based stop loss, which adjusts based on market volatility.
The ATR (Average True Range) stop loss is multiplied by a user-defined factor, allowing for tailored risk management based on market conditions.
Trailing Stop Mechanism:
The script includes an optional trailing stop feature, which adjusts the stop loss level as the market moves in favor of the trade. This helps lock in profits while allowing the trade to run if the trend continues.
The trailing stop is calculated as a percentage of the difference between the entry price and the current market price.
Multiple Take Profit Levels:
The strategy calculates seven take profit levels, each at incremental percentages above (for long trades) or below (for short trades) the entry price. This allows for gradual profit-taking as the market moves in the trade's favor.
Each take profit level can be customized in terms of the percentage of the position to be closed, providing precise control over exit strategies.
Strategy Backtesting and Results:
Realistic Backtesting:
The script has been backtested with realistic account sizes, commission rates, and slippage settings to ensure that the results are applicable to actual trading scenarios.
The backtesting covers various timeframes and markets to ensure the strategy's robustness across different trading environments.
Default Settings:
The script is published with default settings that have been optimized for general use. These settings include a 15-minute timeframe, a 1.0% stop loss, a 2.0 ATR multiplier for stop loss, and a 1.5% trailing stop.
Users can adjust these settings to better fit their specific trading style or the market they are trading.
How It Works:
Long Entry Conditions:
The strategy enters a long position when the price touches the 19% Fibonacci level (from high to low) or the reverse 19% level (from low to high) and confirms the move with a bullish candle.
If the "Use Break Strategy" option is enabled, the script will also enter a long position when the price breaks below the 19% Fibonacci level and then moves back up, confirming the break with a bullish candle.
Short Entry Conditions:
The strategy enters a short position when the price touches the 82.56% Fibonacci level and confirms the move with a bearish candle.
If the "Use Break Strategy" option is enabled, the script will also enter a short position when the price breaks above the 82.56% Fibonacci level and then moves back down, confirming the break with a bearish candle.
Stop Loss and Take Profit Logic:
The stop loss for each trade is calculated based on the selected method (fixed percentage or ATR-based). The strategy then manages the trade by either trailing the stop or taking profit at predefined levels.
The take profit levels are set at increments of 0.5% above or below the entry price, depending on whether the position is long or short. The script gradually exits the trade as these levels are hit, securing profits while minimizing risk.
Usage:
For Fibonacci Traders:
This script is ideal for traders who rely on Fibonacci retracement levels to find potential trade entries and exits. The script automates the process, allowing traders to focus on market analysis and decision-making.
For Trend and Swing Traders:
The strategy's flexibility in handling both touch and break entries makes it suitable for trend-following and swing trading strategies. The multiple take profit levels allow traders to capture profits in trending markets while managing risk.
Important Notes:
Originality: This script uniquely combines Fibonacci retracement levels with dynamic stop loss management and multiple take profit levels. It is not just a combination of existing indicators but a thoughtful integration designed to enhance trading performance.
Disclaimer: Trading involves risk, and it is crucial to test this script in a demo account or through backtesting before applying it to live trading. Users should ensure that the settings align with their individual risk tolerance and trading strategy.
Portfolio PnL Tracker
This is a personal portfolio tracker that helps you track your daily profits and losses. You can track up to 64 stocks or cryptocurrencies. You can set them by specifying the symbol and average price.
FEATURES
- Set up to 64 stock or crypto symbols.
- Shows the average price line
- Show profit or loss as a percentage
- Shows only when on the chart that matches the symbol settings.
HOW TO USE
1. Double click the PnL Tracker indicator at the top left of the chart
2. Enter your symbol and average cost
The average cost line shows your current position.
PnL is calculated based on the average cost you input.
The Profit and Loss (PnL) box and the average cost line will only be displayed when your input symbol matches the chart you are currently viewing.
Realized Profit & Loss [BigBeluga]The Realized Loss & Profit indicator aims to find potential dips and tops in price by utilizing the security function syminfo.basecurrency + "_LOSSESADDRESSES".
The primary objective of this indicator is to present an average, favorable buying/selling opportunity based on the number of people currently in profit or loss.
The script takes into consideration the syminfo.basecurrency, so it should automatically adapt to the current coin.
🔶 USAGE
Users have the option to enable the display of either Loss or Profit, depending on their preferred visualization.
Examples of displaying Losses:
Example of displaying Profits:
🔶 CONCEPTS
The concept aims to assign a score to the data in the ticker representing the realized losses. This score will provide users with an average of buying/selling points that are better to the typical investor.
🔶 SETTINGS
Users have complete control over the script settings.
🔹 Calculation
• Profit: Display people in profit on an average of the selected length.
• Loss: Display people in loss on an average of the selected length.
🔹 Candle coloring
• True: Color the candle when data is above the threshold.
• False: Do not color the candle.
🔹 Levels
- Set the level of a specific threshold.
• Low: Low losses (green).
• Normal: Low normal (yellow).
• Medium: Low medium (orange).
• High: Low high (red).
🔹 Z-score Length: Length of the z-score moving window.
🔹 Threshold: Filter out non-significant values.
🔹 Histogram width: Width of the histogram.
🔹 Colors: Modify the colors of the displayed data.
🔶 LIMITATIONS
• Since the ticker from which we obtain data works only on the daily timeframe, we are
restricted to displaying data solely from the 1D timeframe.
• If the coin does not have any realized loss data, we can't use this script.
ASG Delta %This utility script provides a convenient way to calculate the percentage gain or drop of a token's price within a user-defined date range. It eliminates the need for manual measurement on individual charts, saving time and effort.
The script is particularly valuable when integrated into a daily token scanning routine for watchlists. By comparing the significant gains or drops among different tokens, traders can identify potential trading opportunities.
Simply select the desired date range, and the script will identify the highest and lowest price points achieved during that period. It then shows a visual representation in the form of a bullish or bearish box, displaying the percentage change (delta %). If the current price falls within the box's upper and lower bounds, additional percentage information can be shown in either the 'normal' or 'reverse' mode.
For instance, if a token experiences a -52.35% drop, enabling the 'Reverse' setting will reveal a potential 109.86% gain (from the low), or a 76.02% gain (from current price) or a potential drop of -16.5% (from current price) etc.. Having these basic statistics available, without having to manually chart them, especially during prolonged bear or bull markets, enables traders to make informed decisions and position themselves for more profitable trades.
I hope you find this script valuable. Your comments and recommendations are welcome as they will help improve the script's functionality further.
Manual PnL (Profit and Loss) % Tracker - spot long only
This is a manual profit and loss tracker. It takes the user's manual input of total cost and quantity, and then outputs a table on the bottom right of the chart showing the profit or loss %, average purchase price, gross profit or loss, and market value.
Instructions:
1. Double click the indicator title at the top left of the chart
2. Select the "Inputs" tab and click the empty field next to "Symbol" to enter the traded symbol+exchange. This entry MUST be the same as the chart you are on, for example BTCUSDT/BINANCE (indicator will not display otherwise)
3. Enter the Total Cost and Qty of shares/coins owned
4. Optional - change positive or negative colors
5. Optional - under the "Style" tab, change the color of the average price (AVG) line
Note that for the average price (AVG) line to be shown/hidden you must enable/disable "Indicator and financials labels" in the scales settings.
For crypto or other tickers that have prices in many decimal places I would suggest, for the sake of accuracy, adjusting the decimal places in the code so that for prices under $1 you will display more info.
For example let's say you purchase x number of crypto at a price of 0.031558 you should change the code displaying "0.00" on line 44 to "0.000000"
This will ensure that the output table and plotted line will calculate an average price with the same number of decimals.
Dynamic Stop Loss DemoWhat does this script do ?
This script is for pine script programmers and explains how to implement a dynamic stop-loss strategy. It is different from trailing stop-loss. Trailing stop-loss can only set the retracement value, but this script can take profit on part of the position at a fixed price and allows users to decide whether to take profit on all positions based on whether a certain track is breached or other conditions author want. In this demo, it use rsi crossover and crossunder to decide the strategy condition, and use close price as open price, and use lowest low / highest high as stop price, and use 1.5 risk ratio to calculate the fixed first profit price. It will take 50% position size when the first profit price was reached. Then it will close all rest positions when the inverse condition come out or the dynamic stop(calculated by ATR) breached or when the price back to the open price or the stop price.
How is this script implemented
When start strategy by strategy.entry , it gives a custom id which contains direction, openPrice, stopPrice, profitPrice, qty, etc. It can be get from the global variable strategy.posiition_entry_name .
[TTI] ATR Trailing Stop Alerts––––HISTORY & CREDITS 🏦
The Trailing Stop Alert is a TradingView indicator developed by TintinTrading, which is designed to help traders manage their positions by updating and alerting them about their trailing stop levels. This tool is a valuable addition to a trader's arsenal, as it automates the process of maintaining trailing stop levels and alerts the user when they are updated or hit.
––––WHAT IT DOES 💡
The Trailing Stop Alert indicator calculates trailing stop levels based on the Average True Range (ATR) of an asset over a specified lookback period. It takes user inputs for trail type (Long or Short), lookback period, ATR length, ATR multiplier, and bar time. The indicator can be applied to any financial instrument and will dynamically update the trailing stop level based on price action. When the trailing stop level is updated or hit, the indicator generates alerts to inform the user of these events.
––––HOW TO USE IT 🔧
1. Add the Trailing Stop Alert indicator to your TradingView chart.
2. Configure the settings according to your preferred parameters:
👉Trail Type: Choose between "Long" or "Short" based on your trading position.
👉Lookback: Set the number of bars to look back for determining the highest high or lowest low.
👉ATR Length: Set the period for calculating the Average True Range.
👉ATR Multiplier: Set the multiplier to adjust the trailing stop distance.
👉Bar Time: Set the time at which the indicator starts updating the trailing stop levels.
3. The indicator will plot the trailing stop level on the chart, and update it as the price action unfolds.
4. When the trailing stop level is updated or hit, you will receive an alert in the form of a message with the new level or a notification that the stop has been hit.
5. Adjust your stop loss orders accordingly based on the trailing stop levels provided by the indicator.
By using the Trailing Stop Alert indicator, you can effectively manage your positions and reduce the risk of giving back profits in a trade.
Average Cost (Costo Promedio)ENGLISH
This 'Average Cost' script allows the user to input and visualize profit or loss for different stocks (up to 50) with average cost and quantity data on a single chart. This is useful for tracking the profit or loss of each stock in real-time.
To use this script, the user should follow these steps:
1. Add the 'Average Cost' script to your TradingView chart.
2. In the script's configuration window, input the tickers, average costs, and quantity of shares for each ticker you want to monitor.
3. Click 'Accept' to apply the changes.
This script is primarily designed for stock markets, but can also be useful in other financial markets where the user is interested in tracking the performance of multiple assets.
ESPAÑOL
Este script de "Costo Promedio" permite al usuario ingresar y visualizar si hay ganancia o perdida para diferentes acciones (hasta 50) con los datos de costos promedio y cantidad de acciones en un solo gráfico. Esto es útil para realizar un seguimiento de la ganancia o pérdida de cada acción en tiempo real.
Para utilizar este script, el usuario debe seguir estos pasos:
1. Agregue el script "Costo Promedio" a su gráfico en TradingView.
2. En la ventana de configuración del script, ingrese los tickers, costos promedio y cantidad de acciones para cada ticker que desee monitorear.
3. Haga clic en "Aceptar" para aplicar los cambios.
Este script está diseñado principalmente para los mercados de acciones, pero también puede ser útil en otros mercados financieros donde el usuario esté interesado en rastrear el rendimiento de múltiples activos.
Live PnL v1.0Live P&L for multiple stocks, currencies, crypto and commodities can now be tracked for your favorite scripts, pair trading etc.
This indicator gives provision to add up to 3 stocks/futures/currency with Buy and Sell, Quantity (can be lot size or any other) and Entry Price and set as default so that every time you put back this indicator you can monitor the live Profit / Loss figure.
This indicator will help trade to evaluate and track tips/trades of experts on social media and Media platforms and check their accuracy themselves in an organized way.
Apart from paper trading a trade or multiple positions ones combined together it also gives a feeler of combined Mark to live Market Drawdowns or Profitability.
Chart Gain Or Loss With TableThis indicator auto calculate the first visible bar to the last visible bar
1. Gain or loss in percentage
2. Highest price
3. Lowest price
4. Total up bar
5. Total down bar
6. Total unchanged bar
7. Total bar
8. Total volume
*This indicator is not working on this page, you must add it in to your chart.
All Time LowThis script is to remind you of how much you would lose if the price went down to the all time low.
This will make you think twice about your purchases!
Position Sizing CalculatorThis is an intuitive risk management tool with a minimalist design.
This calculator will determine your position size per trade, profit, loss, risk/reward ratio and leverage if any.
It will calculate your leverage if you are trading financial instruments e.g. Mini Futures , Turbo Warrants etc. that have a financing level.
Tip: Use this as a complement to the Long/Short Position tool.
Provide the following inputs to get a calculation:
- Position type
- Account balance
- Risk per trade percentage
- Financing level (if any for leveraged instruments), else let it be 0
- Entry price
- Target price
- Stopp loss price
You can also choose the color of the output text, its background and position in the chart window.
Enjoy!
Impermanent Loss TrackerThe indicator helps to track the percentage loss/gain of the quantity of the asset as a result of LP rebalancing due to price changes.
Calculations are based on the common AMM equation x * y = k.
This is the initial version of the indicator. It is certainly a subject to further improvement. If you have any suggestions send them here at andmax071@gmail.com.
Thank you for trying this out.
MLLossFunctionsLibrary "MLLossFunctions"
Methods for Loss functions.
mse(expects, predicts) Mean Squared Error (MSE) " MSE = 1/N * sum ((y - y')^2) ".
Parameters:
expects : float array, expected values.
predicts : float array, prediction values.
Returns: float
binary_cross_entropy(expects, predicts) Binary Cross-Entropy Loss (log).
Parameters:
expects : float array, expected values.
predicts : float array, prediction values.
Returns: float
Trailing Stop AlertsThis script is designed as an ATR-based trailing stop tool to assist in managing open positions.
Once you're involved in a profitable trade, if you add this script to your chart you'll be prompted to select a bar to begin trailing from.
You can then adjust the candle lookback distance for swing high/lows (7 by default), the ATR multiplier (1.0 by default), and the direction to trail (Long/Short).
You can also adjust the ATR period in the settings menu if you want to (14 period by default).
Once the script is added to your chart, it will begin drawing your trailing stop and you can then set up alerts.
Alert Options:
Any alert() function call : Will trigger an alert for both conditions (trailing stop updated, trailing stop hit)
Alert Conditions : Trailing Stop Update will trigger whenever the stop is updated, Trailing Stop Hit will trigger whenever the stop is hit.
Note: the alerts will only fire once per bar close and the trailing stop will not update on realtime bars.
Gain/StopLoss Percentage LinesGain/StopLoss Percentage Lines is a quick way to enter your Entry Price in to a stock and track the percentage of gain or loss at the 5% and 10% markers.
Click on the gear settings icon and type in your entry price. The percentage is defaulted to 5%. You can change this to a different percentage at this screen. Note that whatever number you enter will be doubled for the upper and lower lines. For instance, if you want to set your first red line stop loss and green gain line at 2.5%, your two other upper and lower green and red lines will be at 5%.
However, this will not change the text on the tab marker.
To change the tab text, go in to the Pine Editor and change the green text that says "5% Gain" and "5% Loss" to your new percentages.
Drawdown VisualisationAn indicator that let's you visualize the current drawdown and maximum drawdown from an All-Time High
Moving Stop-Loss mechanism + alerts to MT4/MT5"How to code moving stop-loss mechanism", is one of the most often repeating questions in private messages I receive, so just to focus on this mechanism, I made a spin-off from my previous script: TradingView-Alerts-to-MT4-MT5-dynamic-variables-NON-REPAINTING .
The logic here moves the stop-loss each time a trade is running and a new pivot high/low is detected. When such event occurs (UpdateLongStopLoss or UpdateShortStopLoss), stoploss_long or stoploss_short mutable variable is modified. And it needs to be coded inside strategy.exit() line as "stop=stoploss_long" or "stop=stoploss_short". Entries are pretty straightforward - on Stoch crosses.
Last lines of the script show how to wrap information about such updates and send send alerts to MetaTrader via TradingConnector for execution in Forex/indices/commodities/crypto markets via MetaTrader. Please note that "tradeid=" variable must be passed with each alert, to let MetaTrader know which trade to modify. SLMOD, TPMOD are recently added commands, along with BE (as in "move stop-loss to breakeven" - but that's another topic).
Please disregard strategy backtest results, as this script is for coding education purposes only. However, it seems with the stop-loss mechanism enabled, the results are even better, than in original version of the script :)
Khair Day trade with profit lossBest used when applied for intraday trading. Users can customize length and deviation to fit their needs. Works best for high volatility stocks.
This strategy only works intraday intervals, so it means when you try to apply it to day/week/month it won't show any entry or exits.
Bollinger band breakout with non-standard deviation along with profit targets and stop loss.
There are 2 profit targets that can be adjusted based on individual preference.
This strategy minimizes risk and only opens trades when the probability of profitability is higher.
ATR Stop Loss FinderThis Indicator uses Average True Range (ATR) to determine a safe place to put stop losses to avoid being stop hunted or stopped out of a trade due to a tight stop loss. Default multiplier setting is 1.5. For a more conservative stop loss use 2 and for a tighter stop loss use 1. ATR and stop loss prices are displayed in table at bottom of screen. Use high(red) for shorts and low(teal) for longs.