Indicadores y estrategias
Trend Strategy with Stop LossBUY: Supertrend bullish (green)+RSI < 65(not overbought) + Price above 50 period SMA
SELL: Supertrend flips bearish
4H Trade Alert StrategySteps to Configure Alerts in TradingView
Add this script to the Pine Editor and save it.
Click "Add to Chart".
Go to the Alerts tab in TradingView.
Create a new alert:
Select the script (e.g., "4H Trade Alert Strategy").
Set the condition to "4H Trade Alert".
Customize the alert frequency and notification method (e.g., pop-up, email, webhook).
Save the alert, and it will trigger whenever the conditions are met.
IU Ocean OscillatorIU Ocean Oscillator is a momentum-based oscillator designed to identify trend exhaustion and potential reversals. This indicator is calculated using:
- Acceleration Factor (AF): Measures the rate of change in price momentum.
- Volatility Expansion (VE): Captures market volatility over a given period.
- Trend Exhaustion Index (TEI): Normalized ratio of AF and VE, scaled between 0 and 100.
- Signal Line: A smoothed moving average of the TEI for better trend clarity.
User Inputs
- Lookback Period: Defines the number of bars used for calculations.
- Overbought Level: Sets the threshold for overbought conditions (default: 85).
- Oversold Level: Sets the threshold for oversold conditions (default: 15).
- Show Acceleration Factor: Option to display the raw TEI values.
Key Features:
- Overbought and oversold levels to identify potential reversal zones.
- Gradient-colored signal line to visualize trend strength.
- Optional display of the Acceleration Factor for advanced analysis.
- Unique oceanic theme with dynamic elements like coral, bubbles, and blowfish.
This oscillator helps traders gauge trend strength, exhaustion, and possible reversals, making it useful for various trading strategies.
Arpeet MACDOverview
This strategy is based on the zero-lag version of the MACD (Moving Average Convergence Divergence) indicator, which captures short-term trends by quickly responding to price changes, enabling high-frequency trading. The strategy uses two moving averages with different periods (fast and slow lines) to construct the MACD indicator and introduces a zero-lag algorithm to eliminate the delay between the indicator and the price, improving the timeliness of signals. Additionally, the crossover of the signal line and the MACD line is used as buy and sell signals, and alerts are set up to help traders seize trading opportunities in a timely manner.
Strategy Principle
Calculate the EMA (Exponential Moving Average) or SMA (Simple Moving Average) of the fast line (default 12 periods) and slow line (default 26 periods).
Use the zero-lag algorithm to double-smooth the fast and slow lines, eliminating the delay between the indicator and the price.
The MACD line is formed by the difference between the zero-lag fast line and the zero-lag slow line.
The signal line is formed by the EMA (default 9 periods) or SMA of the MACD line.
The MACD histogram is formed by the difference between the MACD line and the signal line, with blue representing positive values and red representing negative values.
When the MACD line crosses the signal line from below and the crossover point is below the zero axis, a buy signal (blue dot) is generated.
When the MACD line crosses the signal line from above and the crossover point is above the zero axis, a sell signal (red dot) is generated.
The strategy automatically places orders based on the buy and sell signals and triggers corresponding alerts.
Advantage Analysis
The zero-lag algorithm effectively eliminates the delay between the indicator and the price, improving the timeliness and accuracy of signals.
The design of dual moving averages can better capture market trends and adapt to different market environments.
The MACD histogram intuitively reflects the comparison of bullish and bearish forces, assisting in trading decisions.
The automatic order placement and alert functions make it convenient for traders to seize trading opportunities in a timely manner, improving trading efficiency.
Risk Analysis
In volatile markets, frequent crossover signals may lead to overtrading and losses.
Improper parameter settings may cause signal distortion and affect strategy performance.
The strategy relies on historical data for calculations and has poor adaptability to sudden events and black swan events.
Optimization Direction
Introduce trend confirmation indicators, such as ADX, to filter out false signals in volatile markets.
Optimize parameters to find the best combination of fast and slow line periods and signal line periods, improving strategy stability.
Combine other technical indicators or fundamental factors to construct a multi-factor model, improving risk-adjusted returns of the strategy.
Introduce stop-loss and take-profit mechanisms to control single-trade risk.
Summary
The MACD Dual Crossover Zero Lag Trading Strategy achieves high-frequency trading by quickly responding to price changes and capturing short-term trends. The zero-lag algorithm and dual moving average design improve the timeliness and accuracy of signals. The strategy has certain advantages, such as intuitive signals and convenient operation, but also faces risks such as overtrading and parameter sensitivity. In the future, the strategy can be optimized by introducing trend confirmation indicators, parameter optimization, multi-factor models, etc., to improve the robustness and profitability of the strategy.
3 EMA vs 5 EMA Crossover Strategy When 3 EMA crossed 5 EMA on the upside, BUY. When 3 EMA Crosses 5 EMA on the downside, SELL. This will be a continuous trade, so one exit will also mean one new entry
Manojgowda Testing oneSample testing strategy developed to share wit friends for the purpose of learning and tweaking it
Oliver Valez Triple MA StrategyStrategy Logic:
Trend Identification:
200 MA acts as the primary trend filter
Price above 200 MA = Bullish trend (green background)
Price below 200 MA = Bearish trend (red background)
Trading Signals:
Long Entry: 20 MA crosses above 50 MA + Price > 200 MA
Short Entry: 20 MA crosses below 50 MA + Price < 200 MA
Risk Management:
Adjustable stop loss (2% default)
Adjustable take profit (4% default)
Automatic position closing on opposite crossover signals
Customization Options:
Switch between SMA/EMA
Adjust MA lengths
Modify risk parameters
Change visual styles
How to Use:
Apply to any liquid asset (works best on daily timeframe)
Look for entries in the direction of the 200 MA trend
Use confluence with price action at key levels
Combine with volume analysis for confirmation
Key Features:
Triple MA confirmation system
Trend-filtered entries
Built-in risk management
Visual trend identification
Flexible input parameters
This strategy combines trend following with momentum signals while maintaining disciplined risk management - crucial principles in Oliver Valez's trading methodology.
New chat
Lines at Key Levels with BoxesPlaces lines at key levels at intervals of your choice, you can adjust box width and line spacing in the settings. Shout out to MrPresident for the original indicator, and Evanture (Evan Cabral) for the inspiration.
Prev Day & Curr Day H/L + Opening Range (9:30, 5min)Script Description:
This TradingView Pine Script is designed for use on a 5‑minute chart and plots key price levels for daily trading analysis. It automatically draws:
• Previous Day High/Low Lines:
These lines mark the previous day’s regular trading hours (RTH) high and low levels, with labels (“PDH” and “PDL”) for easy identification.
• Current Day High/Low Lines:
As the trading day progresses, the script updates and displays the current day’s RTH high and low levels, labeled as “CDH” and “CDL”.
• Opening Range for 9:30 AM:
The script specifically identifies the first 5‑minute candle at 9:30 AM (using the “America/New_York” time zone) and draws two additional lines at its high and low. These lines are labeled “HighOpen” and “LowOpen” to indicate the opening range.
All lines are drawn with a width of 5 and have configurable colors, styles, and extension lengths. The script automatically resets at the start of each new day, ensuring that the plotted levels are current and relevant for daily trading decisions.
Prev Day High EMA Crossover with 7-Day SMA Trailing StopPrev Day High EMA Crossover with 7-Day SMA Trailing Stop
Overview
This indicator is designed for traders who seek high-probability breakout trades using a combination of Exponential Moving Averages (EMAs), the previous day's high, and a 7-day Simple Moving Average (SMA) trailing stop. It helps identify bullish and bearish crossover signals while ensuring confirmation with price action above or below key levels.
How It Works
1. Entry Signals:
✅ Bullish Entry:
The 9 EMA crosses above the 15 EMA (bullish momentum).
The price is above the previous day’s high (confirming a breakout).
The candle closes above the open (bullish confirmation).
✅ Bearish Entry:
The 9 EMA crosses below the 15 EMA (bearish momentum).
The price is below the previous day’s high (confirming a failure to break higher).
The candle closes below the open (bearish confirmation).
2. Exit Strategy (Trailing Stop):
📌 Long Exit: If in a long trade, exit when the price closes below the 7-day SMA.
📌 Short Exit: If in a short trade, exit when the price closes above the 7-day SMA.
Back to the Future with Enhanced Tool for Lower Timeframes. Back to the Future (Linear Regression)
This section uses linear regression to analyze price trends and predict future movements.
Key Parameters:
len & len1: Defines the length of the regression calculation.
dev & dev1: Multiplier for deviation bands.
Color and Style Settings: Customizes regression lines and deviation bands.
How It Works:
It calculates a linear regression line based on price data.
Deviation bands (similar to Bollinger Bands) are plotted to identify price volatility.
The slope and intercept of the regression line help determine potential price trends.
The indicator dynamically updates these trendlines and deviation bands on the chart.
2. Enhanced Tool for Lower Timeframes
This section enhances intraday and scalping strategies by using EMAs, ATR-based stop-losses, volume-based target multipliers, and ADX for trend strength filtering.
Key Features & Calculations:
Exponential Moving Averages (EMAs)
shortEMALen = 5, longEMALen = 20
Used to identify trend direction and generate buy/sell signals based on crossovers.
ATR-based Stop-Loss & Targets
atrPeriod = 7
ATR (Average True Range) helps calculate dynamic stop-loss and target levels.
Targets are adjusted based on volume conditions:
If volume > volumeThreshold, Target 2 is calculated using a higher multiplier.
ADX for Trend Strength Filtering
adxLength = 10, adxThreshold = 15
ADX (Average Directional Index) ensures signals are taken only in strong trends.
Buy and Sell Conditions
Buy Signal: When short EMA crosses above long EMA & ADX > adxThreshold.
Sell Signal: When short EMA crosses below long EMA & ADX > adxThreshold.
Dynamic Stop-Loss and Profit Targets
Long trades: Stop-loss is set below the entry price by ATR value.
Short trades: Stop-loss is set above the entry price by ATR value.
Two target levels are calculated dynamically.
3. Visual Representation
Plots EMA lines for trend identification.
Plots ADX line to indicate trend strength.
Draws dynamic lines and labels for:
Entry price
Stop-loss
Target 1 and Target 2
Uses different colors to differentiate buy/sell conditions.
4. Additional Features
Risk-Reward Settings: Adjusts risk-reward ratio for custom target levels.
Session Adaptability: Works well on lower timeframes, making it ideal for scalping & intraday trading.
Volume-Based Adjustments: Uses higher target multipliers during high-volume conditions.
Summary
This is a highly advanced, multi-featured indicator that combines trend analysis, momentum filtering, and ATR-based risk management into a single powerful tool for intraday traders. It provides clear buy/sell signals and dynamically adjusts stop-loss and profit targets based on real-time market conditions.
CPR with Multi-Timeframe PivotsThis is a Pine Script code for plotting the Central Pivot Range (CPR) and associated support and resistance levels on TradingView. It allows the user to select the time frame for calculating the CPR (Day, Week, or Month) and displays the pivot, top CPR, bottom CPR, and support/resistance levels (R1 to R5 and S1 to S5).
High-Return Trend Strategy (Final)Developed with AI, Sends you notif for buy and sell, just trust the process. NFA
ML-Based BankNifty Strategy//@version=5
strategy("ML-Based BankNifty Strategy", overlay=true)
// Simulated ML Signal (Replace with Webhook Integration)
ml_signal = input.bool(true, "ML Buy Signal")
// Trade Execution Based on ML Prediction
if (ml_signal)
strategy.entry("Long", strategy.long)
strategy.exit("Take Profit", from_entry="Long", limit=close * 1.02, stop=close * 0.98)
Highest Price MarkerHighest Price Marker – Smart Label & Line Indicator
This Pine Script v5 indicator highlights the highest price reached within the last 100 bars on your chart. It visually enhances key price levels by:
✅ Placing a label at the highest price, positioned 3 candles to the left for clarity.
✅ Drawing a line connecting the label to the actual high for better visibility.
✅ Auto-updating dynamically whenever a new highest price is detected.
This is useful for traders who want to quickly identify resistance levels or analyze historical price peaks without cluttering the chart.
🔹 How to Use:
Add the indicator to your chart.
Look for the red label marking the highest price within the last 100 bars.
The horizontal line helps track the exact price level.
💡 Customization Ideas:
Adjust the lookback period (length = 100) to detect longer or shorter trends.
Modify colors or label positioning to suit your preferences.
🚀 Perfect for:
🔸 Price Action Traders
🔸 Swing & Breakout Traders
🔸 Support & Resistance Analysis
[ARN]Reversal finderThe script is designed to identify potential reversal points in the market using a 5-period Exponential Moving Average (EMA) and specific candlestick patterns. Below is a detailed breakdown of the script:
1. Inputs and Settings
Toggle for 5 EMA:toggle5EMA = input.bool(true, title="Show 5 EMA")
This allows the user to enable or disable the display of the 5 EMA on the chart.
EMA Length: emaLength5 = 5
The length of the EMA is fixed at 5 periods.
2.EMA Calculation: EMA Value: emaValue5 = ta.ema(close, emaLength5)
The script calculates the 5-period EMA using the closing price of the candles.
EMA Color: emaColor5 = emaValue5 > emaValue5 ? color.green : color.red
The color of the EMA line is determined by its direction:
- Green if the current EMA value is greater than the previous EMA value (uptrend).
- Red if the current EMA value is less than the previous EMA value (downtrend).
Plotting the EMA: plot(toggle5EMA ? emaValue5 : na, title="5 EMA", color=emaColor5,
linewidth=2)
The EMA is plotted on the chart if the toggle is enabled (`toggle5EMA` is `true`).
3. Candle Color Identification: Green Candle:close > open; Red Candle:close < open
4. Signal Candle Identification:
Long Signal Candle: signalLong5 = isGreen and (low < emaValue5 and high < emaValue5)
A long signal candle is a green candle where both the low and high prices are below the 5
EMA. This suggests a potential bullish reversal.
Short Signal Candle: signalShort5 = isRed and (low > emaValue5 and high > emaValue5)
A short signal candle is a red candle where both the low and high prices are above the 5
EMA. This suggests a potential bearish reversal.
5. Confirmation Candle Identification:
confirmationCandleLong5 = signalLong5 and isGreen and (low <= emaValue5 and high >=
emaValue5)
A confirmation candle for a long signal is a green candle that occurs after a long signal
candle. It must touch or cross the 5 EMA (i.e., the low is below the EMA and the high is above
the EMA).
Confirmation Candle for Short:confirmationCandleShort5 = signalShort5 and isRed and (low
<= emaValue5 and high >= emaValue5)
A confirmation candle for a short signal is a red candle that occurs after a short signal
candle. It must touch or cross the 5 EMA (i.e., the low is below the EMA and the high is above
the EMA).
6. Plotting Buy/Sell Signals: A green triangle is plotted below the confirmation candle for a
long signal and a pink triangle is plotted above the confirmation candle for a short signal.
How the Script Works:
1. The script calculates the 5 EMA and plots it on the chart.
2. It identifies signal candles (candles that do not touch the 5 EMA) and confirmation candles (candles that touch or cross the 5 EMA).
3. Buy and sell signals are generated based on the confirmation candles.
4. Stop-loss levels are plotted for each signal to help manage risk.
Customization:
- You can adjust the `extendBars` variable to change how far the stop-loss lines extend.
- You can modify the colors and styles of the EMA, signals, and stop-loss lines to suit your preferences.
This script is a useful tool for traders looking to identify potential reversals using the 5 EMA and candlestick patterns. However, like any trading tool, it should be used in conjunction with other indicators and analysis techniques for better accuracy.
MACD Histogram Color Tabledisplaying the MACD Histogram color and divergences across multiple timeframes. Here's how it works step by step:
1. Setting the Table Position
The script allows the user to choose where the table will be placed using the positionOption input. The three options are:
Top Right
Top Left
Top Center
Depending on the selected option, the table is created at the corresponding position.
2. Creating the Table
A table (macdTable) is created with 8 columns (for different timeframes) and 3 rows (for different data points).
3. MACD Histogram Color Function (f_get_macd_color)
This function calculates the MACD line, signal line, and histogram for a given timeframe.
The histogram (histLine) is used to determine the cell background color:
Green if the histogram is positive.
Red if the histogram is negative.
4. Divergence Detection Function (f_detect_divergence)
This function looks for bullish and bearish divergences using the MACD histogram:
Bullish Divergence (🟢)
The price makes a lower low.
The MACD histogram makes a higher low.
Bearish Divergence (🔴)
The price makes a higher high.
The MACD histogram makes a lower high.
The function returns:
🟢 (green circle) for bullish divergence.
🔴 (red circle) for bearish divergence.
"" (empty string) if no divergence is detected.
5. Populating the Table
The table has three rows for each timeframe:
First row: Displays the timeframe labels (5m, 15m, 30m, etc.).
Second row: Shows MACD Histogram color (red/green).
Third row: Displays divergences (🟢/🔴).
This is done using table.cell() for each timeframe.
6. Final Result
A table is displayed on the chart.
Each column represents a different timeframe.
The color-coded row shows the MACD histogram status.
The bottom row shows detected divergences.
SMA Crossover SignalThis Pine Script plots 5, 20, and 50-period simple moving averages and highlights trade signals. It shades the background green if the price is above the 50 SMA and red if below. A "BUY SIGNAL" appears only when the 5 SMA crosses above the 20 SMA while the background is green, and a "SELL SIGNAL" appears only when the 5 SMA crosses below the 20 SMA while the background is red.
shinninggoxhack scalping
Absolutely! Let's create a Pine Script indicator that includes buy and sell signals, along with take profit and stop loss levels. This will help you manage your trades effectively. Here’s a basic example to get you started:
//@version=5
indicator("Buy Sell Signal with TP and SL", overlay=true)
// Input parameters
takeProfitPercent = input(1.0, title="Take Profit (%)") / 100
stopLossPercent = input(1.0, title="Stop Loss (%)") / 100
// Simple Moving Average for buy/sell signals
smaLength = input(14, title="SMA Length")
sma = ta.sma(close, smaLength)
// Buy and Sell conditions
buySignal = ta.crossover(close, sma)
sellSignal = ta.crossunder(close, sma)
// Variables to hold entry price
var float entryPrice = na
// Entry logic
if (buySignal)
entryPrice := close
if (sellSignal)
entryPrice := na
// Calculate Take Profit and Stop Loss levels
takeProfitLevel = entryPrice * (1 + takeProfitPercent)
stopLossLevel = entryPrice * (1 - stopLossPercent)
// Plotting Buy and Sell signals
plotshape(buySignal, style=shape.labelup, location=location.belowbar, color=color.green, size=size.small, text="BUY")
plotshape(sellSignal, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.small, text="SELL")
// Plotting Take Profit and Stop Loss levels
plot(entryPrice ? takeProfitLevel : na, color=color.blue, title="Take Profit", style=plot.style_stepline)
plot(entryPrice ? stopLossLevel : na, color=color.orange, title="Stop Loss", style=plot.style_stepline)
Explanation of the Code:
Inputs:
Take Profit (%): Set the percentage for your take profit level.
Stop Loss (%): Set the percentage for your stop loss level.
SMA Length: The length of the Simple Moving Average used for generating buy/sell signals.
Buy and Sell Conditions:
A buy signal is generated when the price crosses above the SMA.
A sell signal is generated when the price crosses below the SMA.
Entry Price:
The entry price is recorded when a buy signal is triggered. It resets when a sell signal occurs.
Take Profit and Stop Loss Levels:
These levels are calculated based on the entry price and the specified percentages.
Plotting:
Buy and sell signals are plotted on the chart with labels.
Take profit and stop loss levels are displayed as lines on the chart.
Next Steps:
You can customize the SMA length and the percentages for take profit and stop loss according to your trading strategy.
Test the script on different time frames and assets to see how it performs.