Watermark, Date, Symbol & Timeframe [ANR Trades]" Watermark, Date, Symbol & Timeframe " is a simple yet powerful TradingView indicator designed to provide essential information directly on your trading charts.
Key Features:
- Add a watermark with a title and subtitle to your charts. Customize the position, colour, and size to suit your preferences.
- View the current date, symbol, and timeframe directly on your chart.
This indicator is essential for traders who frequently save or share their chart images publicly who would want to watermark their chart as well as make it easier to know when it was, what symbol and what timeframe it was on.
Сферы применения Pine
date & symbolHey y'all
If you are like me and you keep a record of your performance, adding date and symbol information will surely help you.
You can choose English or Spanish, and also choose between full or abbreviated date. If you want to see the day and if you want to see the symbol.
You can customize position, text size, text color, background.
Trend Fusion: ADX&EMA+IchimokuTrend Fusion: ADX & EMA+Ichimoku is an innovative indicator designed to provide traders with comprehensive insights into market trends. Combining the power of the Average Directional Index (ADX) with Exponential Moving Averages (EMA) and the Ichimoku Cloud, this indicator offers a sophisticated approach to trend analysis.
This indicator stands out for its unique integration of multiple trend-following indicators, offering traders a holistic view of market dynamics. Unlike traditional trend indicators that focus solely on price movements, Trend Fusion incorporates the ADX, EMA, and Ichimoku Cloud to provide a more nuanced understanding of trend strength and direction. By combining these indicators, traders can make more informed decisions and enhance their trading strategies.
How it works:
Trend Fusion generates buy and sell signals based on the convergence of these indicators. A combination of strong ADX readings, EMA crossovers, and alignment with the Ichimoku Cloud confirms trend direction and provides entry and exit points for traders.
Average Directional Index (ADX): Measures the strength of the prevailing trend by analyzing price movements. A rising ADX indicates a strengthening trend, while a falling ADX suggests weakening momentum.
Exponential Moving Averages (EMA): Detects potential trend reversals through crossover signals. A bullish crossover (fast EMA crossing above slow EMA) suggests an uptrend, while a bearish crossover indicates a downtrend.
Ichimoku Cloud: Provides support and resistance levels along with trend direction. Price movements above the cloud indicate bullish sentiment, while movements below the cloud suggest bearish sentiment.
How to use
Colour codes:
Green Candles: Represent a strong uptrend, indicating robust buying momentum. The intensity of green color deepens with increasing trend strength.
Red Candles: Indicate a strong downtrend, signaling significant selling pressure in the market. The intensity of red color deepens with increasing trend strength.
Yellow Candles: Suggest a weak trend, characterized by indecision and lack of clear direction. The intensity of yellow color varies based on the strength of the trend, with lighter shades indicating weaker trends and darker shades suggesting slightly stronger trends.
Trend Strength: Monitor the ADX to gauge the strength of the prevailing trend. Higher ADX values indicate stronger trends, while lower values suggest weaker trends.
Trend Direction: Confirm trend direction using EMA crossovers and Ichimoku Cloud signals. Look for bullish crossovers and price movements above the cloud for uptrends, and bearish crossovers and movements below the cloud for downtrends.
Entry and Exit Signals: Enter trades when all components align, signaling a strong trend. Use EMA crossovers and cloud confirmations to identify potential entry points, and consider exiting trades when these signals reverse.
The ADX calculation and signal logic are based on the ADX script by PineCoders, with modifications to integrate it into this indicator.
The EMA crossover logic is adapted from the GDAX EMA Cross script by stefano98.
The Ichimoku Cloud calculation and plotting are adapted from the Ichimoku Cloud script by lonesometheblue.
Trading involves risk, and past performance is not indicative of future results. It is recommended to use this indicator alongside other technical analysis tools and risk management strategies.
Futures Risk CalculatorThe "Futures Risk Calculator" is designed to assist traders in calculating the number of contracts to risk based on their account size, risk percentage, and stop loss level. This script provides a convenient way for traders to determine their position size in futures or other instruments where contracts are used.
The script prompts users to input their account size, risk percentage, entry price, and stop loss price. It then calculates the stop size in points, risk in dollars, and the number of contracts to risk. These calculations are based on standard risk management principles commonly used in trading.
The script plots the entry and stop loss lines on the chart for visual reference. Additionally, it displays a label in the top-right corner of the chart, showing the calculated number of contracts to risk. The label updates dynamically as the input values or market conditions change.
Originality and Usefulness:
This script is original and adds value to the TradingView community by providing traders with a practical tool for managing risk in their trading strategies. It is focusing on risk management, an essential aspect of successful trading.
By automating the calculation process, the script saves traders time and reduces the potential for manual errors. It encourages traders to adopt disciplined risk management practices, which are crucial for long-term profitability and capital preservation.
How to Use:
Input your account size, risk percentage, entry price, and stop loss price in the script settings.
Enter the pip size according to the instrument you are using (by default its's based for NASDAQ)
The script will automatically calculate the number of contracts to risk based on the provided inputs.
The entry and stop loss lines will be plotted on the chart for visual reference.
The calculated number of contracts to risk will be displayed in the top-right corner of the chart.
By following these steps, traders can effectively manage their risk exposure and make informed decisions when entering trades.
Speedometer RevisitedSpeedometer Revisited is a new way to draw custom metric speedometers and is intended to be a utility for other coders to use.
@rumpypumpydumpy originally introduced the Speedometer Toolkit in version 4 of Pine Script. Since then, Pine Script has been updated to version 5, introducing some amazing new features such as polylines and chart.points. This indicator is an example of what can be done with these newer features.
The indicator starts off with a handful of functions that will be used to create the drawings. Notes are left throughout the code explaining what each line of the functions does. My goal was to make these functions user-friendly and somewhat easy to understand. I then demonstrate two examples: one speedometer with five segments and another with three.
The first example demonstrates how to visually represent the analysts' ratings for a stock using the built-in syminfo.recommendations. The speedometer is divided into five segments, each representing a different level of analyst recommendation: strong sell, sell, hold, buy, and strong buy.
Each segment is drawn using a polyline from the createSeg function, with colors assigned as follows:
Red for 'Strong Sell'
Maroon for 'Sell'
Yellow for 'Hold'
Green for 'Buy'
Lime for 'Strong Buy'
The script identifies the maximum value among the analyst ratings, calculates the midpoint of the corresponding segment, and draws a needle pointing to this midpoint.
The second example employs the speedometer design to display market sentiment through the put-call ratio. The put-call ratio is a gauge of investor sentiment, where values above 1 indicate a bearish sentiment (more puts being bought relative to calls), and values below 1 suggest a bullish outlook (more calls being bought relative to puts).
The speedometer is divided into three segments, reflecting different ranges of the put-call ratio:
Red for a ratio greater than 1 (bearish sentiment)
Yellow for a ratio between 0.8 and 1 (neutral to bearish sentiment)
Lime for a ratio less than 0.8 (bullish sentiment)
Depending on the value of the put-call ratio, the script calculates which segment the current value falls into and determines the appropriate segment number. The script calculates the midpoint of the selected segment and draws a needle pointing to this value.
Both examples show how the speedometer can be used as a visual indicator of certain market conditions, helping traders quickly recognize trends and adjust their strategies accordingly.
A big thanks to @rumpypumpydumpy for his original Speedometer Toolbox. I hope this take on it can be useful for other coders.
Candlestick Patterns detection and backtester [TrendX_]INTRODUCTION:
The Candlestick Patterns detection and backtester is designed to empower traders by identifying and analyzing candlestick patterns. Leveraging the robust Pine Script's add-in “All Candlestick Patterns”, this indicator meticulously scans the market for candlestick formations, offering insights into potential market movements. With its backtesting capabilities, we evaluate historical data to present traders with performance metrics such as win rates, net profit, and profit factors for each pattern. This allows traders to make informed decisions based on empirical evidence. The customizable settings, including trend filters and exit conditions, provide a tailored experience, adapting to various trading styles and strategies.
CREDIT:
This indicator is powered by the Pinescript add-in, *All Candlestick Patterns*, which provides a comprehensive library of candlestick formations.
TABLE USAGE:
The indicator features a detailed usage table that presents backtested results of all candlestick patterns. This includes:
Win Rates: The percentage of trades that resulted in a profit.
Net Profit: The total profit after subtracting losses from gains.
Profit Factor: A measure of the indicator’s profitability (gross profit / gross loss).
Total Trades: The total number of trades taken for every candlestick pattern's appearance.
CHART CANDLESTICK USAGE:
The indicator integrates candlestick pattern detections directly into the chart, displaying:
Pattern Detections: Each detected pattern is marked on the chart.
Win Rates: The win rate of each pattern is shown in brackets next to the detection.
CHART SETTINGS:
Users can customize the indicator with a variety of trend filters and settings:
Trend Filters: Apply filters based on SMA50, SMA200, Supertrend, and RSI threshold to refine pattern detections.
Exit Condition: Set an exit condition based on the crossing of a simple moving average of customizable length.
Visibility: Choose to show or hide the candlestick patterns’ detections on the chart.
RSI EMA WMA (hieuhn)Indicator: RSI & EMA & WMA (14-9-45)
This indicator, named "RSI & EMA & WMA", is a versatile tool designed to provide insights into market momentum and trend strength by combining multiple technical indicators.
The Relative Strength Index (RSI) is a popular momentum oscillator used to measure the speed and change of price movements. In this indicator, RSI is plotted alongside its Exponential Moving Average (EMA) and Weighted Moving Average (WMA). EMA and WMA are smoothing techniques applied to RSI to help identify trends more clearly.
Key features of this indicator include:
RSI: The main RSI line is plotted on the chart, offering insights into overbought and oversold conditions.
EMA of RSI: The Exponential Moving Average of RSI smooths out short-term fluctuations, aiding in trend identification.
WMA of RSI: The Weighted Moving Average of RSI gives more weight to recent data points, providing a faster response to price changes.
Additionally, this indicator marks specific RSI levels considered as bullish and bearish trends, helping traders identify potential entry or exit points based on market sentiment.
By combining these technical indicators, traders can gain a comprehensive understanding of market dynamics, helping them make more informed trading decisions.
Futures Tick and Point Value TableDisplays a table in the upper right corner of the chart showing the tick and point value in USD.
Murrey Math
The Murrey Math indicator is a set of horizontal price levels, calculated from an algorithm developed by stock trader T.J. Murray.
The main concept behind Murrey Math is that prices tend to react and rotate at specific price levels. These levels are calculated by dividing the price range into fixed segments called "ranges", usually using a number of 8, 16, 32, 64, 128 or 256.
Murrey Math levels are calculated as follows:
1. A particular price range is taken, for example, 128.
2. Divide the current price by the range (128 in this example).
3. The result is rounded to the nearest whole number.
4. Multiply that whole number by the original range (128).
This results in the Murrey Math level closest to the current price. More Murrey levels are calculated and drawn by adding and subtracting multiples of the range to the initially calculated level.
Traders use Murrey Math levels as areas of possible support and resistance as it is believed that prices tend to react and pivot at these levels. They are also used to identify price patterns and possible entry and exit points in trading.
The Murrey Math indicator itself simply calculates and draws these horizontal levels on the price chart, allowing traders to easily visualize them and use them in their technical analysis.
HOW TO USE THIS INDICATOR?
To use the Murrey Math indicator effectively, here are some tips:
1. Choose the appropriate Murrey Math range : The Murrey Math range input (128 by default in the provided code) determines the spacing between the levels. Common ranges used are 8, 16, 32, 64, 128, and 256. A smaller range will give you more levels, while a larger range will give you fewer levels. Choose a range that suits the volatility and trading timeframe you're working with.
2. Identify potential support and resistance levels: The horizontal lines drawn by the indicator represent potential support and resistance levels based on the Murrey Math calculation. Prices often react or reverse at these levels, so they can be used to spot areas of interest for entries and exits.
3. Look for price reactions at the levels: Watch for price action like rejections, bounces, or breakouts at the Murrey Math levels. These reactions can signal potential trend continuation or reversal setups.
4. Trail stop-loss orders: You can place stop-loss orders just below/above the nearest Murrey Math level to manage risk if the price moves against your trade.
5. Set targets at future levels: Project potential profit targets by looking at upcoming Murrey Math levels in the direction of the trend.
7. Adjust range as needed: If prices are consistently breaking through levels without reacting, try adjusting the range input to a different value to see if it provides better levels.
In which asset can this indicator perform better?
The Murrey Math indicator can potentially perform well on any liquid financial asset that exhibits some degree of mean-reversion or trading range behavior. However, it may be more suitable for certain asset classes or trading timeframes than others.
Here are some assets and scenarios where the Murrey Math indicator can potentially perform better:
1. Forex Markets: The foreign exchange market is known for its ranging and mean-reverting nature, especially on higher timeframes like the daily or weekly charts. The Murrey Math levels can help identify potential support and resistance levels within these trading ranges.
2. Futures Markets: Futures contracts, such as those for commodities (e.g., crude oil, gold, etc.) or equity indices, often exhibit trading ranges and mean-reversion trends. The Murrey Math indicator can be useful in identifying potential turning points within these ranges.
3. Stocks with Range-bound Behavior: Some stocks, particularly those of large-cap companies, can trade within well-defined ranges for extended periods. The Murrey Math levels can help identify the boundaries of these ranges and potential reversal points.
4. I ntraday Trading: The Murrey Math indicator may be more effective on lower timeframes (e.g., 1-hour, 30-minute, 15-minute) for intraday trading, as prices tend to respect support and resistance levels more closely within shorter time periods.
5. Trending Markets: While the Murrey Math indicator is primarily designed for range-bound markets, it can also be used in trending markets to identify potential pullback or continuation levels.
1995-Present - Inflation and Purchasing PowerGood day, everyone! Today, we're going to look at a chart that's a bit different from the usual price charts we analyse. This isn't just any chart; it's a lens into the past, adjusted for the reality of inflation—a concept we often hear about but seldom see directly applied to our trading charts.
What we have here is an 'Inflation Adjusted Price' indicator on TradingView, and it's doing something quite special. It's showing us the price of our asset, let's say the S&P 500, not just in today's dollars, but in the dollars of 1995. Why 1995, you ask? Well, it's the starting point we've chosen to measure how much actual buying power has changed since then.
So, every point on this red line we see represents what the S&P 500's value would be if we stripped away the effects of inflation. This is the price in terms of what your money could actually buy you back in 1995.
As traders and investors, we're always looking at prices going up and thinking, 'Great! My investment is growing!' But the real question we should ask is, 'Is my money growing in real terms? Can it buy me more than it did last year, or five, ten, or twenty-five years ago?'
This chart tells us exactly that. If the red line is above the actual price, it means that the S&P 500 has not just grown in nominal terms, but it has actually outpaced inflation. Your investment has grown in real terms; it can buy you more now than it could back in 1995.
On the flip side, if the red line is below the actual price, that's a sign that while the nominal price might be up, the real value, the purchasing power, hasn't grown as much or could even have fallen.
This view is crucial, especially for the long-term investors among us. It gives us a reality check on our investments and savings. Are we truly growing our wealth, or are we just keeping up with the cost of living? This indicator answers that.
Remember, the true measure of financial growth is not just the numbers on a chart. It's what you can do with those numbers—how much bread, or eggs, or yes, even houses, you can buy with your hard-earned money
BTC Purchasing Power 2009-20XX! Hello, today I'm going to show you something that shifts our perspective on Bitcoin's value, not just in nominal terms, but adjusted for the real buying power over the years. This Pine Script TAS developed for TradingView does exactly that by taking into account inflation rates from 2009 to the present.
As you know, inflation erodes the purchasing power of money. That $100 in 2009 does not buy you the same amount in goods or services today. The same concept applies to Bitcoin. While we often look at its price in terms of dollars, pounds, or euros, it's crucial to understand what that price really means in terms of purchasing power.
What this script does is adjust the price of Bitcoin for cumulative inflation since 2009, allowing us to see not just how the nominal price has changed, but how its value as a means of purchasing goods and services has evolved.
For example, if we see Bitcoin's price at $60,000 today, that number might seem high compared to its early years. However, when we adjust this price for inflation, we might find that in terms of 2009's purchasing power, the effective price might be somewhat lower. This adjusted price gives us a more accurate reflection of Bitcoin's true value over time.
This script plots two lines on the chart:
The Original BTC Price: This is the unadjusted price of Bitcoin as we typically see it.
BTC Purchasing Power: This line shows Bitcoin's price adjusted for inflation, reflecting how many goods or services Bitcoin could buy at that point in time compared to 2009.
By comparing these lines, we can observe periods where Bitcoin's purchasing power significantly increased, even if the nominal price was not at its peak. This can help us identify moments when Bitcoin was undervalued or overvalued in real terms.
This analysis is crucial for long-term investors and traders who want to understand Bitcoin's value beyond the surface-level price movements. It helps us appreciate Bitcoin's potential as a store of value, especially in contexts where traditional currencies are losing purchasing power due to inflation.
Remember, investing is not just about riding price waves; it's about understanding the underlying value. And that's precisely what this script helps us to uncover
Vertical line at 8 AMThis indicator plots a blue vertical line on the chart when it's 8 AM, providing a clear visual reference of this time point on the TradingView chart.
Gradient Candles
The Gradient Candles indicator is crafted to be a comprehensive replacement for default candlesticks, offering users an enhanced and visually stunning alternative. To experience the intended results and fully immerse in the distinctive features of Gradient Candles, it's recommended to hide the default candlesticks. This ensures that traders can fully appreciate the unique color gradient and dynamic visual representation that this indicator brings to chart analysis.
Designed to elevate chart analysis, Gradient Candles not only offer a fresh perspective on price movements but also captivate users with their visually appealing representation of market dynamics. Departing from traditional candlestick coloration, the dynamic adaptation of colors, the 'color.from_gradient()' function plays a pivotal role in translating the current source value into a color that reflects its proximity to the highest and lowest values and corresponding colors. Beyond its analytical capabilities, Gradient Candles transform market analysis into an aesthetically enriching experience, providing traders with a unique and comprehensive tool for their technical analysis toolkit.
Traders can tailor the indicator's appearance to suit their preferences and seamlessly integrate it into their personal trading environment. From color inversion to transparency adjustments and the option to fill candles instead of outlining them, the customization features empower users to create a visual representation that aligns precisely with their unique preferences.
Trend Deviation strategy - BTC [IkkeOmar]Intro:
This is an example if anyone needs a push to get started with making strategies in pine script. This is an example on BTC, obviously it isn't a good strategy, and I wouldn't share my own good strategies because of alpha decay.
This strategy integrates several technical indicators to determine market trends and potential trade setups. These indicators include:
Directional Movement Index (DMI)
Bollinger Bands (BB)
Schaff Trend Cycle (STC)
Moving Average Convergence Divergence (MACD)
Momentum Indicator
Aroon Indicator
Supertrend Indicator
Relative Strength Index (RSI)
Exponential Moving Average (EMA)
Volume Weighted Average Price (VWAP)
It's crucial for you guys to understand the strengths and weaknesses of each indicator and identify synergies between them to improve the strategy's effectiveness.
Indicator Settings:
DMI (Directional Movement Index):
Length: This parameter determines the number of bars used in calculating the DMI. A higher length may provide smoother results but might lag behind the actual price action.
Bollinger Bands:
Length: This parameter specifies the number of bars used to calculate the moving average for the Bollinger Bands. A longer length results in a smoother average but might lag behind the price action.
Multiplier: The multiplier determines the width of the Bollinger Bands. It scales the standard deviation of the price data. A higher multiplier leads to wider bands, indicating increased volatility, while a lower multiplier results in narrower bands, suggesting decreased volatility.
Schaff Trend Cycle (STC):
Length: This parameter defines the length of the STC calculation. A longer length may result in smoother but slower-moving signals.
Fast Length: Specifies the length of the fast moving average component in the STC calculation.
Slow Length: Specifies the length of the slow moving average component in the STC calculation.
MACD (Moving Average Convergence Divergence):
Fast Length: Determines the number of bars used to calculate the fast EMA (Exponential Moving Average) in the MACD.
Slow Length: Specifies the number of bars used to calculate the slow EMA in the MACD.
Signal Length: Defines the number of bars used to calculate the signal line, which is typically an EMA of the MACD line.
Momentum Indicator:
Length: This parameter sets the number of bars over which momentum is calculated. A longer length may provide smoother momentum readings but might lag behind significant price changes.
Aroon Indicator:
Length: Specifies the number of bars over which the Aroon indicator calculates its values. A longer length may result in smoother Aroon readings but might lag behind significant market movements.
Supertrend Indicator:
Trendline Length: Determines the length of the period used in the Supertrend calculation. A longer length results in a smoother trendline but might lag behind recent price changes.
Trendline Factor: Specifies the multiplier used in calculating the trendline. It affects the sensitivity of the indicator to price changes.
RSI (Relative Strength Index):
Length: This parameter sets the number of bars over which RSI calculates its values. A longer length may result in smoother RSI readings but might lag behind significant price changes.
EMA (Exponential Moving Average):
Fast EMA: Specifies the number of bars used to calculate the fast EMA. A shorter period results in a more responsive EMA to recent price changes.
Slow EMA: Determines the number of bars used to calculate the slow EMA. A longer period results in a smoother EMA but might lag behind recent price changes.
VWAP (Volume Weighted Average Price):
Default settings are typically used for VWAP calculations, which consider the volume traded at each price level over a specific period. This indicator provides insights into the average price weighted by trading volume.
backtest range and rules:
You can specify the start date for backtesting purposes.
You can can select the desired trade direction: Long, Short, or Both.
Entry and Exit Conditions:
LONG:
DMI Cross Up: The Directional Movement Index (DMI) indicates a bullish trend when the positive directional movement (+DI) crosses above the negative directional movement (-DI).
Bollinger Bands (BB): The price is below the upper Bollinger Band, indicating a potential reversal from the upper band.
Momentum Indicator: Momentum is positive, suggesting increasing buying pressure.
MACD (Moving Average Convergence Divergence): The MACD line is above the signal line, indicating bullish momentum.
Supertrend Indicator: The Supertrend indicator signals an uptrend.
Schaff Trend Cycle (STC): The STC indicates a bullish trend.
Aroon Indicator: The Aroon indicator signals a bullish trend or crossover.
When all these conditions are met simultaneously, the strategy considers it a favorable opportunity to enter a long trade.
SHORT:
DMI Cross Down: The Directional Movement Index (DMI) indicates a bearish trend when the negative directional movement (-DI) crosses above the positive directional movement (+DI).
Bollinger Bands (BB): The price is above the lower Bollinger Band, suggesting a potential reversal from the lower band.
Momentum Indicator: Momentum is negative, indicating increasing selling pressure.
MACD (Moving Average Convergence Divergence): The MACD line is below the signal line, signaling bearish momentum.
Supertrend Indicator: The Supertrend indicator signals a downtrend.
Schaff Trend Cycle (STC): The STC indicates a bearish trend.
Aroon Indicator: The Aroon indicator signals a bearish trend or crossover.
When all these conditions align, the strategy considers it an opportune moment to enter a short trade.
Disclaimer:
THIS ISN'T AN OPTIMAL STRATEGY AT ALL! It was just an old project from when I started learning pine script!
The backtest doesn't promise the same results in the future, always do both in-sample and out-of-sample testing when backtesting a strategy. And make sure you forward test it as well before implementing it!
Furthermore this strategy uses both trend and mean-reversion systems, that is usually a no-go if you want to build robust trend systems .
Don't hesitate to comment if you have any questions or if you have some good notes for a beginner.
Aroon and ASH strategy - ETHERIUM [IkkeOmar]Intro:
This post introduces a Pine Script strategy, as an example if anyone needs a push to get started. This example is a strategy on ETH, obviously it isn't a good strategy, and I wouldn't share my own good strategies because of alpha decay. This strategy combines two technical indicators: Aroon and Absolute Strength Histogram (ASH).
Overview:
The strategy employs the Aroon indicator alongside the Absolute Strength Histogram (ASH) to determine market trends and potential trade setups. Aroon helps identify the strength and direction of a trend, while ASH provides insights into the strength of momentum. By combining these indicators, the strategy aims to capture profitable trading opportunities in Ethereum markets. Normally when developing strats using indicators, you want to find some good indicators, but you NEED to understand their strengths and weaknesses, other indicators can be incorporated to minimize the downs of another indicator. Try to look for synergy in your indicators!
Indicator settings:
Aroon Indicator:
- Two sets of parameters are used for the Aroon indicator:
- For Long Positions: Aroon periods are set to 56 (upper) and 20 (lower).
- For Short Positions: Aroon periods are set to 17 (upper) and 55 (lower).
Absolute Strength Histogram (ASH):
ASH is calculated with a length of 9 bars using the closing price as the data source.
Trading Conditions:
The strategy incorporates specific conditions to initiate and exit trades:
Start Date:
Traders can specify the start date for backtesting purposes.
Trade Direction:
Traders can select the desired trade direction: Long, Short, or Both.
Entry and Exit Conditions:
1. Long Position Entry: A long position is initiated when the Aroon indicator crosses over (crossover) the lower Aroon threshold, indicating a potential uptrend.
2. Long Position Exit: A long position is closed when the Aroon indicator crosses under (crossunder) the lower Aroon threshold.
3. Short Position Entry: A short position is initiated when the Aroon indicator crosses under (crossunder) the upper Aroon threshold, signaling a potential downtrend.
4. Short Position Exit: A short position is closed when the Aroon indicator crosses over (crossover) the upper Aroon threshold.
Disclaimer:
THIS ISN'T AN OPTIMAL STRATEGY AT ALL! It was just an old project from when I started learning pine script!
The backtest doesn't promise the same results in the future, always do both in-sample and out-of-sample testing when backtesting a strategy. And make sure you forward test it as well before implementing it!
[KVA] Custom Sessions Custom Sessions: Multi-Timeframe Analysis & Key Level Insights
Introduction:
Introducing " Custom Sessions," an innovative Pine Script indicator meticulously crafted to empower traders by offering an advanced level of analysis on various global trading sessions. This tool is designed not just to highlight trading sessions but to delve deeper into the nuances of market movements by analyzing candlestick behavior within those sessions, offering a nuanced view of market trends, liquidity, and potential turning points.
Core Features :
Session Customization : Tailor trading sessions to align with your strategy, focusing on the markets that matter most to you. Whether it's London, New York, Tokyo, Sydney, or Frankfurt, you have the control.
Enhanced Market Insight : Beyond session timing, gain a refined understanding of market dynamics through detailed candlestick analysis within each session, providing a granular view of price action.
Comprehensive Analysis Tools : Alongside session analysis, the indicator includes features like VWAP (Volume Weighted Average Price) and Fibonacci retracement levels, offering a multifaceted approach to market analysis across chosen timeframes.
VWAP : Gain insights into the market's trend and liquidity by viewing the Volume Weighted Average Price calculated for the custom timeframe.
Fibonacci Retracement Levels : Easily identify potential reversal points with automatically plotted Fibonacci levels at 0.236, 0.382, 0.5, 0.618, and 0.782for each candle
Real-Time Updates : As the market moves, so does " Custom Sessions," offering real-time insights that adapt to the unfolding market conditions.
Utilization Guide :
Configure Your Sessions : Begin by setting up the sessions that are most relevant to your trading approach, customizing their times as needed.
Select the Desired Timeframe : Input your preferred higher timeframe to analyze data that is most relevant to your trading strategy.
Dive into the Details : Use the detailed candlestick analysis within sessions to pinpoint potential entry and exit points, supported by VWAP and Fibonacci levels for deeper market insight.
Customize Your View : Adjust the visual aspects of the indicator, including session color coding and which elements to display, tailoring the tool to your preferences.
Acknowledgements :
A special thanks to Aurocks_AIF for their foundational work on "Sessions on Chart" . This project has been an invaluable resource, inspiring the development of " Custom Sessions" and pushing the boundaries of traditional session analysis.
Final Thoughts :
" Custom Sessions" is more than just an indicator; it's a comprehensive analysis tool that brings a new depth to the understanding of market sessions. By offering detailed insights into the behavior of candles within these sessions, along with essential analysis features, this indicator is a must-have for traders seeking to enhance their technical analysis arsenal.
Whether you're a day trader looking to capture short-term movements or a long-term investor seeking broader market insights, this indicator offers valuable data visualization to enhance your trading decisions. By integrating highs, lows, VWAP, and Fibonacci levels into your analysis, you gain a comprehensive view of market behavior across different timeframes and sessions
Daily Chess Puzzles [LuxAlgo]Play Chess Puzzles right on your Chart!
Daily Chess Puzzles brings you a new 1-Move chess puzzle straight to your chart every day.
🔶 USAGE
Submit your answer to see if your solution is correct! For quick access to the settings, Double-Click on the Chess board to open the settings interface.
The current active color (Who's move it is) is represented by the color of the information bar, and the corner board squares.
This game uses long algebraic notation without pieces names for submitting moves.
This method for determining moves is perfect for simplicity and clarity, and is standard for the Universal Chess Interface (UCI).
🔹 How to Notate
Long algebraic notation (without pieces name) is simple to understand. This notation does not use capture symbols or check/checkmate symbols; it uses only the squares involved in the move and any promotion occurring.
{Starting Square}{Ending Square}{Promotion Piece(if needed)}
Locate the starting square and the ending square of the piece being moved, without mentioning the piece itself.
Identify the column letters (a-h) and row numbers (1-8) that align with your desired move.
If a pawn reaches the opposite end of the board the pawn gets promoted, add the letter representing the piece it is promoted to at the end of the move.
Put it all together and you've got your notation!
Piece Notations for Pawn Promotions:
'n' for Knight ('k' is reserved for the King in chess notation)
'b' for Bishop
'r' for Rook
'q' for Queen
Normal Move Example: Moving a piece from e2 to e4 is notated as "e2e4".
Pawn Promotion Example: Promoting a pawn to a queen is notated as "e7e8q".
🔶 DETAILS
Miss a day? Yesterday's puzzle can be re-played, check the box for 'View Yesterday's Puzzle' in the settings.
This indicator makes use of Tooltips! . Hover over a square to see that square's notation.
This script makes use of 5 libraries, each storing 2 years worth of daily chess puzzles amounting to 10 years of unique daily chess puzzles.
"timenow" is used to determine which day it is, so even on a closed ticker or weekend or holiday a new chess puzzle will be displayed.
Users have the option to choose from 5 different board themes.
Unbiased Replay CompanionWhen using bar replay mode on TradingView, you have to scroll your way back through clearly visible price history, which always leaves you with unwanted lookahead bias because you unfortunately see all future price movements before they are hidden by the use of the scissors tool.
This indicator provides a simple way to hide all the price action and displays a configurable bar counter instead, allowing you to scroll back to every moment in history without seeing any of the prices' movements. The bar counter hereby serves as a visual aid to guide you back to the very first available bar on the chart.
You can configure the color of the overlay to match your charts' background as well as the style of the bar counter and the distance at which the counter is being displayed.
The indicator crops the vertical price scale by a random amount (only when it is being displayed) to also prevent you from having any unwanted bias based on the current price range.
Whenever you're done scrolling and have used the replay scissors tool to start your session just hide the indicator and bring it up again when you need to scroll. That's all there is to it.
Important: After you apply the indicator to your charts, make sure it is displayed in front of everything else. You can configure this by clicking on the three dots that are displayed on the right side of the indicator name on hover and choose "Visual order > Bring to front" from the popup menu that appears.
Enjoy your unbiased backtesting sessions!
Word PuzzleWord Puzzle is a PineScript-based clone of the popular daily puzzle game called "Wordle".
It is not identical, but the general gameplay is the same.
>How It works (The Game)
A secret word (also referred to as the "target word") is randomly selected from a database of 5 Letter words.
The player/user's goal is to guess that word within 6 attempts.
After each guess, the script provides information to the user by color coding the letters of their guess.
Green (Known Letters): These letters are in the exact spot that they occur in the target word.
Yellow (Included Letters): These letters are included in the target word; however, the user does not have them in the correct position.
Gray (Un-used Letters): These letters do not occur anywhere in the target word
>Interface
On each turn the user will input their 5 letter guess into the "Guess #" box and submit it by checking the check-box next to the word.
If the input word is invalid, the script will prompt you. Invalid words are any words not found within the script's valid word list.
After guess 3, hints may be viewed by hovering over the "Need a Hint" box on the display.
If you are unable to guess the word in the given amount of guesses, the 'Game Over' screen will display, and you will be able to view the answer in the same box as the hints.
To start a new game, clear all inputs and insert a different number into the "Puzzle Seed" input, to have the script randomly select a new word.
NOTE: Word selection based on the seed number is deterministic, the same seed number will always have the same puzzle word.
>Additional Information
The script comes equipped with 5 different themes as seen below.
Table size is also selectable.
This indicator makes use of 'tooltips'.
Hover over the boxes on the table for quick reference information or additional information on prompts.
Since the script randomly selects from the ENTIRE valid word list you are bound to come across some obscure words with strange spellings.
Because of this, I have built in a "quick way out".
To end a game without filling out all guesses, submit the answer "Give Up" to skip to the end screen where you can reveal the puzzle's answer.
Afterwards, take a second to look up the definition! Ever heard of a xylyl?!
The code is fully notated. Most of the script involves string management, but there are still some neat tricks in here as well.
Enjoy!
Machine Learning Cross-Validation Split & Batch HighlighterThis indicator is designed for traders and analysts who employ Machine Learning (ML) techniques for cross-validation in financial markets.
The script visually segments a selected range of historical price data into splits and batches, helping in the assessment of model performance over different market conditions.
User
Theory
In ML, cross-validation is a technique to assess the generalizability of a model, typically by partitioning the data into a set of "folds" or "splits." Each split acts as a validation set, while the others form the training set. This script takes a unique approach by considering the sequential nature of financial time series data, where random shuffling of data (as in traditional cross-validation) can disrupt the temporal order, leading to misleading results.
Chronological Integrity of Splits
Even if the order of the splits is shuffled for cross-validation purposes, the data within each split remains in its original chronological sequence. This feature is crucial for time series analysis, as it respects the inherent order-dependency of financial markets. Thus, each split can be considered a microcosm of market behavior, maintaining the integrity of trends, cycles, and patterns that could be disrupted by random sampling.
The script allows users to define the number of splits and the size of each batch within a split. By doing so, it maintains the chronological sequence of the data, ensuring that the validation set is representative of a future time period that the model would predict.
www.tradingview.com
Parameters
Number of Splits: Defines how many segments the selected data range will be divided into. Each split serves as a standalone testing ground for the ML model. (Up to 24)
Batch Size: Determines the number of bars (candles) in each batch within a split. Smaller batches can help pinpoint overfitting at a finer granularity.
Start Index: The bar index from where the historical data range begins. It sets the starting point for data analysis.
End Index: The bar index where the historical data range ends. It marks the cutoff for data to be included in the model assessment.
Usage
To use this script effectively:
1 - Input the Start Index and End Index to define the historical data range you wish to analyze.
2 - Adjust the Number of Splits to create multiple validation sets for cross-validation.
3 - Set the Batch Size to control the granularity of each validation set within the splits.
4 - The script will highlight the background of each batch within the splits using alternating shades, allowing for a clear visual distinction of the data segmentation.
By maintaining the temporal sequence and allowing for adjustable granularity, the "ML Split and Batch Highlighter" aids in creating a robust validation framework for time series forecasting models in finance.
Backtest any Indicator v5Happy Trade,
here you get the opportunity to backtest any of your indicators like a strategy without converting them into a strategy. You can choose to go long or go short and detailed time filters. Further more you can set the take profit and stop loss, initial capital, quantity per trade and set the exchange fees. You get an overall result table and even a detailed, scroll-able table with all trades. In the Image 1 you see the provided info tables about all Trades and the Result Summary. Further more every trade is marked by a background color, Labels and Levels. An opening Label with the trade direction and trade number. A closing Label again with the trade number, the trades profit in % and the total amount of $ after all past trades. A green line for the take profit level and a red line for the stop loss.
Image 1
Example
For this description we choose the Stochastic RSI indicator from TradingView as it is. In Image 2 is shown the performance of it with decent settings.
Timeframe=45, BTCUSD, 2023-08-01 - 2023-10-20
Stoch RSI: k=30, d=40, RSI-length=140, stoch-length=140
Backtest any Indicator: input signal=Stoch RSI, goLong, take profit=9.1%, stop loss=2.5%, start capital=1000$, qty=5%, fee=0.1%, no Session Filter
Image 2
Usage
1) You need to know the name of the boolean (or integer) variable of your indicator which hold the buy condition. Lets say that this boolean variable is called BUY. If this BUY variable is not plotted on the chart you simply add the following code line at the end of your pine script.
For boolean (true/false) BUY variables use this:
plot(BUY ? 1:0,'Your buy condition hold in that variable BUY',display = display.data_window)
And in case your script's BUY variable is an integer or float then use instate the following code line:
plot(BUY ,'Your buy condition hold in that variable BUY',display = display.data_window)
2) Probably the name of this BUY variable in your indicator is not BUY. Simply replace in the code line above the BUY with the name of your script's trade condition variable.
3) Save your changed Indicator script.
4) Then add this 'Backtest any Indicator' script to the chart ...
5) and go to the settings of it. Choose under "Settings -> Buy Signal" your Indicator. So in the example above choose .
The form is usually: ' : BUY'. Then you see something like Image 2
6) Decide which trade direction the BUY signal should trigger. A go Long or a go Short by set the hook or not.
Now you have a backtest of your Indicator without converting it into a strategy. You may change the setting of your Indicator to the best results and setup the following strategy settings like Time- and Session Filter, Stop Loss, Take Profit etc. More of it below in the section Settings Menu.
Appereance
In the Image 2 you see on the right side the List of Trades . To scroll down you go into the settings again and decrease the scroll value. So you can see all trades that have happened before. In case there is an open trade you will find it at the last position of the list.
Every Long trade is green back grounded while Short trades are red.
Every trade begins with a label that show goLong or goShort and its number. And ends with another label again with its number, Profit in % and the resulting total amount of cash.
If activated you further see the Take Profit as a green line and the Stop Loss as a orange line. In the settings you can set their percentage above or below the entry price.
You also see the Result Summary below. Here you find the usual stats of a strategy of all closed trades. The profit after total amount of fees , amount of trades, Profit Factor and the total amount of fees .
Settings Menu
In the settings menu you will find the following high-lighted sections. Most of the settings have a question mark on their right side. Move over it with the cursor to read specific explanation.
Input Signal of your Indicator: Under Buy you set the trade signal of your Indicator. And under Target you set the value when a trade should happen. In the Example with the Stochastic RSI above we used 20. Below you can set the trade direction, let it be go short when hooked or go long when unhooked.
Trade Settings & List of Trades: Take Profit set the target price of any trade. Stop Loss set the price to step out when a trade goes the wrong direction. Check mark the List of Trades to see any single trade with their stats. In case that there are more trades as fits in the list you can scroll down the list by decrease the value Scroll .
Time Filter: You can set a Start Time or deactivate it by leave it unhooked. The same with End Time .
Session Filter: here you can choose to activate it on weekly base. Which days of the week should be trading and those without. And also on daily base from which time on and until trade are possible. Outside of all times and sessions there will be no new trades if activated.
Invest Settings: here you can choose the amount of cash to start with. The Quantity percentage define for every trade how much of the cash should be invested and the Fee percentage which have to be payed every trade. Open position and closing position.
Other Announcements
This Backtest script don't use the strategy functions of TradingView. It is programmed as an indicator. All trades get executed at candle closing. This script use the functionality "Indicator-on-Indicator" from TradingView.
Conclusion
So now it is your turn, take your promising indicators and connect it to that Backtest script. With it you get a fast impression of how successful your indicator will trade. You don't have to relay on coders who maybe add cheating code lines. Further more you can check with the Time Filter under which market condition you indicator perform the best or not so well. Also with the Session Filter you can sort out repeating good market conditions for your indicator. Even you can check with the GoShort XOR GoLong check mark the trade signals of you indicator in opposite trade direction with one click. And compare your indicators under the same conditions and get the results just after 2 clicks. Thanks to the in-build fee setting you get an impression how much a 0.1% fee cost you in total.
Cheers
Position TrackerUse this tool to plot a trading position on the chart, using the guided confirmation prompts after adding to the chart.
To use this tool, after adding to the chart it will prompt for entry and exit time and entry price selection which will require using a mouse or touch screen to complete the action; the prompts appear at the bottom of the chart and are a blue bubble/box looking object :)
It will provide a readout of the live profit and loss, run-up and drawdown of a trade as well as present notes if added.
Visuals provide an easy look at periods of drawdown, and a anchored vwap is included as a simple guide for trade management.
Setting the symbol will allow many instances of the tool on the same layout and each instance will hide it's display while not on the matching symbol chart.
Once the end time for the trade is met, the label with trade breakdown thoughtfully moves away from active price and can be seen by scrolling to trade entry area.
If there's enough interest I will add some additional features but wanted to start simple. Or feel free to copy and make it your own!
Thanks and happy trading.