Alternating RSI Buy/Sell with Volume FilterBuy Signal:
Condition:
RSI(25) increases from 30 → 35.
Price remains stable.
RSI(100) > 50.
Volume increases.
Candlestick analysis
Custom Strategy TO Spread strategy//@version=5
indicator("Custom Strategy", shorttitle="CustomStrat", overlay=true)
// Configuração das SMAs
smaShort = ta.sma(close, 8)
smaLong = ta.sma(close, 21)
// Configuração da Supertrend
atrPeriod = 10
atrFactor = 2
= ta.supertrend(atrFactor, atrPeriod)
// Cálculo do spread
spread = high - low
spreadThreshold = 0.20 * close // 20% do preço atual
// Condições de entrada
crossOver = ta.crossover(smaShort, smaLong)
crossUnder = ta.crossunder(smaShort, smaLong)
superTrendCross = (close > superTrend) and (close < superTrend )
superTrendConfirm = ta.barssince(superTrendCross) <= 6
// Volume
volumeConfirmation = (volume > volume ) and (volume > volume )
volumeAverage = ta.sma(volume, 15) > ta.sma(volume , 15)
// Condição final
entryCondition = (crossOver or crossUnder) and superTrendConfirm and (spread > spreadThreshold) and volumeConfirmation and volumeAverage
// Alertas
if (entryCondition)
alert("Condição de entrada atendida!", alert.freq_once_per_bar_close)
Combined RSI Strategy with ButtonsBuy Signal:
Stock Price = 100.
RSI(25) = 30 → 35 (increasing).
RSI(100) = 60 (uptrend).
A BUY label and trailing line are plotted.
Sell Signal:
Stock Price = 100.
RSI(25) = 30 → 25 (decreasing).
RSI(100) = 40 (downtrend).
A SELL label and trailing line are plotte
Combined RSI Indicator with VolumeRSI of 100 and 25: Both are calculated, but the primary logic focuses on RSI(25).
Conditions:
RSI(25) is increasing.
Price is stable (within a small difference from the previous close).
Price is above the user-defined threshold (e.g., 150 in your example).
Volume is higher than its recent average.
RSI Combo with VolumeInputs: We have customizable inputs for RSI lengths (100 and 25), volume length (for average calculation), and a threshold for the difference in RSI 25.
RSI Calculations: The script calculates the two RSIs.
Buy Condition:
It checks if RSI 25 is higher than the previous value by a specified threshold.
It checks if the current candle's close is near the previous candle's close.
It verifies that the current volume is higher than the average over the last 20 candles (can be adjusted).
Buy Signal Plot: If all conditions are true, a green "BUY" label is plotted below the bar.
You can adjust the parameters (RSI lengths, volume length, etc.) based on your strategy and
Volatility Crypto Trading Strategy//@version=5
indicator("Volatility Crypto Trading Strategy", overlay=true)
// Input parameters for Bollinger Bands and MACD
bb_length = input.int(20, title="Bollinger Band Length")
bb_std_dev = input.float(2.0, title="Bollinger Band Standard Deviation")
macd_fast = input.int(12, title="MACD Fast Length")
macd_slow = input.int(26, title="MACD Slow Length")
macd_signal = input.int(9, title="MACD Signal Length")
// Input for higher timeframe
htf = input.timeframe("30", title="Higher Timeframe")
// Bollinger Bands calculation
bb_basis = ta.sma(close, bb_length)
bb_upper = bb_basis + bb_std_dev * ta.stdev(close, bb_length)
bb_lower = bb_basis - bb_std_dev * ta.stdev(close, bb_length)
// MACD calculation
= ta.macd(close, macd_fast, macd_slow, macd_signal)
// Higher timeframe trend confirmation
htf_close = request.security(syminfo.tickerid, htf, close)
htf_trend = ta.sma(htf_close, bb_length)
higher_trend_up = htf_close > htf_trend
higher_trend_down = htf_close < htf_trend
// Entry conditions
long_condition = close < bb_lower and macd_line > signal_line and higher_trend_up
short_condition = close > bb_upper and macd_line < signal_line and higher_trend_down
// Exit conditions
long_exit_condition = close >= bb_basis * 1.1
short_exit_condition = close <= bb_basis * 0.9
// Plot Bollinger Bands
plot(bb_upper, color=color.red, title="Upper Bollinger Band")
plot(bb_lower, color=color.green, title="Lower Bollinger Band")
plot(bb_basis, color=color.blue, title="Bollinger Band Basis")
// Plot Buy/Sell signals
plotshape(series=long_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=short_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Alerts
alertcondition(long_condition, title="Long Entry", message="Buy Signal")
alertcondition(short_condition, title="Short Entry", message="Sell Signal")
alertcondition(long_exit_condition, title="Long Exit", message="Exit Long")
alertcondition(short_exit_condition, title="Short Exit", message="Exit Short")
Enhanced RSI Buy & Sell StrategySI (14): The standard RSI (length 14) is calculated for this strategy.
Buy Condition: This is triggered when RSI is below the oversold level (30) and starts increasing, while the price is near the SMA and volume is high.
Sell Condition: This is triggered when RSI is above the overbought level (70) and starts decreasing, while the price is near the SMA and volume is high.
Exit Condition: The strategy will consider exiting when the RSI moves into the overbought zone after a buy signal.
Volume Confirmation: A volume multiplier is used to confirm the strength of the signal.
SMA Plot: The Simple Moving Average (SMA) is plotted to help identify the trend.
RSI Plot: The RSI is plotted alongside the buy and sell levels for easy visualization.
RSI + Chandelier Exit StrategyChandelier Exit Long is plotted in green (above price).
Chandelier Exit Short is plotted in red (below price).
Buy signal occurs only if the price is above the Chandelier Exit Long line.
Sell signal occurs only if the price is below the Chandelier Exit Short line.
Custom RSI Buy and Sell StrategyPaste the code into your Pine Script editor on TradingView.
Adjust inputs such as the RSI lengths, price reference, and volume multiplier to match your trading strategy.
Observe how the buy/sell signals are triggered based on the RSI conditions, volume, and price
Enhanced RSI Buy & Sell StrategyCondition Grouping: The conditions are grouped inside parentheses for both the buy_condition and sell_condition. This is crucial for ensuring that multiple logical conditions are evaluated together.
No Line Continuation: The conditions are on a single line to avoid the error regarding "end of line without line continuation".
No extra or missing characters: The script has been checked for extra commas or missed logical operators that could cause syntax issues.
Fibonacci RepulseFibonacci Repulse with Trend Table 📉📈
Description: The "Fibonacci Repulse" indicator for TradingView combines Fibonacci retracement levels with dynamic support/resistance detection, providing real-time price action insights. 🔄 This powerful tool plots critical Fibonacci retracement levels (23.6%, 38.2%, and 50%) based on the highest and lowest swing points over a user-defined lookback period. The indicator automatically detects bullish retests, alerting you when the price touches and closes above any of the Fibonacci levels, indicating potential upward momentum. 🚀
Key Features:
Fibonacci Retracement Levels 📊: Plots key levels (23.6%, 38.2%, 50%) dynamically based on the highest and lowest price swings over a customizable lookback period.
Bullish Retests Alerts ⚡: Identifies and marks bullish retests when the price touches the Fibonacci levels and closes above them, signaling potential upward movement.
Real-Time Trend Detection 🔍: Displays the current market trend as "Bullish," "Bearish," or "Sideways" in a clear, easy-to-read table in the bottom right corner of the chart. This is determined based on the price's position relative to the Fibonacci levels.
Customizable Settings ⚙️: Adjust the lookback period and label offsets for optimal visual customization.
How It Works:
The indicator calculates the Fibonacci retracement levels between the highest high and the lowest low within a user-defined period. 🧮
It draws extended lines at the 23.6%, 38.2%, and 50% retracement levels, updating them as the chart moves. 📉
When the price touches a Fibonacci level and closes above it, a "Bullish Retest" label appears, signaling a potential buy opportunity. 💡
A real-time trend status table updates automatically in the chart's bottom-right corner, helping traders quickly assess the market's trend direction: Bullish, Bearish, or Sideways. 🔄
Why Use It: This indicator is perfect for traders looking for a clear and visual way to incorporate Fibonacci levels into their trading strategies, with real-time feedback on trend direction and price action signals. Whether you are a novice or an experienced trader, "Fibonacci Repulse" provides a powerful tool for identifying potential reversal points and confirming trends, enhancing your trading strategy. 📈💪
Custom RSI StrategyRSI Buy/Sell Signals: Buy when RSI Length 25 is low (e.g., 25/30/40) and rising. Sell when RSI Length 25 is high (e.g., 60/70) and falling.
Volume Filter: Only trigger signals when there is above-average volume.
Custom Bar Coloring: I’ll use an easy-to-read color scheme for buy/sell signals.
Simple Moving Average (SMA): Use an SMA to help visualize the trend.
RSI Lines: Plot both RSI Length 25 and RSI Length 100 with custom colors.
Custom RSI Buy and Sell StrategyYou will now see the standard candlestick chart, with the RSI lines plotted on the indicator panel.
Buy/Sell signals will appear as green and red labels below and above the bars, respectively.
SMA line will be plotted on the price chart to give you an additional trend reference.
Logarithmic IndicatorThis logarithmic indicator does the following:
It calculates the logarithm of the chosen price (default is close price) using a user-defined base (default is 10).
It then calculates a Simple Moving Average (SMA) of the logarithmic values.
Both the logarithmic value and its SMA are plotted on the chart.
To improve visibility, it also plots an upper and lower band based on the highest and lowest values over the last 100 periods.
To use this indicator:
Open the TradingView Pine Editor.
Paste the code into the editor.
Click "Add to Chart" or "Save" to apply the indicator to your chart.
Adjust the input parameters in the indicator settings as needed.
You can customize this indicator further by:
Changing the color scheme
Adding more moving averages or other technical indicators
Implementing alerts based on crossovers or other conditions
Remember, logarithmic scales are often used in finance to visualize data that spans several orders of magnitude, making it easier to see percentage changes over time.
Heikin Ashi Candle Time Frame @tradingbauhausHeikin Ashi Strategy with Moving Average Crossovers @tradingbauhaus
This strategy is based on the interpretation of Heikin Ashi charts combined with the crossover of Exponential Moving Averages (EMA) to identify buy and sell signals. Additionally, an optional MACD filter is used to improve the accuracy of the signals.
What are Heikin Ashi Candles?
Heikin Ashi candles are a type of candlestick chart that smooths out market noise and makes trends easier to spot. The key difference between Heikin Ashi and regular candlesticks is that Heikin Ashi calculates open, close, high, and low differently, which helps identify trends more clearly.
How the Strategy Works:
Heikin Ashi Calculation:
Close (ha_close): It is calculated as the average of the open, high, low, and close of the regular candlestick.
ha_close = (open + high + low + close) / 4
Open (ha_open): It is calculated using the average of the previous Heikin Ashi open and close values, which smooths the series and better reflects trends:
ha_open := na(ha_open ) ? (open + close) / 2 : (ha_open + ha_close ) / 2
High (ha_high): The maximum of the regular high, Heikin Ashi open, and Heikin Ashi close.
Low (ha_low): The minimum of the regular low, Heikin Ashi open, and Heikin Ashi close.
Buy and Sell Signals:
Buy Signal (Long): This is generated when the Heikin Ashi EMA (an exponential moving average calculated with Heikin Ashi prices) crosses above the Slow EMA. The signal is confirmed by the MACD crossover (if the MACD filter is enabled).
Sell Signal (Short): This is generated when the Heikin Ashi EMA crosses below the Slow EMA, indicating a potential downtrend.
MACD as an Optional Filter:
The MACD is a momentum indicator that shows the relationship between two moving averages. In this strategy, if the MACD filter is enabled, buy and sell signals will only be triggered if the MACD also aligns with the direction of the signal.
MACD Filter: The MACD is calculated on an independent timeframe and used as a filter. If the MACD confirms the trend (i.e., if the MACD is above its signal line for a buy or below for a sell), the signal is valid.
Moving Averages Calculations:
The Heikin Ashi EMA is calculated using the Heikin Ashi close values over a configurable period.
The SMA (Simple Moving Average) is calculated using the regular close prices of the candles.
Plotting the Signals:
When a buy signal is detected, a green upward triangle is plotted below the bar.
When a sell signal is detected, a red downward triangle is plotted above the bar.
Strategy Configuration:
Heikin Ashi Timeframe (res):
Here, you can choose the timeframe of the Heikin Ashi candles you wish to analyze (for example, 60 minutes).
Heikin Ashi EMA (fama):
Set the period for the Exponential Moving Average (EMA) used with Heikin Ashi prices.
Slow EMA (sloma):
Set the period for the Slow EMA that determines the crossover signals for buy and sell.
MACD Filter (macdf):
If enabled, the strategy will only trigger buy and sell signals if the MACD also confirms the trend. If disabled, the strategy will trigger signals regardless of the MACD.
MACD Timeframe (res2):
You can select the timeframe for calculating the MACD, so it can be compared with the other signals.
MACD Shift (macds):
This setting controls the amount of shift applied to the MACD calculation.
Trading Signals:
Buy Signal (Long):
Generated when the Heikin Ashi EMA crosses above the Slow EMA and the MACD confirms the trend (if the MACD filter is enabled). This indicates a potential opportunity to enter a long (buy) position.
Sell Signal (Short):
Generated when the Heikin Ashi EMA crosses below the Slow EMA and the MACD confirms the trend (if the MACD filter is enabled). This indicates a potential opportunity to enter a short (sell) position.
TradingView Script Code:
This code can be used directly on TradingView. It provides an automated trading strategy that calculates buy and sell signals and displays them as graphical arrows on the chart. It also includes alerts, so you can receive notifications when the strategy conditions are met.
Alerts:
Buy Alert: Triggered when the Heikin Ashi EMA crosses above the Slow EMA or when the MACD confirms the signal.
Sell Alert: Triggered when the Heikin Ashi EMA crosses below the Slow EMA or when the MACD confirms the signal.
How to Use the Strategy:
Add to Your Chart: Copy and paste the code into the Pine Script editor in TradingView and run it on your chart.
Adjust Parameters: You can modify parameters such as the period of the EMAs and MACD to tailor the strategy to your trading preferences.
Follow the Signals: Watch for buy and sell signals (green and red arrows) on the chart to identify potential entry and exit points.
Enhanced RSI Buy and Sell StrategyVolume Filter:
Only trigger Buy or Sell signals when volume is significantly higher than the average.
Dynamic Exit Signal:
Introduce a clear exit strategy based on RSI conditions and volume trends.
Visualization Improvements:
Use distinct shapes and colors for Buy, Sell, and Exit signals.
Add moving averages to assess trends.
Configurable Parameters:
Allow users to adjust RSI levels, volume thresholds, and other key setting
Enhanced RSI Buy and Sell StrategyVolume Filter:
Only trigger Buy or Sell signals when volume is significantly higher than the average.
Dynamic Exit Signal:
Introduce a clear exit strategy based on RSI conditions and volume trends.
Visualization Improvements:
Use distinct shapes and colors for Buy, Sell, and Exit signals.
Add moving averages to assess trends.
Configurable Parameters:
Allow users to adjust RSI levels, volume thresholds, and other key setting
DCA Strategy with HedgingThis strategy implements a dynamic hedging system with Dollar-Cost Averaging (DCA) based on the 34 EMA. It can hold simultaneous long and short positions, making it suitable for ranging and trending markets.
Key Features:
Uses 34 EMA as baseline indicator
Implements hedging with simultaneous long/short positions
Dynamic DCA for position management
Automatic take-profit adjustments
Entry confirmation using 3-candle rule
How it Works
Long Entries:
Opens when price closes above 34 EMA for 3 candles
Adds positions every 0.1% price drop
Takes profit at 0.05% above average entry
Short Entries:
Opens when price closes below 34 EMA for 3 candles
Adds positions every 0.1% price rise
Takes profit at 0.05% below average entry
Settings
EMA Length: Controls the EMA period (default: 34)
DCA Interval: Price movement needed for additional entries (default: 0.1%)
Take Profit: Profit target from average entry (default: 0.05%)
Initial Position: Starting position size (default: 1.0)
Indicators
L: Long Entry
DL: Long DCA
S: Short Entry
DS: Short DCA
LTP: Long Take Profit
STP: Short Take Profit
Alerts
Compatible with all standard TradingView alerts:
Position Opens (Long/Short)
DCA Entries
Take Profit Hits
Note: This strategy works best on lower timeframes with high liquidity pairs. Adjust parameters based on asset volatility.
Adaptive Momentum Gaussian Average (AMGA)The Modified Smoothed Gaussian Moving Average (MSGMA) is an advanced technical indicator that combines multiple smoothing techniques and momentum oscillators to provide dynamic, adaptive signals. This indicator utilizes a modified ALMA (Arnaud Legoux Moving Average) for smoothing price changes, along with a Gaussian Moving Average (GMA) and Chande Momentum Oscillator (CMO) to assess market momentum. Additionally, the Relative Strength Index (RSI) is used to confirm buy and sell signals.
Key Features:
ALMA Smoothing: The ALMA smoothing technique is used to filter out noise and provide a smoother price action.
Gaussian Moving Average (GMA): This adaptive moving average adjusts to market volatility, offering a dynamic line for trend analysis.
Chande Momentum Oscillator (CMO): Measures market momentum and direction to filter and confirm signals.
RSI Filter: The RSI helps to confirm trends and improve the reliability of buy and sell signals.
Buy and Sell Signals: Buy and sell signals are generated when the price crosses the Gaussian Moving Average, with confirmation from the RSI and CMO.
Bar Coloring: Bars are colored green for bullish signals and red for bearish signals, making it easier to spot trend reversals.
Parameters:
Source: Price data used for calculations (usually close).
Smoothing: Smoothing factor for the ALMA.
Lookback: Lookback period for price change calculations.
Length: Period for calculating the Gaussian Moving Average.
Volatility Period: Period used for calculating volatility, adjusting the Gaussian Moving Average.
Adaptive Parameters: Enables adaptive parameters for the Gaussian Moving Average.
RSI Period: Period for calculating the RSI (default is 14).
Chande Momentum Length: Length for calculating the Chande Momentum Oscillator.
How to Use:
This indicator is designed for traders looking for precise entry and exit signals. It combines multiple indicators to confirm trends and improve the accuracy of trade signals. It is best used with other tools to further validate trading decisions.
Simple 5SMA Crossover Signals with SMA Trend SignalsThis script provides two types of signals based on the relationship between the closing price and the 5-period Simple Moving Average (SMA):
1. Crossover Signals:
Buy Signal ("BUY"):
A green "BUY" label appears below the bar when the current closing price crosses above the 5SMA, and the previous closing price was below or equal to the 5SMA.
Sell Signal ("SELL"):
A red "SELL" label appears above the bar when the current closing price crosses below the 5SMA, and the previous closing price was above or equal to the 5SMA.
2. SMA Trend Signals:
SMA Increasing Signal ("SMA+"):
A blue circle is displayed above the bar when the 5SMA starts increasing (current SMA is greater than the previous SMA, and the previous SMA was not increasing).
SMA Decreasing Signal ("SMA-"):
An orange circle is displayed below the bar when the 5SMA starts decreasing (current SMA is less than the previous SMA, and the previous SMA was not decreasing).
These signals allow traders to understand both price action relative to the SMA and changes in the SMA's trend direction. The SMA line is plotted on the chart for reference.
説明 (日本語)
このスクリプトは、終値と5期間の単純移動平均(SMA)の関係に基づいた2種類のシグナルを提供します:
1. クロスオーバーシグナル:
買いシグナル ("BUY"):
現在の終値が5SMAを上抜け、かつ前の終値が5SMA以下だった場合、緑色の「BUY」ラベルがローソク足の下に表示されます。
売りシグナル ("SELL"):
現在の終値が5SMAを下抜け、かつ前の終値が5SMA以上だった場合、赤色の「SELL」ラベルがローソク足の上に表示されます。
2. SMAトレンドシグナル:
SMA増加シグナル ("SMA+"):
5SMAが増加し始めた場合(現在のSMAが前のSMAより大きく、前回のSMAが増加していなかった場合)、青い丸がローソク足の上に表示されます。
SMA減少シグナル ("SMA-"):
5SMAが減少し始めた場合(現在のSMAが前のSMAより小さく、前回のSMAが減少していなかった場合)、オレンジ色の丸がローソク足の下に表示されます。
これらのシグナルにより、価格がSMAに対してどのように動いているか、またSMAのトレンド方向の変化を理解することができます。チャートにはSMAラインも描画され、参考として使用できます。
Simple 5SMA Crossover Signals with SMA Trend SignalsThis script provides two types of signals based on the relationship between the closing price and the 5-period Simple Moving Average (SMA):
1. Crossover Signals:
Buy Signal ("BUY"):
A green "BUY" label appears below the bar when the current closing price crosses above the 5SMA, and the previous closing price was below or equal to the 5SMA.
Sell Signal ("SELL"):
A red "SELL" label appears above the bar when the current closing price crosses below the 5SMA, and the previous closing price was above or equal to the 5SMA.
2. SMA Trend Signals:
SMA Increasing Signal ("SMA+"):
A blue circle is displayed above the bar when the 5SMA starts increasing (current SMA is greater than the previous SMA, and the previous SMA was not increasing).
SMA Decreasing Signal ("SMA-"):
An orange circle is displayed below the bar when the 5SMA starts decreasing (current SMA is less than the previous SMA, and the previous SMA was not decreasing).
These signals allow traders to understand both price action relative to the SMA and changes in the SMA's trend direction. The SMA line is plotted on the chart for reference.
説明 (日本語)
このスクリプトは、終値と5期間の単純移動平均(SMA)の関係に基づいた2種類のシグナルを提供します:
1. クロスオーバーシグナル:
買いシグナル ("BUY"):
現在の終値が5SMAを上抜け、かつ前の終値が5SMA以下だった場合、緑色の「BUY」ラベルがローソク足の下に表示されます。
売りシグナル ("SELL"):
現在の終値が5SMAを下抜け、かつ前の終値が5SMA以上だった場合、赤色の「SELL」ラベルがローソク足の上に表示されます。
2. SMAトレンドシグナル:
SMA増加シグナル ("SMA+"):
5SMAが増加し始めた場合(現在のSMAが前のSMAより大きく、前回のSMAが増加していなかった場合)、青い丸がローソク足の上に表示されます。
SMA減少シグナル ("SMA-"):
5SMAが減少し始めた場合(現在のSMAが前のSMAより小さく、前回のSMAが減少していなかった場合)、オレンジ色の丸がローソク足の下に表示されます。
これらのシグナルにより、価格がSMAに対してどのように動いているか、またSMAのトレンド方向の変化を理解することができます。チャートにはSMAラインも描画され、参考として使用できます。
Simple 5SMA Crossover Signals with SMA Trend Signals v2This script adds two types of signals to the chart:
Crossover Signals:
Buy Signal ("BUY"): Appears when the price crosses above the 5-period Simple Moving Average (SMA).
Sell Signal ("SELL"): Appears when the price crosses below the 5-period SMA.
SMA Trend Signals:
SMA Increasing Signal ("SMA+"): A blue circle is displayed above the bar when the SMA starts to increase (i.e., the current SMA value is greater than the previous one, and the previous SMA value was not increasing).
SMA Decreasing Signal ("SMA-"): An orange circle is displayed below the bar when the SMA starts to decrease (i.e., the current SMA value is less than the previous one, and the previous SMA value was not decreasing).
These SMA trend signals are independent of the crossover signals, providing additional insights into the trend direction of the SMA.
このスクリプトは、チャートに2種類のシグナルを追加します:
クロスオーバーシグナル:
買いシグナル ("BUY"): 価格が5期間の単純移動平均(SMA)を上抜けたときに表示されます。
売りシグナル ("SELL"): 価格が5期間のSMAを下抜けたときに表示されます。
SMAトレンドシグナル:
SMA増加シグナル ("SMA+"): SMAが増加し始めた場合(現在のSMAが前の値より大きく、前回のSMAが増加していなかった場合)、青い丸がローソク足の上に表示されます。
SMA減少シグナル ("SMA-"): SMAが減少し始めた場合(現在のSMAが前の値より小さく、前回のSMAが減少していなかった場合)、オレンジ色の丸がローソク足の下に表示されます。
これらのSMAトレンドシグナルは、クロスオーバーシグナルとは独立しており、SMAのトレンド方向についての追加的な洞察を提供します。