Indicators and strategies
EMA Crossover with Alerts taufiqiskcross over ema 9 dan ema 21 sangat cocok untuk scalping dikit dikit
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)
123@123@. //@version=5
strategy("VWAP and MA Strategy with Volume Confirmation - Customizable", overlay=true)
// إعدادات VWAP
vwapSource = input.source(title="VWAP Source", defval=hlc3)
// إعدادات المتوسطات المتحركة
ma20Length = input.int(title="MA20 Length", defval=20)
ma50Length = input.int(title="MA50 Length", defval=50)
// إعدادات حجم التداول
volumeMultiplier = input.float(title="Volume Multiplier", defval=1.5)
// حساب VWAP
vwap = ta.vwap(vwapSource, volume)
// حساب المتوسطات المتحركة
ma20 = ta.sma(close, ma20Length)
ma50 = ta.sma(close, ma50Length)
// شروط الشراء
longCondition = close > vwap and ma20 > ma50 and volume > ta.sma(volume, 20) * volumeMultiplier
// شروط البيع
shortCondition = close < vwap and ma20 < ma50 and volume > ta.sma(volume, 20) * volumeMultiplier
// رسم VWAP والمتوسطات المتحركة
plot(vwap, color=color.blue, title="VWAP")
plot(ma20, color=color.red, title="MA20")
plot(ma50, color=color.green, title="MA50")
// رسم إشارات الدخول والخروج (باستخدام plotchar)
plotchar(longCondition, char="كول", location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotchar(shortCondition, char="بوت", location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")
// أوامر الدخول والخروج (اختياري)
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.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. 📈💪
MyRenkoLibraryLibrary "MyRenkoLibrary"
calcRenko(real_break_size)
Parameters:
real_break_size (float)
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.
Whale IndicatorOverview:
This advanced script is designed to track the price difference of Bitcoin between Bitmex and Binance Futures, providing traders with strategic buy and sell signals. It capitalizes on the relative movements of Bitcoin prices across these two prominent platforms, offering a unique approach to market analysis and decision-making.
Functionality:
* Price Tracking: The indicator meticulously monitors the Bitcoin price on Bitmex and Binance Futures.
* Signal Generation:
* A buy signal is generated when the Bitmex price increases by $100.
* A sell signal is triggered when the Bitmex price decreases by $100.
* Special Conditions:
* A signal named STRONG BUY is produced when the price difference rises by $150.
* A signal named STRONG SELL is generated when the price difference drops by $150.
Methodology:
This indicator relies on simple yet effective price differential principles, where the relative movement between the two platforms signals potential trading opportunities. The threshold values of $100 and $150 are chosen to filter out noise and focus on significant market movements, providing clear actionable signals.
Usage Instructions:
* Timeframe: This indicator is optimized for the BTCUSD Daily chart. However, it is also adaptable to 4-hour and hourly charts for more active trading strategies.
* Trading Strategy:
* When a buy signal turns into a sell signal, the recommendation is to SHORT or SELL.
* Conversely, when a sell signal flips to a buy signal, traders are advised to LONG or BUY.
Warning: This indicator is specifically designed for Bitcoin and should not be applied to other assets, as it may yield inaccurate results.
By understanding the underlying calculations and the strategic thresholds utilized, traders can better grasp the rationale behind the generated signals and incorporate them into their trading arsenal effectively. This detailed approach ensures that the indicator not only alerts traders to potential opportunities but does so with a clear, logical foundation.
MSTR Bitcoin Holdings Overlay (MSTR BTC Treasury)This TradingView overlay displays MicroStrategy's (MSTR) Bitcoin holdings as a simple line chart on a separate axis. The data used in this script is based on publicly available information about MSTR's Bitcoin acquisitions up to January 2, 2025.
Key Points:
- All data points (timestamps and Bitcoin holdings) included in this script represent actual historical records available up to January 2, 2025.
- No future projections or speculative estimates are included.
This script is static and does not fetch or update data dynamically. If there are new Bitcoin acquisitions or updates after January 2, 2025, they will not appear on the chart unless manually added.
Transparency and Accuracy:
- The script uses an array-based structure to map exact timestamps to corresponding Bitcoin holdings.
Each timestamp aligns with known dates when MSTR disclosed its Bitcoin purchases.
Order Block & FVG Finder Explanation of Changes:
1. max_future_bars Limitation:
* Added max_future_bars to limit how far labels and objects can be plotted into the future.
* Objects are only drawn if their position is within the 500-bar limit.
2. Condition in label.new:
* Ensures that the position of the label remains within the bounds by checking the bar_index.
Key Notes:
=> The limitation applies to label.new() and similar drawing functions.
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
Trend-Following Strategytrend strat that does chatgpt things for everyone including ema ocos and sp500