RSI TrueLevel StrategyThis strategy is a momentum-based strategy that uses the Relative Strength Index (RSI) indicator and a TrueLevel envelope to generate trade signals.
The strategy uses user-defined input parameters to calculate TrueLevel envelopes for 14 different lengths. The TrueLevel envelope is a volatility-based technical indicator that consists of upper and lower bands. The upper band is calculated by adding a multiple of the standard deviation to a linear regression line of the price data, while the lower band is calculated by subtracting a multiple of the standard deviation from the same regression line.
The strategy generates long signals when the RSI crosses above the oversold level or when the price crosses above the selected lower band of the TrueLevel envelope. It generates short signals when the RSI crosses below the overbought level or when the price crosses below the selected upper band of the TrueLevel envelope.
The strategy allows for long and short trades and sets the trade size as a percentage of the account equity. The colors of the bands and fills are also customizable through user-defined input parameters.
In this strategy, the 12th TrueLevel band was chosen due to its ability to capture significant price movements while still providing a reasonable level of noise reduction. The strategy utilizes a total of 14 TrueLevel bands, each with varying lengths. The 12th band, with a length of 2646, strikes a balance between sensitivity to market changes and reducing false signals, making it a suitable choice for this strategy.
RSI Parameters:
In this strategy, the RSI overbought and oversold levels are set at 65 and 40, respectively. These values were chosen to filter out more noise in the market and focus on stronger trends. Traditional RSI overbought and oversold levels are set at 70 and 30, respectively. By raising the oversold level and lowering the overbought level, the strategy aims to identify more significant trend reversals and potential trade opportunities.
Of course, the parameters can be adjusted to suit individual preferences.
Indicators and strategies
Chandelier Exit ZLSMA StrategyIntroducing a Powerful Trading Indicator: Chandelier Exit with ZLSMA
If you're a trader, you know the importance of having the right tools and indicators to make informed decisions. That's why we're excited to introduce a powerful new trading indicator that combines the Chandelier Exit and ZLSMA: two widely-used and effective indicators for technical analysis.
The Chandelier Exit (CE) is a popular trailing stop-loss indicator developed by Chuck LeBeau. It's designed to follow the price trend of a security and provide an exit signal when the price crosses below the CE line. The CE line is based on the Average True Range (ATR), which is a measure of volatility. This means that the CE line adjusts to the volatility of the security, making it a reliable indicator for trailing stop-losses.
The ZLEMA (Zero Lag Exponential Moving Average) is a type of exponential moving average that's designed to reduce lag and improve signal accuracy. The ZLSMA takes into account not only the current price but also past prices, using a weighted formula to calculate the moving average. This makes it a smoother indicator than traditional moving averages, and less prone to giving false signals.
When combined, the CE and ZLSMA create a powerful indicator that can help traders identify trend changes and make more informed trading decisions. The CE provides the trailing stop-loss signal, while the ZLSMA provides a smoother trend line to help identify potential entry and exit points.
In our indicator, the CE and ZLSMA are plotted together on the chart, making it easy to see both the trailing stop-loss and the trend line at the same time. The CE line is displayed as a dotted line, while the ZLSMA line is displayed as a solid line.
Using this indicator, traders can set their stop-loss levels based on the CE line, while also using the ZLSMA line to identify potential entry and exit points. The combination of these two indicators can help traders reduce their risk and improve their trading performance.
In conclusion, the Chandelier Exit with ZLSMA is a powerful trading indicator that combines two effective technical analysis tools. By using this indicator, traders can identify trend changes, set stop-loss levels, and make more informed trading decisions. Try it out for yourself and see how it can improve your trading performance.
Warning: The results in the backtest are from a repainting strategy. Don't take them seriously. You need to do a dry live test in order to test it for its useability.
-
Here is a description of each input field in the provided source code:
length: An integer input used as the period for the ATR (Average True Range) calculation. Default value is 1.
mult: A float input used as a multiplier for the ATR value. Default value is 2.
showLabels: A boolean input that determines whether to display buy/sell labels on the chart. Default value is false.
isSignalLabelEnabled: A boolean input that determines whether to display signal labels on the chart. Default value is true.
useClose: A boolean input that determines whether to use the close price for extrema calculations. Default value is true.
zcolorchange: A boolean input that determines whether to enable rising/decreasing highlighting for the ZLSMA (Zero-Lag Exponential Moving Average) line. Default value is false.
zlsmaLength: An integer input used as the length for the ZLSMA calculation. Default value is 50.
offset: An integer input used as an offset for the ZLSMA calculation. Default value is 0.
-
Ty for checking this out and good luck on your trading journey! Likes and comments are appreciated. 👍
--
Credits to:
▪ @everget – Chandelier Exit (CE)
▪ @netweaver2022 – ZLSMA
Strategy Creator5 indicators. Backtesting available. Uses ADX, RSI, Stochastic, MACD, and crossing EMAs (1,2, or 3). This strategy creator allows you to turn on or off these indicators and adjust the parameters for each indicator. It allows you to make one trade at a time e.g the next trade doesn't open until the last one closes. (You are also able to enter how many trades in one direction you want for example if you want only 2 long trades in a row, then the strategy waits for the next short position without making anymore long trades. Once there are 2 short positions in a row, it waits for a long position). The code can be edited to for automated trading by editing the comment in the source code for the strategy parameters. This took many hours to finish. ENJOY.
Break even stop loss (% of instrument price)Simply proof of concept to place a stop loss a percentage below entry price and move it to break even if the price moves the same percentage above the entre price.
SuperTrend Long Strategy +TrendFilterThis strategy aims to identify long (buy) opportunities in the market using the SuperTrend indicator. It utilizes the Average True Range (ATR) and a multiplier to determine the dynamic support levels for entering long positions. This presentation will provide an overview of the strategy's components, explain its usage, and highlight that it focuses on long trades.
Components of the Strategy:
1. ATR Period: This input determines the period used for calculating the Average True Range (ATR). A higher value may result in smoother trend lines but may lag behind recent price changes.
2. Source (src): This input determines the price source used for calculations, with "hl2" (the average of high and low prices) set as the default.
3. ATR Multiplier: This input specifies the multiplier applied to the ATR value to determine the distance of the support levels from the source.
4. Change ATR Calculation Method: This input allows toggling between two methods of ATR calculation: the default method using atr() or a simple moving average (SMA) of ATR values (sma(tr, Periods)).
5. Show Buy/Sell Signals: This input enables or disables the display of buy and sell signals on the chart.
6. Highlighter On/Off: This input controls whether highlighting of up and down trends is displayed on the chart.
7. Bar Coloring On/Off: This input determines whether the bars on the chart are colored based on the trend direction.
8. The "SuperTrend Long STRATEGY" has been enhanced by incorporating a trend filter. A moving average is used as the filter to confirm the prevailing trend before executing trades. This addition effectively reduces false signals and improves the strategy's reliability, all while maintaining its original name.
Strategy Logic:
1. The strategy calculates the upper (up) and lower (dn) trend lines based on the ATR value and the chosen multiplier.
2. The trend variable keeps track of the current trend, with 1 indicating an uptrend and -1 indicating a downtrend.
3. Buy and sell signals are generated based on the change in trend direction.
4. The strategy includes an optional highlighting feature that colors the chart background based on the current trend.
5. Additionally, the bar coloring feature colors the bars based on the direction of the last trend change.
Usage:
1. ATR Period and ATR Multiplier can be adjusted based on the desired sensitivity and risk tolerance.
2. Buy and sell signals can be displayed using the Show Buy/Sell Signals input, providing clear indications of entry and exit points.
3. The Highlighter On/Off input allows users to visually identify the prevailing trend by coloring the chart background.
4. The Bar Coloring On/Off input offers a quick visual reference for the most recent trend change.
Long Strategy:
The SuperTrend Long Strategy is specifically designed to identify long (buy) opportunities. It generates buy signals when the current trend changes from a downtrend to an uptrend, indicating a potential entry point for long positions. The strategy aims to capture upward price movements and maximize profits during bullish market conditions.
The SuperTrend Long Strategy provides traders with a systematic approach to identifying long trade opportunities. By leveraging the SuperTrend indicator and dynamic support levels, this strategy aims to generate buy signals in uptrending markets. Traders can customize the inputs and utilize the visual features to adapt the strategy to their specific trading preferences.
The modification adds a trend filter to the "SuperTrend Long STRATEGY" to improve its effectiveness. The trend filter uses a moving average to confirm the prevailing trend before taking trades. This addition helps filter out false signals and enhances the strategy's reliability without changing its name.
Slight Swing Momentum Strategy.Introduction:
The Swing Momentum Strategy is a quantitative trading strategy designed to capture mid-term opportunities in the financial markets by combining swing trading principles with momentum indicators. It utilizes a combination of technical indicators, including moving averages, crossover signals, and volume analysis, to generate buy and sell signals. The strategy aims to identify market trends and capitalize on price momentum for profit generation.
Highlights:
The strategy offers several key highlights that make it unique and potentially attractive to traders:
Swing Trading with Momentum: The strategy combines the principles of swing trading, which aim to capture short-to-medium-term price swings, with momentum indicators that help identify strong price trends and potential breakout opportunities.
Technical Indicator Optimization: The strategy utilizes a selection of optimized technical indicators, including moving averages and crossover signals, to filter out the noise and focus on high-probability trading setups. This optimization enhances the strategy's ability to identify favourable entry and exit points.
Risk Management: The strategy incorporates risk management techniques, such as position sizing based on equity and dynamic stop loss levels, to manage risk exposure and protect capital. This helps to minimize drawdowns and preserve profits.
Buy Condition:
The buy condition in the strategy is determined by a combination of factors, including A1, A2, A3, XG, and weeklySlope. Let's break it down:
A1 Condition: The A1 condition checks for specific price relationships. It verifies that the ratio of the highest price to the closing price is less than 1.03, the ratio of the opening price to the lowest price is less than 1.03, and the ratio of the highest price to the previous day's closing price is greater than 1.06. This condition looks for a specific pattern indicating potential bullish momentum.
A2 Condition: The A2 condition checks for price relationships related to the closing price. It verifies that the ratio of the closing price to the opening price is greater than 1.05 or that the ratio of the closing price to the previous day's closing price is greater than 1.05. This condition looks for signs of upward price movement and momentum.
A3 Condition: The A3 condition focuses on volume. It checks if the current volume crosses above the highest volume over the last 60 periods. This condition aims to identify increased buying interest and potentially confirms the strength of the potential upward price movement.
XG Condition: The XG condition combines the A1 and A2 conditions and checks if they are true for both the current and previous bars. It also verifies that the ratio of the closing price to the 5-period EMA crosses above the 9-period SMA of the same ratio. This condition helps identify potential buy signals when multiple factors align, indicating a strong bullish momentum and potential entry point.
Weekly Trend Factor: The weekly slope condition calculates the slope of the 50-period SMA over a weekly timeframe. It checks if the slope is positive, indicating an overall upward trend on a weekly basis. This condition provides additional confirmation that the stock is in an upward trend.
When all of these conditions align, the buy condition is triggered, indicating a favourable time to enter a long position.
Sell Condition:
The sell condition is relatively straightforward in the strategy:
Sell Signal: The sell condition simply checks if the closing price crosses below the 10-period EMA. When this condition is met, it indicates a potential reversal or weakening of the upward price momentum, and a sell signal is generated.
Backtest Outcome:
The strategy was backtested over the period from January 22nd, 1999 to May 3rd, 2023, using daily candlestick charts for the NASDAQ: NVDA. The strategy used an initial capital of 1,000,000 USD, The order quantity is defined as 10% of the equity. The strategy allows for pyramiding with 1 order, and the transaction fee is set at 0.03% per trade. Here are the key outcomes of the backtest:
Net Profit: 539,595.84 USD, representing a return of 53.96%.
Percent Profitable: 48.82%
Total Closed Trades: 127
Profit Factor: 2.331
Max Drawdown: 68,422.70 USD
Average Trade: 4,248.79 USD
Average Number of Bars in Trades: 11, indicating the average duration of the trades.
Conclusion:
In conclusion, the Swing Momentum Strategy is a quantitative trading approach that combines swing trading principles with momentum indicators to identify and capture mid term trading opportunities. The strategy has demonstrated promising results during backtesting, including a significant net profit and a favourable profit factor.
X48 - Strategy | ADAPTIVE CONSECUTIVE + TP/SL | V.1Thanks For Tradingview Built-in Script :: << Original From Consecutive Strategy Built-in Script >>
================== Read This First Before Use This Strategy ==============
Please be aware that this strategy is not a guarantee of success and may lead to losses.
Trading involves risk and you should always do your own research before making any decisions.
This Strategy Just an Idea For Help Your Decision For Open Position.
You Must Be Search and Make Your Self Understand What You Doing In This Strategy.
Example :: This Strategy and Indicator Find The Consecutive Bars And You, You Are Reading Must Be Decision Up to You !!
For Backtest Show It's That For a Newbie 100$ Portfolio and 16.333$ Per Order Size
>>>> Read Me First !! <<<<<
========== Detailed and meaningful description =========
How It's Work : This Strategy are Following Green or Red Candle :: example 3 Green Candle To OpenLong Position
Can Set TP/SL if you want :: Just Fine The Best Value of Asset as you want
Fast Trend = MA FAST LINE
SLOW Trend = MA SLOW LINE
MID-TERM TREND = MA MID-TERM
LONG-TERM TREND = MA LONG-TERM
=========== Condition And Statement ===========
Long Condition Statement :: Candles Consecutive Bars Up and close > golden_line and fast_line > golden_line
Short Condition Statement :: Candles Consecutive Bars Down and close < golden_line and fast_line < golden_line
AutoCloseLong Condition :: Candles ConsecutiveBarsDownStop and close > golden_line and close < death_line and close < death_line and close < death_line or fastUpdeath
AutoCloseShort Condition :: Candles ConsecutiveBarsUpStop and close < golden_line and close > death_line and close > death_line and close > death_line or fastUpdeath
====== For ADAPTIVE you can customize your ALL MA For Your Statement
/////////For Example Hook Alert Command ////////////
Just Easy Command >> :: {{strategy.order.alert_message}}
Or Other Json You Should Edit Command Like This Example
{"ex":"'bnfuture'","side": "AutoLong", "$16.333", "symbol": "{{ticker}}", "passphrase": "1234","leverage":"10", "tp" : "5", "sl" : "2", "tl" : "2", "callback" : "1"}
{"ex":"'bnfuture'","side": "AutoShort", "$16.333", "symbol": "{{ticker}}", "passphrase": "1234","leverage":"10", "tp" : "5", "sl" : "2", "tl" : "2", "callback" : "1"}
Gold Fair Value Gap Entry(FVG GOLD)This script calculates the fair value of gold, which is set as an input parameter. It then gets the current price of gold and calculates the gap between the price and the fair value. If the gap is positive, it enters a long trade, and if it's negative, it enters a short trade.
The script also uses proper risk management techniques by setting a stop loss and take profit for each trade. The plot() function is used to display the fair value and gap on the chart.
Please note that this is just an example script, and you should customize it based on your specific trading strategy and criteria. It's also important to backtest your strategy and refine it before using it with real money.
Bollinger Bands - Breakout StrategyThe Bollinger Bands - Breakout Strategy is a trend-following optimized for short-term trading in the crypto market. This strategy employs the Bollinger Bands, a widely recognized technical indicator, as its primary instrument for pinpointing potential trades. It is capable of executing both long and short positions, depending on whether the market is in a spot or futures, and is particularly effective in trending markets.
The strategy boasts a high degree of configurability, allowing users to set the Bollinger Bands period and deviation, trend filter, volatility filter, trade direction filter, rate of change filter, and date filter. Furthermore, it offers options for Take Profit, Stop Loss, and Trailing Stop for both long and short positions, ensuring a comprehensive risk management approach. The inclusion of a maximum intraday loss feature adds another layer of protection, making this strategy a valuable tool for traders seeking a professional and adaptable trading system.
Name : Bollinger Bands - Breakout Strategy
Category : Trend Follower based on Bollinger Bands
Operating mode : Long and Short on Futures or Long on Spot
Trade duration : Intraday
Timeframe : 2H, 3H, 4H, 5H
Market : Crypto
Suggested usage : Trending Markets
Entry : When the price crosses above or below the Bollinger Bands
Exit : Opposite Cross or Profit target, Trailing stop or Stop loss
Configuration :
- Bollinger Bands period and deviation
- Trend Filter
- Volatility Filter
- Trade direction filter
- Rate of Change filter
- Date Filter (for backtesting purposes)
- Take Profit, Stop Loss and Trailing Stop for long and short positions
- Risk Management: Max Intraday Loss
Backtesting :
⁃ Exchange: BINANCE
⁃ Pair: BTCUSDT.P
⁃ Timeframe: 4H
⁃ Fee: 0.025%
⁃ Slippage: 1
- Initial Capital: 10000 USDT
- Position sizing: 10% of Equity
- Start : 2019-09-19 (Out Of Sample from 2022-12-23)
- Bar magnifier: on
Credits :
- LucF of Pine Coders for f_security function to avoid repainting using security.
- QuantNomad for Monthly Table.
Disclaimer : Risk Management is crucial, so adjust stop loss to your comfort level. A tight stop loss can help minimise potential losses. Use at your own risk.
How you or we can improve? Source code is open so share your ideas!
Leave a comment and smash the boost button!
Thanks for your attention, happy to support the TradingView community.
FRAMA & CPMA Strategy [CSM]The script is an advanced technical analysis tool specifically designed for trading in financial markets, with a particular focus on the BankNifty market. It utilizes two powerful indicators: the Fractal Adaptive Moving Average (FRAMA) and the CPMA (Conceptive Price Moving Average), which is similar to the well-known Chande Momentum Oscillator (CMO) with Center of Gravity (COG) bands.
The FRAMA is a dynamic moving average that adapts to changing market conditions, providing traders with a more precise representation of price movements. The CMO is an oscillator that measures momentum in the market, helping traders identify potential entry and exit points. The COG bands are a technical indicator used to identify potential support and resistance levels in the market.
Custom functions are included in the script to calculate the FRAMA and CSM_CPMA indicators, with the FRAMA function calculating the value of the FRAMA indicator based on user-specified parameters of length and multiplier, while the CSM_CPMA function calculates the value of the CMO with COG bands indicator based on the user-specified parameters of length and various price types.
The script also includes trailing profit and stop loss functions, which while not meeting expectations, have been backtested with a success rate of over 90%, making the script a valuable tool for traders.
Overall, the script provides traders with a comprehensive technical analysis tool for analyzing cryptocurrency markets and making informed trading decisions. Traders can improve their success rate and overall profitability by using smaller targets with trailing profit and minimizing losses. Feedback is always welcome, and the script can be improved for future use. Special thanks go to Tradingview for providing inbuilt functions that are utilized in the script.
Stochastic RSI Strategy (with SMA and VWAP Filters)The strategy is designed to trade on the Stochastic RSI indicator crossover signals.
Below are all of the trading conditions:
-When the Stochastic RSI crosses above 30, a long position is entered.
-When the Stochastic RSI crosses below 70, a short position is entered.
-The strategy also includes two additional conditions for entry:
-Long entries must have a positive spread value between the 9 period simple moving average and the 21 period simple moving average.
-Short entries must have a negative spread value between the 9 period simple moving average and the 21 period simple moving average.
-Long entries must also be below the volume-weighted average price.
-Short entries must also be above the volume-weighted average price.
-The strategy includes stop loss and take profit orders for risk management:
-A stop loss of 20 ticks is placed for both long and short trades.
-A take profit of 25 ticks is placed for both long and short trades.
Adaptive Price Channel StrategyThis strategy is an adaptive price channel strategy based on the Average True Range (ATR) indicator and the Average Directional Index (ADX). It aims to identify sideways markets and trends in the price movements and make trades accordingly.
The strategy uses a length parameter for the ATR and ADX indicators, which determines the length of the calculation for these indicators. The strategy also uses an ATR multiplier, which is multiplied by the ATR to determine the upper and lower bounds of the price channel.
The first step of the strategy is to calculate the highest high (HH) and lowest low (LL) over the specified length. The ATR is also calculated over the same length. Then the strategy calculates the positive directional indicator (+DI) and negative directional indicator (-DI) based on the up and down moves in the price, and uses these to calculate the ADX.
If the ADX is less than 25, the market is considered to be in a sideways phase. In this case, if the price closes above the upper bound of the price channel (HH - ATR multiplier * ATR), the strategy enters a long position, and if the price closes below the lower bound of the price channel (LL + ATR multiplier * ATR), the strategy enters a short position.
If the ADX is greater than or equal to 25 and the +DI is greater than the -DI, the market is considered to be in a bullish phase. In this case, if the price closes above the upper bound of the price channel, the strategy enters a long position. If the ADX is greater than or equal to 25 and the +DI is less than the -DI, the market is considered to be in a bearish phase. In this case, if the price closes below the lower bound of the price channel, the strategy enters a short position.
The strategy exits a position after a certain number of bars have passed since the entry, as specified by the exit_length input.
In summary, this strategy attempts to trade in accordance with the prevailing market conditions by identifying sideways markets and trends and making trades based on price movements within a dynamically-adjusted price channel.
This strategy takes a read on the market and either takes a channel strategy or trades volatility based on current trend. Works well on 2, 3 ,4, 12 hour for BTC. It’s my first attempt and creating a strategy. I am very interested in constructive criticism. I will look into better risk management, maybe a trailing stop loss. Other suggestions welcome. This is my first attempt at a strategy.
Here are the settings I used.
Inputs
Length 20
Exit 10
ATR 3.2
Dates I picked when I got into Crypto
Properties
Capital 1000
Order size 2 Contracts
Pyramiding 1
Commission .05
JS-TechTrading: Supertrend-Strategy_Basic versionAre you looking for a reliable and profitable algorithmic trading strategy for TradingView? If so, you might be interested in our Supertrend basic strategy, which is based on three powerful indicators: Supertrend (ATR), RSI and EMA.
Supertrend is a trend-following indicator that helps you identify the direction and strength of the market. It also gives you clear signals for entry and exit points based on price movements.
RSI is a momentum indicator that measures the speed and change of price movements. It helps you filter out false signals and avoid overbought or oversold conditions.
EMA is a moving average indicator that smooths out price fluctuations and shows you the long-term trend of the market. It helps you confirm the validity of your trades and avoid trading against the trend.
Our Supertrend basic strategy combines these three indicators to give you a simple yet effective way to trade any market. Here's how it works:
- For long trades, you enter when the price is above Supertrend and pulls back below it (the low of the candle crosses Supertrend) and then rebounds above it (the high of the next candle goes above the pullback candle). You exit when the price closes below Supertrend or when you reach your target profit or stop loss.
- For short trades, you enter when the price is below Supertrend and pulls back above it (the high of the candle crosses Supertrend) and then drops below it (the low of the next candle goes below the pullback candle). You exit when the price closes above Supertrend or when you reach your target profit or stop loss.
- You can also use RSI and EMA filters to improve your results. For long trades, you only enter if RSI is above 50 and price is above 200 EMA. For short trades, you only enter if RSI is below 50 and price is below 200 EMA.
- You can set your stop loss and target profit as a percentage of your entry price or based on other criteria. You can also adjust the parameters of each indicator according to your preferences and risk tolerance.
Our Supertrend basic strategy is easy to use and has been tested on various markets and time frames. It can help you capture consistent profits while minimizing your losses.
Price Action Trading StrategyIn this strategy, we define the high and low of the previous candle, and then check whether the current candle's high or low is higher or lower than the previous candle's high or low, respectively. If there's a new high, we enter a long position, and if there's a new low, we enter a short position. We also set exit conditions to close the position if the price drops below the previous low or rises above the previous high.
Please note that this is a simple example and should not be used as a standalone trading strategy. It is important to conduct thorough backtesting and consider other factors such as risk management before implementing any trading strategy.
FTR, WMA, OBV & RSI StrategyThis Pine Script code is a trading strategy that uses several indicators such as Fisher Transform (FTR), On-Balance Volume (OBV), Relative Strength Index (RSI), and a Weighted Moving Average (WMA). The strategy generates buy and sell signals based on the conditions of these indicators.
The Fisher Transform function is a technical indicator that uses past prices to determine whether the current market is bullish or bearish. The Fisher Transform function takes in four multipliers and a length parameter. The four multipliers are used to calculate four Fisher Transform values, and these values are used in combination to determine if the market is bullish or bearish.
The Weighted Moving Average (WMA) is a technical indicator that smooths out the price data by giving more weight to the most recent prices.
The Relative Strength Index (RSI) is a momentum indicator that measures the strength of a security's price action. The RSI ranges from 0 to 100 and is typically used to identify overbought or oversold conditions in the market.
The On-Balance Volume (OBV) is a technical indicator that uses volume to predict changes in the stock price. OBV values are calculated by adding volume on up days and subtracting volume on down days.
The strategy uses the Fisher Transform values to generate buy and sell signals when all four Fisher Transform values change color. It also uses the WMA to determine if the trend is bullish or bearish, the OBV to confirm the trend, and the RSI to filter out false signals.
The red and green triangular arrows attempt to indicate that the trend is bullish or bearish and should not be traded against in the opposite direction. This helps with my FOMO :)
All comments welcome!
The script should not be relied upon alone, there are no stop loss or take profit filters. The best results have been back-tested using Tradingview on the 45m - 3 hour timeframes.
Volatility Range Breakout Strategy [wbburgin]The "Volatility Range Breakout Strategy" uses deviations of high-low volatility to determine bullish and bearish breakouts.
HOW IT WORKS
The volatility function uses the high-low range of a lookback period, divided by the average of that range, to determine the likelihood that price will break in a specific direction.
High and low ranges are determined by the relative volatility compared to the current closing price. The high range, for example, is the (volatility * close) added to the close, the low range is this value subtracted by the close.
A volatility-weighted moving average is taken of these high and low ranges to form high and low bands.
Finally, breakouts are identified once the price closes above or below these bands. An upwards breakout (bullish) occurs when the price breaks above the upper band, while a downwards breakout (bearish) occurs when the price breaks below the lower band. Positions can be closed either by when the price falls out of its current band ("Range Crossover" in settings under 'Exit Type') or when the price falls below or above the volatility MA (default because this allows us to catch trends for longer).
INPUTS/SETTINGS
The AVERAGE LENGTH is the period for the volatility MA and the weighted volatility bands.
The VOLATILITY LENGTH is how far the lookback should be for highs/lows for the volatility calculation.
Enjoy! Let me know if you have any questions.
Yesterday’s High Breakout - Trend Following StrategyYesterday’s High Breakout it is a trading system based on the analysis of yesterday's highs, it works in trend-following mode therefore it opens a long position at the breakout of yesterday's highs even if they occur several times in one day.
There are several methods for exiting a trade, each with its own unique strategy. The first method involves setting Take-Profit and Stop-Loss percentages, while the second utilizes a trailing-stop with a specified offset value. The third method calls for a conditional exit when the candle closes below a reference EMA.
Additionally, operational filters can be applied based on the volatility of the currency pair, such as calculating the percentage change from the opening or incorporating a gap to the previous day's high levels. These filters help to anticipate or delay entry into the market, mitigating the risk of false breakouts.
In the specific case of NULS, a 9% Take-Profit and a 3% Stop-Loss were set, with an activated trailing-stop percentage. To postpone entry and avoid false breakouts, a 1% gap was added to the price of yesterday's highs.
Name : Yesterday's High Breakout - Trend Follower Strategy
Author : @tumiza999
Category : Trend Follower, Breakout of Yesterday's High.
Operating mode : Spot or Futures (only long).
Trade duration : Intraday.
Timeframe : 30M, 1H, 2H, 4H
Market : Crypto
Suggested usage : Short-term trading, when the market is in trend and it is showing high volatility.
Entry : When there is a breakout of Yesterday's High.
Exit : Profit target or Trailing stop, Stop loss or Crossunder EMA.
Configuration :
- Gap to anticipate or postpone the entry before or after the identified level
- Rate of Change for Entry Condition
- Take Profit, Stop Loss and Trailing Stop
- EMA length
Backtesting :
⁃ Exchange: BINANCE
⁃ Pair: NULSUSDT
⁃ Timeframe: 2H
⁃ Fee: 0.075%
⁃ Slippage: 1
- Initial Capital: 10000 USDT
- Position sizing: 10% of Equity
- Start : 2018-07-26 (Out Of Sample from 2022-12-23)
- Bar magnifier: on
Credits : LucF for Pine Coders (f_security function to avoid repainting using security)
Disclaimer : Risk Management is crucial, so adjust stop loss to your comfort level. A tight stop loss can help minimise potential losses. Use at your own risk.
How you or we can improve? Source code is open so share your ideas!
Leave a comment and smash the boost button!
Thanks for your attention, happy to support the TradingView community.
SPY 4 Hour Swing TraderThe purpose of this script is to spot 4 hour pivots that indicate ~30 trading day swings. As VIX starts to drop options trading will get more boring and as we get back on the bull and can benefit from swing trading strategy. Swing trading doesn't make a whole lot of sense when VIX is above 28. Seems to get best results on 4 hour chart for this one. This indicator spots a go long opportunity when the 5 ema crosses the 13 ema on the 4 hour along with the RSI > 50 and the ADX > 20 and Stoichastic values (smoothed line < 80 or line < 90) and close > last candle close and the True Range < 6. It also spots uses a couple different means to determine when to exit the trade. Sell condition is primarily when the 13 ema crosses the 5 ema and the MACD line crosses below the signal line and the smoothed Stoichastic appears oversold (greater than 60) and slop of RSI < -.2. Stop Losses and Take Profits are configurable in Inputs along with ability to include short trades plus other MACD and Stoichastic settings. If a stop loss is encountered the trade will close. Also once twice the expected move is encountered partial profits will taken and stop losses and take profits will be re-established based on most recent close. Also a VIX above 28 will trigger any open positions to close. If trying to use this for something other than SPXL it is best to update stop losses and take profit percentages and check backtest results to ensure proper levels have been selected and the script gives satisfactory results.
SPY 1 Hour Swing TraderThe purpose of this script is to spot 1 hour pivots that indicate ~5 to 6 trading day swings. Results indicate that swings are held approximately 5 to 6 trading days on average, over the last 6 years. This indicator spots a go long opportunity when the 5 ema crosses the 13 ema on the 1 hour along with the RSI > 50. It also spots uses a couple different means to determine when to exit the trade. Sell condition is primarily when the 13 ema crosses the 5 ema and the MACD line crosses below the signal line and the smoothed Stoichastic appears oversold (greater than 60). Stop Losses and Take Profits are configurable in Inputs along with ability to include short trades plus other MACD and Stoichastic settings. If a stop loss is encountered the trade will close. Also once twice the expected move is encountered partial profits will taken and stop losses and take profits will be re-established based on most recent close. Once long trades are exited, short trades will be initiated if recent conditions appeared oversold and input option for short trading is enabled. If trying to use this for something other than SPXL it is best to update stop losses and take profit percentages and check backtest results to ensure proper levels have been selected and the script gives satisfactory results.
Risk Reward Calculator [lovealgotrading]
OVERVIEW:
This Risk Reward Calculator strategy can help you maximize your RR value with help of algorithmic trading.
INDICATOR:
I wanted to setup my trades more easier with this indicator, I didn't want to calculate everytime before orders, with help this indicator we can calculate R:R value, avarage price, stoploss price, take-profit price, order prices, all position cost and more ...
Our strategy is a risk revard calculation indicator that is made easy to use by using visualized lines and panels, and also has algorithmic trading support.
With the help of this indicator, we can quickly and easily calculate our risk reward values and enter the positions.
If we want to ensure that our balance grows regularly while trading in the stock market, we need to manage the risks and rewards otherwise we may fall below our initial balance at the end of the day, even if we seem to be winning.
What is the Risk-Reward value ?
This value is a value that shows how many times the amount of risk we take when entering the position is successful, we will earn.
- For example, you risked $100 while entering the trade, so if your trade stops, you will lose 100 $.
Your Risk-Reward(RR) value is 2 means that if your position is successful, you will have 200 $ in your pocket.
A trader's success is determined by the amount of R he earns monthly or yearly, not how much money he makes.
What is different in this indicator ?
I want to say thank you to © EvoCrypto. His Calculator (weighted) – evo indicator helped me when I was developed my indicator.
I want to explain what I have improved:
1-In this strategy, we can determine the time period in which we want to open our positions.
2-We can open a maximum of 4 positions in the same direction and close our positions at a single level. StopLoss or TakeProfit
3-This indicator, which works in the form of a strategy, shows where our positions have been opened or closed. With the help of this, it helps us to determine our strategy in our future positions more accurately.
4-The most important improvement is that we do not miss our positions with the help of alarms (WEB HOOK). if we want, we receive by quickly connecting all these positions to our robot, the software can enter and exit the position while we are busy.
IMPLEMENTATION DETAILS – SETTINGS:
1 - We can set the start and end dates of the positions we will take.
2- We can set our take profit, stoploss levels.
3- If your trade is stopped, we can determine the amount of the trade that we will lose.
4- We can adjust our entry levels to positions and our position sizes at entry levels.
(Sum of positions weight must be 100%)
5- We can receive our positions even if we are busy with the help of algorithmic trading. For this, we must paste our Jshon codes into the fields specified in the settings panel.
6- Finally, we can change the settings we want and don't want to have in our visual elements.
Let's make a LONG side example together
We have determined our positions to enter stoploss, take profit and long positions. We did not forget to set the start time of our strategy
Our strategy appear on the graph as follows.
Our strategy has calculated the total position size, our R-R value, the distance of the current price to the stop and take profit levels, in short, a lot of things we could look visually.
Notes:
If you're going to connect this bot to an automatic Long or Short direction,
Don’t forget! you need to Webhook URL,
Don’t miss paste this code to your message window {{strategy.order.alert_message}}
ALSO:
If you have any ideas what to add to my work to add more sources or make calculations cooler, feel free to write me.
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 .
MACD/RSI - editedThis strategy checks MACDcrossover and RSI crossover. When MACD crosses up or down the signal line, it checks if RSI is crossing back OverSold or OverBought lines, respectively, over the past few candles. The period can be changed by the parameter "RSI lookback".
The strategy seems to work better for reversal—still a work in progress.
VIX Futures Spread StrategyThis script was an exercise in learning Pinescript and exploring the futures curve of the VIX in relation to SPY. Was deleted by TV, trying to republish it now with updated parameters for slippage and commission and a more detailed description.
"VIX Futures Spread Strategy" is a trading strategy that capitalizes on the spread between the 3-month VIX futures (VIX3M) and the spot VIX index. This strategy is based on the idea that the VIX futures spread can serve as a contrarian indicator of market sentiment, with extreme negative spreads potentially signaling oversold conditions and opportunities for long positions.
Ordinarily the VIX curve is in contango as futures contracts are priced at a premium to the current spot price and are used to hedge future uncertainty in the market. When the spot price of VIX spikes the curve can invert and enter backwardation; this strategy detects this condition and uses it as a trigger to open a long position in SPY. The spread going negative tends to correlate with excessive fear and uncertainty in the short term while expecting lower volatility in the long term, in this case 3 months out.
The strategy is designed to enter a long position when the VIX futures spread is negative and to exit the position when the spread rises above 3 -- when the curve is in contango again. The strategy employs a pyramiding approach, allowing up to 10 additional orders to be placed while the entry condition is met, with each order consisting of 10 contracts. This approach aims to maximize potential profits during periods of favorable market conditions.
In this strategy, the VIX futures spread is calculated as the difference between the 3-month VIX futures (VIX3M) and the spot VIX index. The spread is plotted as a histogram on the chart, with the zero line representing no spread, and horizontal lines at 0 and 3 indicating the entry and exit thresholds, respectively.
The strategy's backtesting settings use an initial capital of HKEX:10 ,000, a commission of 0.5% per trade, and a maximum of 10 pyramiding orders, and a slippage of 2 ticks.
Please note that this strategy is intended for educational purposes and should not be considered as financial advice. Before using this strategy in live trading, make sure to thoroughly test and optimize its parameters to suit your risk tolerance and specific trading conditions.