ATR Stop Loss & Take Profit這是一個完整的 ATR 停損 & 移動停損 策略筆記,你可以直接抄錄或修改,確保你在交易時能快速參考 🚀
📌 ATR 停損 & 移動停損 策略筆記
1. ATR(Average True Range)是什麼?
• ATR 是衡量市場波動的指標,不預測價格方向,而是告訴你市場的「平均波動範圍」。
• 常用 14 根 K 棒 ATR 來計算市場的波動程度。
📌 公式
TR = \max(當前最高價 - 當前最低價, |當前最高價 - 前一收盤價|, |當前最低價 - 前一收盤價|)
ATR = \frac{\sum TR}{N}
(N 為 ATR 計算週期,常見設為 14)
2. ATR 停損 & 目標獲利設定
✅ 初始停損
設定方式:
\text{初始停損} = \text{入場時 ATR} \times 1.5
• 目的:確保不被隨機波動掃出場
✅ 移動停損(Trailing Stop)
設定方式:
\text{移動停損} = \text{當前價格} - (\text{當前 ATR} \times 1.5)
• 目的:保護已獲利的部位,避免獲利變回虧損
• 隨市場波動調整,讓獲利最大化
✅ 動態目標獲利
設定方式:
\text{動態目標獲利} = \text{入場時 ATR} \times 3
• 目的:隨市場波動調整出場目標,防止過早獲利了結
3. ATR 搭配微型台指期(MTX)交易
項目 設定值(範例)
ATR 時間週期 14(預設值)
停損距離 1.5 × ATR(入場時 ATR)
移動停損 當前價格 - 1.5 × 當前 ATR
目標獲利 3 × 入場時 ATR
🔹 安全 vs 激進
交易風格 ATR 係數設定
更安全 停損 2x ATR,移動停損 1.8x ATR
更激進 停損 1.2x ATR,移動停損 1.5x ATR
4. ATR 停損 & 移動停損 追蹤表
這是一個標準化的交易紀錄表格,用來追蹤 ATR 停損執行效果。
交易編號 進場價格 入場時 ATR 初始停損 (1.5x ATR) 移動停損 (1.5x ATR) 動態目標獲利 (3x ATR) 最終交易結果
1 20000 10 19985 當前價格 - (當前 ATR × 1.5) 20030 待填
2 20100 12 20082 當前價格 - (當前 ATR × 1.5) 20136 待填
3 19950 9 19936.5 當前價格 - (當前 ATR × 1.5) 20022 待填
4 20050 11 20033.5 當前價格 - (當前 ATR × 1.5) 20083 待填
5 20200 13 20180.5 當前價格 - (當前 ATR × 1.5) 20239 待填
📌 5. 交易執行步驟
✅ 進場前
✅ 1. 計算「入場時 ATR」
✅ 2. 設定 初始停損(ATR × 1.5)
✅ 3. 設定 動態目標獲利(ATR × 3)
✅ 進場後
✅ 1. 當市場達到 盈虧比 1:1,將停損移動到成本價
✅ 2. 市場價格突破 2R 時,開始移動停損(當前價格 - 當前 ATR × 1.5)
✅ 3. 市場價格突破 3R 時,部分出場,確保至少 1R 獲利
🎯 6. 總結
✅ ATR 幫助設定 更合理的停損,避免過早出場
✅ 移動停損(Trailing Stop)確保獲利不變虧損
✅ 動態目標獲利 確保交易靈活調整出場點
✅ ATR 係數可調整,依照不同市場條件選擇安全或激進策略
🚀 這份筆記可以幫助你在交易中靈活運用 ATR,確保交易穩定性與獲利空間!
如果你有其他細節想補充或優化,告訴我,我幫你調整!💡
Cycles
Custom Timeframe Breaksuse custom time frame break to analyse it break the chart into zone for better understanding
Bitcoin Log Growth Curve OscillatorThis script presents the oscillator version of the Bitcoin Logarithmic Growth Curve 2024 indicator, offering a new perspective on Bitcoin’s long-term price trajectory.
By transforming the original logarithmic growth curve into an oscillator, this version provides a normalized view of price movements within a fixed range, making it easier to identify overbought and oversold conditions.
For a comprehensive explanation of the mathematical derivation, underlying concepts, and overall development of the Bitcoin Logarithmic Growth Curve, we encourage you to explore our primary script, Bitcoin Logarithmic Growth Curve 2024, available here . This foundational script details the regression-based approach used to model Bitcoin’s long-term price evolution.
Normalization Process
The core principle behind this oscillator lies in the normalization of Bitcoin’s price relative to the upper and lower regression boundaries. By applying Min-Max Normalization, we effectively scale the price into a bounded range, facilitating clearer trend analysis. The normalization follows the formula:
normalized price = (upper regresionline − lower regressionline) / (price − lower regressionline)
This transformation ensures that price movements are always mapped within a fixed range, preventing distortions caused by Bitcoin’s exponential long-term growth. Furthermore, this normalization technique has been applied to each of the confidence interval lines, allowing for a structured and systematic approach to analyzing Bitcoin’s historical and projected price behavior.
By representing the logarithmic growth curve in oscillator form, this indicator helps traders and analysts more effectively gauge Bitcoin’s position within its long-term growth trajectory while identifying potential opportunities based on historical price tendencies.
True Macros ºTweaked version of ICT's Mcros and my personal way to use them.
OG Script and code is made by toodegres all credit to him.
Daily 9:30 AM & 4:30 PM LinesThis Pine Script (v5) is designed for TradingView to automatically draw vertical lines at 9:30 AM and 4:30 PM each trading day. These times are significant in the stock market:
9:30 AM → Market open.
4:30 PM → Custom time (could be post-market close or other reference time).
The script helps traders visually mark these key times for easier analysis.
Ichimoku Oscillator with VSA📌 Explicação do Indicador – Ichimoku Oscillator com VSA e Backtest
🌍 Português 🇧🇷
📌 Introdução
O Ichimoku Oscillator com Volume Spread Analysis (VSA) e Backtest é um indicador avançado que combina diversas estratégias para identificar tendências, reversões e zonas de sobrecompra/sobrevenda com base em Ichimoku Kinko Hyo, Análise de Volume (VSA) e Divergências. Além disso, este indicador inclui uma funcionalidade de backtest, permitindo avaliar a eficiência das estratégias.
🔍 Teorias por trás do Indicador
✅ 1. Ichimoku Oscillator
O oscilador mede a diferença entre o preço e a Nuvem de Ichimoku, ajudando a entender a força da tendência.
O oscilador é normalizado (0 a 100) para permitir uma leitura clara, semelhante a um RSI.
📊 Faixas Importantes:
Sobrecompra (>80) – Possível reversão para baixa.
Sobrevenda (<20) – Possível reversão para alta.
Linha Média (50) – Representa o equilíbrio da tendência.
✅ 2. Análise de Volume Spread Analysis (VSA)
O VSA ajuda a identificar picos de volume e movimentos institucionais:
🟢 Selling Climax (Alto volume + tendência de baixa) → Sinal de Compra.
🔴 Buying Climax (Alto volume + tendência de alta) → Sinal de Venda.
🟣 Liquidação Institucional (Volume extremamente alto) → Reversão do Sinal.
Se houver um spike de volume acima do limite, os sinais podem ser invertidos para capturar possíveis manipulações de mercado.
✅ 3. Divergências (Bullish & Bearish)
As divergências indicam fraqueza na tendência e possíveis reversões:
🟢 Divergência Bullish: O preço faz um fundo menor, mas o oscilador faz um fundo maior → Indica compra.
🔴 Divergência Bearish: O preço faz um topo maior, mas o oscilador faz um topo menor → Indica venda.
O indicador desenha automaticamente as linhas das divergências no gráfico.
✅ 4. Canais do Oscilador
O oscilador usa um canal estatístico para identificar topos e fundos.
Quando o oscilador toca a banda superior, isso pode indicar um topo de mercado.
Quando toca a banda inferior, pode indicar um fundo de mercado.
🎯 Sinais de Entrada e Saída
🟢 Sinais de Compra
✔️ Cruzamento do oscilador acima de 50 (tendência de alta) com volume elevado.
✔️ Divergência bullish detectada.
✔️ VSA identificando liquidação institucional (Selling Climax).
🔴 Sinais de Venda
✔️ Cruzamento do oscilador abaixo de 50 (tendência de baixa) com volume elevado.
✔️ Divergência bearish detectada.
✔️ VSA identificando liquidação institucional (Buying Climax).
📊 Backtest Integrado
Este indicador permite testar estratégias automaticamente no passado:
✅ Configuração de Take Profit (TP) e Stop Loss (SL).
✅ Modo de backtest: Apenas Compras, Apenas Vendas ou Ambos.
✅ Estatísticas detalhadas: Win Rate, Lucro Médio, Perda Média, Saldo Final.
🟢 Relatório de backtest gerado automaticamente na tela.
⚠️ Isenção de Responsabilidade
Este indicador foi desenvolvido para fins educacionais e não constitui conselho financeiro. O uso deste indicador em operações reais é de total responsabilidade do usuário. O trading envolve riscos e pode resultar em perdas financeiras.
🌍 English 🇺🇸
📌 Introduction
The Ichimoku Oscillator with Volume Spread Analysis (VSA) & Backtest is an advanced indicator that integrates Ichimoku Kinko Hyo, Volume Analysis (VSA), and Divergences to identify trends, reversals, and overbought/oversold zones. Additionally, this indicator includes backtesting functionality to evaluate strategy effectiveness.
🔍 Theories Behind the Indicator
✅ 1. Ichimoku Oscillator
The oscillator measures the difference between price and the Ichimoku Cloud, helping to understand trend strength.
The oscillator is normalized (0 to 100) for clear readings, similar to RSI.
📊 Key Levels:
Overbought (>80) – Possible bearish reversal.
Oversold (<20) – Possible bullish reversal.
Mid Line (50) – Represents trend equilibrium.
✅ 2. Volume Spread Analysis (VSA)
VSA helps identify volume spikes and institutional moves:
🟢 Selling Climax (High volume + bearish trend) → Buy Signal.
🔴 Buying Climax (High volume + bullish trend) → Sell Signal.
🟣 Institutional Liquidation (Extremely high volume) → Signal Reversal.
If a volume spike surpasses the threshold, signals may be reversed to capture market manipulation.
✅ 3. Divergences (Bullish & Bearish)
Divergences indicate trend weakness and potential reversals:
🟢 Bullish Divergence: Price makes a lower low, but the oscillator makes a higher low → Buy Signal.
🔴 Bearish Divergence: Price makes a higher high, but the oscillator makes a lower high → Sell Signal.
The indicator automatically draws divergence lines on the chart.
✅ 4. Oscillator Channels
The oscillator uses a statistical channel to identify tops and bottoms.
If the oscillator touches the upper band, it may indicate a market top.
If it touches the lower band, it may indicate a market bottom.
🎯 Entry & Exit Signals
🟢 Buy Signals
✔️ Oscillator crosses above 50 (bullish trend) with high volume.
✔️ Bullish divergence detected.
✔️ VSA identifies institutional liquidation (Selling Climax).
🔴 Sell Signals
✔️ Oscillator crosses below 50 (bearish trend) with high volume.
✔️ Bearish divergence detected.
✔️ VSA identifies institutional liquidation (Buying Climax).
📊 Integrated Backtest
This indicator allows users to automatically backtest strategies in historical data:
✅ Configurable Take Profit (TP) and Stop Loss (SL).
✅ Backtest mode: Buy Only, Sell Only, or Both.
✅ Detailed statistics: Win Rate, Average Profit, Average Loss, Final Balance.
🟢 A full backtest report is automatically generated on the screen.
⚠️ Disclaimer
This indicator is designed for educational purposes only and does not constitute financial advice. The use of this indicator in real trading is solely the user’s responsibility. Trading involves risk and may result in financial losses.
Buy on VolumeThis script has several weaknesses:
1. **Overly Simplistic Logic** – The buy signal is based on just two conditions (DEMA crossing above a Lorentzian Line and a volume spike), which may not be robust enough for real trading conditions.
2. **Lack of Sell Signals** – The script only focuses on buy signals without any exit strategy, making it incomplete for practical trading.
3. **Volume Confirmation May Be Unreliable** – The threshold for volume confirmation (50% above average) is arbitrary and may produce frequent false positives or fail in low-liquidity conditions.
4. **No Risk Management** – There is no stop-loss, take-profit, or risk-adjustment mechanism, making it unsuitable for serious trading.
5. **Potential for Late Entries** – The reliance on moving averages (DEMA) can introduce lag, causing buy signals to appear late after a price move has already occurred.
6. **Limited Adaptability** – The fixed parameter settings (e.g., DEMA period of 6, Lorentzian length of 21) may not work across different market conditions or assets.
7. **No Consideration for Market Trends** – The script does not account for broader market trends, which could lead to poor entries in bearish conditions.
8. **Visual Clutter** – The plotted signals and indicators might create unnecessary chart noise, making it difficult to analyze price action effectively.
9. **Alert Spam Potential** – Without additional filtering conditions, the script may trigger frequent buy alerts, leading to signal fatigue.
Trend-Based Price Forecast with CurvesПрогноз движения цены на основании истории. Использовать на ТФ 1D/4H
Stema sau Banul📜 Povestea Indicatorului „Stema sau Banul” 🎲💰
În vremuri de demult, când piețele financiare erau dominate de strategii complexe și analiști îmbrăcați în costume scumpe, un investitor legendar pe nume Maestrul Stemei și-a pus o întrebare simplă:
👉 „Dacă oricum piețele sunt imprevizibile, de ce să nu lăsăm soarta să decidă?”
Astfel, într-o noapte ploioasă, în fața unui birou plin de grafice și lumânări roșii și verzi, Maestrul Stemei a luat o monedă veche de aur și a început să o arunce.
Dacă ieșea Stema, el cumpăra.
Dacă ieșea Banul, vindea fără ezitare.
Spre uimirea tuturor, strategia sa pur aleatorie a început să rivalizeze cu cele mai sofisticate modele matematice. Traderii de pe Wall Street îl priveau cu neîncredere, iar roboții de tranzacționare încercau să-l copieze. Dar nimeni nu putea egala simplitatea filozofiei sale: „Lasă banul să vorbească”.
Astăzi, moștenirea Maestrului Stemei continuă prin acest indicator, care îți oferă semnale bazate pe vechea metodă a aruncării monedei. Va fi norocul de partea ta? Sau vei blestema ziua în care ai ascultat de un cod care decide aleatoriu? 🎲
💡 Regulă de aur:
➡ Dacă pierzi, spune că e doar o glumă.
➡ Dacă câștigi, pretinde că ai descoperit un algoritm revoluționar.
Acum, Stema sau Banul îți stă la dispoziție! 🎩📈
Cup and Handle Detector amit mizrahi//@version=5
indicator("Cup and Handle Detector", overlay=true)
// פונקציה לזיהוי תחתית
findBottom(lookback) =>
ta.lowest(low, lookback)
// פונקציה לזיהוי תקרה
findTop(lookback) =>
ta.highest(high, lookback)
// פרמטרים לזיהוי המבנה
lookbackCup = 50 // מספר נרות אחורה לבדוק את הקאפ
lookbackHandle = 15 // מספר נרות לבדוק את הידית
// חישוב תחתית ותקרה של הקאפ
bottom = findBottom(lookbackCup)
top = findTop(lookbackCup)
// זיהוי הידית – המחיר צריך לרדת לאחר התקרה ואז להתקדם למעלה
handleStart = close
handleCondition = handleStart > bottom and handleStart < top
// זיהוי פריצה מעל התקרה
breakout = close > top
// תנאי לזיהוי Cup and Handle תקף
cupAndHandlePattern = handleCondition and breakout
// ציור קווים לחלקי התבנית
var line cupBottomLine = na
var line cupTopLine = na
var line handleLine = na
if cupAndHandlePattern
cupBottomLine := line.new(x1=bar_index - lookbackCup, y1=bottom, x2=bar_index, y2=bottom, width=2, color=color.blue)
cupTopLine := line.new(x1=bar_index - lookbackCup, y1=top, x2=bar_index, y2=top, width=2, color=color.green)
handleLine := line.new(x1=bar_index - lookbackHandle, y1=handleStart, x2=bar_index, y2=handleStart, width=2, color=color.red)
// ציור סמיילי על התקרה
plotshape(cupAndHandlePattern, location=location.abovebar, style=shape.labelup, color=color.yellow, size=size.small, title="Cup & Handle", text="😊")
// שליחת התראה
alertcondition(cupAndHandlePattern, title="Cup and Handle Detected", message="דפוס Cup and Handle זוהה!")
Full Moon and New Moon IndicatorThe Full Moon & New Moon Indicator is a custom Pine Script indicator which marks Full Moon (Pournami) and New Moon (Amavasya) events on the price chart. This indicator helps traders who incorporate lunar cycles into their market analysis, as certain traders believe these cycles influence market sentiment and price action. The current script is added for the year 2024 and 2025 and the dates are considered as per the Telugu calendar.
Features
✅ Identifies and labels Full Moon & New Moon days on the chart for the year 2024 and 2025
How it Works!
On a Full Moon day, it places a yellow label ("Pournami") above the corresponding candle.
On a New Moon day, it places a blue label ("Amavasya") above the corresponding candle.
Example Usage
When a Full Moon label appears, check for potential trend reversals or high volatility.
When a New Moon label appears, watch for market consolidation or a shift in sentiment.
Combine with candlestick patterns, support/resistance, or momentum indicators for a stronger trading setup.
🚀 Add this indicator to your TradingView chart and explore the market’s reaction to lunar cycles! 🌕
US 20Y Treasury YieldWhat This Indicator Does
This Pine Script creates a custom indicator for TradingView that displays the US 20-Year Treasury Yield (US20Y) on your chart. Here's what it does step by step:
1. What Is the US 20-Year Treasury Yield?
The US 20-Year Treasury Yield is a financial metric that shows the interest rate (or yield) investors earn when they buy US government bonds that mature in 20 years. It’s an important indicator of the economy and can influence other markets like stocks, bonds, and currencies.
2. How Does the Indicator Work?
The indicator fetches the latest data for the US 20-Year Treasury Yield from TradingView's database.
It then plots this data in a separate pane below your main chart, so you can easily monitor the yield without cluttering your price chart.
3. What Does the Indicator Show?
A blue line is drawn in the separate pane, showing the movement of the US 20-Year Treasury Yield over time.
A gray dashed line is added at the 4.0% level as a reference point. You can use this line to quickly see when the yield is above or below 4.0%.
5. Why Use This Indicator?
Monitor Economic Trends : The US 20-Year Treasury Yield is a key economic indicator. By plotting it on your chart, you can stay informed about changes in interest rates and their potential impact on other markets.
My scriptKey Enhancements:
Stop Loss and Take Profit:
We added inputs for Stop Loss and Take Profit percentages. You can modify these values as per your strategy. For example, if you set the Stop Loss to 1% and the Take Profit to 2%, the strategy will automatically place orders to close a position at those levels.
Exit Logic:
The strategy exits the long position either when the Change of Character occurs (bearish signal) or when the price hits the Stop Loss or Take Profit levels.
Plotting Levels:
We visually plot the Stop Loss and Take Profit levels on the chart to help you better understand where the strategy is placing these levels.
Strategy Performance:
By including exit conditions based on both Stop Loss and Take Profit, we can better assess the profitability of the strategy.
TradingView automatically calculates performance metrics such as Net Profit, Profit Factor, Win Rate, Drawdown, and others in the Strategy Tester panel.
How to Evaluate Profitability:
Apply the Script:
Copy the updated code into TradingView's Pine Script Editor and click Add to Chart.
View Performance Metrics:
After applying the strategy, click on the Strategy Tester tab below the chart.
In this tab, you will see various metrics such as Net Profit, Max Drawdown, Win Rate, Profit Factor, etc.
Optimize Parameters:
You can adjust the lookback, stopLossPct, and takeProfitPct parameters in the script to optimize the strategy for better profitability. You can use TradingView's built-in strategy optimization tools to backtest different combinations.
Interpret Results:
The Profit Factor measures how many dollars you earned for each dollar lost. A value greater than 1 indicates a profitable strategy.
The Win Rate indicates how often the strategy wins, while the Net Profit shows how much profit you made over the backtest period.
The Max Drawdown helps you understand the worst peak-to-trough loss during the backtest period.
Key Strategy Performance Metrics:
Net Profit: The total profit or loss generated by the strategy.
Profit Factor: The ratio of gross profit to gross loss. A profit factor above 1 indicates profitability.
Win Rate: The percentage of winning trades in the backtest.
Max Drawdown: The largest peak-to-trough loss, indicating the strategy's risk during a drawdown.
Example Adjustments:
You can fine-tune the strategy by adjusting parameters, such as:
Lookback Period: If the market is more volatile, you might reduce the lookback to identify structure changes more quickly.
Stop Loss/Take Profit: The Stop Loss and Take Profit levels can be adjusted based on your risk tolerance and market conditions.
Next Steps:
If you want to explore further, consider adding more advanced features, like:
Volume Analysis: Include volume to confirm the CoC (e.g., high volume on a reversal).
Time-of-day Filter: Trade only during certain hours when the market is more volatile.
Trend Confirmation: Use higher timeframe trend indicators to filter trades.
This enhanced version should give you a better understanding of the profitability and overall effectiveness of a Change of Character strategy based on Smart Money Concepts. Let me know if you'd like further refinements or help with interpreting the results!
Greedy Strategy 20 10 4 – High-Accuracy BTC/USD The Greedy Strategy 20 10 4 is a high-performance BTC/USD trading strategy designed for traders who seek high win rates and low risk exposure. This strategy leverages price action, volatility analysis, and trend-following indicators to generate accurate buy and sell signals...High Win Rate (90%) – Optimized for consistent profitability
✅ Smart Entry & Exit – Uses adaptive algorithms for precise trade timing
✅ Risk-Managed Drawdown (0.00%) – Ensures capital protection
✅ Works on 15-Minute BTC/USD Charts – Optimized for short-term traders.📊 Backtest Performance (Jan 2025 – Feb 2025)
Net Profit: $6,091.90 USD (0.61% per trade)
Total Trades: 10
Win Rate: 90%
Profit Factor: 92.9 (Very high)
Max Drawdown: $1.00 USD (0.00%)
Avg Trade Profit: $609.19 per trade.
free to use if you would like. Thank you.
BTC Cash And Carry Arbitrage compare month 6 by SeoNo1Add a calculation table for Bitcoin Cash and Carry Arbitrage comparing Month 6 to the top right of the chart, displaying the Spread and APY values clearly for easy strategy execution.
[COG]StochRSI Zenith📊 StochRSI Zenith
This indicator combines the traditional Stochastic RSI with enhanced visualization features and multi-timeframe analysis capabilities. It's designed to provide traders with a comprehensive view of market conditions through various technical components.
🔑 Key Features:
• Advanced StochRSI Implementation
- Customizable RSI and Stochastic calculation periods
- Multiple moving average type options (SMA, EMA, SMMA, LWMA)
- Adjustable signal line parameters
• Visual Enhancement System
- Dynamic wave effect visualization
- Energy field display for momentum visualization
- Customizable color schemes for bullish and bearish signals
- Adaptive transparency settings
• Multi-Timeframe Analysis
- Higher timeframe confirmation
- Synchronized market structure analysis
- Cross-timeframe signal validation
• Divergence Detection
- Automated bullish and bearish divergence identification
- Customizable lookback period
- Clear visual signals for confirmed divergences
• Signal Generation Framework
- Price action confirmation
- SMA-based trend filtering
- Multiple confirmation levels for reduced noise
- Clear entry signals with customizable display options
📈 Technical Components:
1. Core Oscillator
- Base calculation: 13-period RSI (adjustable)
- Stochastic calculation: 8-period (adjustable)
- Signal lines: 5,3 smoothing (adjustable)
2. Visual Systems
- Wave effect with three layers of visualization
- Energy field display with dynamic intensity
- Reference bands at 20/30/50/70/80 levels
3. Confirmation Mechanisms
- SMA trend filter
- Higher timeframe alignment
- Price action validation
- Divergence confirmation
⚙️ Customization Options:
• Visual Parameters
- Wave effect intensity and speed
- Energy field sensitivity
- Color schemes for bullish/bearish signals
- Signal display preferences
• Technical Parameters
- All core calculation periods
- Moving average types
- Divergence detection settings
- Signal confirmation criteria
• Display Settings
- Chart and indicator signal placement
- SMA line visualization
- Background highlighting options
- Label positioning and size
🔍 Technical Implementation:
The indicator combines several advanced techniques to generate signals. Here are key components with code examples:
1. Core StochRSI Calculation:
// Base RSI calculation
rsi = ta.rsi(close, rsi_length)
// StochRSI transformation
stochRSI = ((ta.highest(rsi, stoch_length) - ta.lowest(rsi, stoch_length)) != 0) ?
(100 * (rsi - ta.lowest(rsi, stoch_length))) /
(ta.highest(rsi, stoch_length) - ta.lowest(rsi, stoch_length)) : 0
2. Signal Generation System:
// Core signal conditions
crossover_buy = crossOver(sk, sd, cross_threshold)
valid_buy_zone = sk < 30 and sd < 30
price_within_sma_bands = close <= sma_high and close >= sma_low
// Enhanced signal generation
if crossover_buy and valid_buy_zone and price_within_sma_bands and htf_allows_long
if is_bullish_candle
long_signal := true
else
awaiting_bull_confirmation := true
3. Multi-Timeframe Analysis:
= request.security(syminfo.tickerid, mtf_period,
)
The HTF filter looks at a higher timeframe (default: 4H) to confirm the trend
It only allows:
Long trades when the higher timeframe is bullish
Short trades when the higher timeframe is bearish
📈 Trading Application Guide:
1. Signal Identification
• Oversold Opportunities (< 30 level)
- Look for bullish crosses of K-line above D-line
- Confirm with higher timeframe alignment
- Wait for price action confirmation (bullish candle)
• Overbought Conditions (> 70 level)
- Watch for bearish crosses of K-line below D-line
- Verify higher timeframe condition
- Confirm with bearish price action
2. Divergence Trading
• Bullish Divergence
- Price makes lower lows while indicator makes higher lows
- Most effective when occurring in oversold territory
- Use with support levels for entry timing
• Bearish Divergence
- Price makes higher highs while indicator shows lower highs
- Most reliable in overbought conditions
- Combine with resistance levels
3. Wave Effect Analysis
• Strong Waves
- Multiple wave lines moving in same direction indicate momentum
- Wider wave spread suggests increased volatility
- Use for trend strength confirmation
• Energy Field
- Higher intensity in trading zones suggests stronger moves
- Use for momentum confirmation
- Watch for energy field convergence with price action
The energy field is like a heat map that shows momentum strength
It gets stronger (more visible) when:
Price is in oversold (<30) or overbought (>70) zones
The indicator lines are moving apart quickly
A strong signal is forming
Think of it as a "strength meter" - the more visible the energy field, the stronger the potential move
4. Risk Management Integration
• Entry Confirmation
- Wait for all signal components to align
- Use higher timeframe for trend direction
- Confirm with price action and SMA positions
• Stop Loss Placement
- Consider placing stops beyond recent swing points
- Use ATR for dynamic stop calculation
- Account for market volatility
5. Position Management
• Partial Profit Taking
- Consider scaling out at overbought/oversold levels
- Use wave effect intensity for exit timing
- Monitor energy field for momentum shifts
• Trade Duration
- Short-term: Use primary signals in trading zones
- Swing trades: Focus on divergence signals
- Position trades: Utilize higher timeframe signals
⚠️ Important Usage Notes:
• Avoid:
- Trading against strong trends
- Relying solely on single signals
- Ignoring higher timeframe context
- Over-leveraging based on signals
Remember: This tool is designed to assist in analysis but should never be used as the sole decision-maker for trades. Always maintain proper risk management and combine with other forms of analysis.
[SHORT ONLY] 10 Bar Low Pullback█ STRATEGY DESCRIPTION
The "10 Bar Low Pullback" strategy is a contrarian short trading system designed to capture pullbacks after a new 10‐bar low is made. it identifies a potential short opportunity when the current bar’s low breaks below the lowest low of the previous 10 bars, provided that the bar exhibits strong internal momentum as measured by its IBS value. An optional trend filter further refines entries by requiring that the close is below a 200-period EMA.
█ WHAT IS INTERNAL BAR STRENGTH (IBS)?
Internal Bar Strength (IBS) measures where the closing price falls within the high-low range of a bar. It is calculated as:
ibs = (close - low) / (high - low)
- Low IBS (≤ 0.2): Indicates the close is near the bar's low, suggesting oversold conditions.
- High IBS (≥ 0.8): Indicates the close is near the bar's high, suggesting overbought conditions.
█ SIGNAL GENERATION
1. SHORT ENTRY
A Short Signal is triggered when:
The current bar’s low is below the lowest low of the past X bars (default: 10).
The bar’s IBS is greater than the specified threshold (default: 0.85).
The signal occurs within the defined trading window (between Start Time and End Time).
If the EMA Filter is enabled, the close must be below the 200-period EMA.
2. EXIT CONDITION
An exit Signal is generated when the current close falls below the previous bar’s low (close < low ), indicating a potential bearish reversal and prompting the strategy to close its short position.
█ ADDITIONAL SETTINGS
Lookback Period: Defines the number of bars (default is 10) over which the lowest low is calculated.
IBS Threshold: Sets the minimum required IBS value (default is 0.85) to qualify as a pullback.
Trading Window: Trades are only executed between the user-defined Start Time and End Time.
EMA Filter (Optional): When enabled, short entries are only considered if the current close is below the 200-period EMA, with the EMA period being adjustable (default is 200).
█ PERFORMANCE OVERVIEW
Designed for shorting opportunities, this strategy aims to capture pullbacks following an aggressive 10-bar low break.
It leverages a combination of a lookback low and IBS measurement to identify overextended bullish moves that may revert.
The optional EMA filter helps confirm a bearish market environment by ensuring the price remains under the trend line.
Suitable for use on various assets, including stocks and ETFs, on daily or similar timeframes.
Backtesting and parameter optimization are recommended to tailor the strategy to specific market conditions.
[SHORT ONLY] ATR Sell the Rip Mean Reversion Strategy█ STRATEGY DESCRIPTION
The "ATR Sell the Rip Mean Reversion Strategy" is a contrarian system that targets overextended price moves on stocks and ETFs. It calculates an ATR‐based trigger level to identify shorting opportunities. When the current close exceeds this smoothed ATR trigger, and if the close is below a 200-period EMA (if enabled), the strategy initiates a short entry, aiming to profit from an anticipated corrective pullback.
█ HOW IS THE ATR SIGNAL BAND CALCULATED?
This strategy computes an ATR-based signal trigger as follows:
Calculate the ATR
The strategy computes the Average True Range (ATR) using a configurable period provided by the user:
atrValue = ta.atr(atrPeriod)
Determine the Threshold
Multiply the ATR by a predefined multiplier and add it to the current close:
atrThreshold = close + atrValue * atrMultInput
Smooth the Threshold
Apply a Simple Moving Average over a specified period to smooth out the threshold, reducing noise:
signalTrigger = ta.sma(atrThreshold, smoothPeriodInput)
█ SIGNAL GENERATION
1. SHORT ENTRY
A Short Signal is triggered when:
The current close is above the smoothed ATR signal trigger.
The trade occurs within the specified trading window (between Start Time and End Time).
If the EMA filter is enabled, the close must also be below the 200-period EMA.
2. EXIT CONDITION
An exit Signal is generated when the current close falls below the previous bar’s low (close < low ), indicating a potential bearish reversal and prompting the strategy to close its short position.
█ ADDITIONAL SETTINGS
ATR Period: The period used to calculate the ATR, allowing for adaptability to different volatility conditions (default is 20).
ATR Multiplier: The multiplier applied to the ATR to determine the raw threshold (default is 1.0).
Smoothing Period: The period over which the raw ATR threshold is smoothed using an SMA (default is 10).
Start Time and End Time: Defines the time window during which trades are allowed.
EMA Filter (Optional): When enabled, short entries are only executed if the current close is below the 200-period EMA, confirming a bearish trend.
█ PERFORMANCE OVERVIEW
This strategy is designed for use on the Daily timeframe, targeting stocks and ETFs by capitalizing on overextended price moves.
It utilizes a dynamic, ATR-based trigger to identify when prices have potentially peaked, setting the stage for a mean reversion short entry.
The optional EMA filter helps align trades with broader market trends, potentially reducing false signals.
Backtesting is recommended to fine-tune the ATR multiplier, smoothing period, and EMA settings to match the volatility and behavior of specific markets.
[SHORT ONLY] Consecutive Bars Above MA Strategy█ STRATEGY DESCRIPTION
The "Consecutive Bars Above MA Strategy" is a contrarian trading system aimed at exploiting overextended bullish moves in stocks and ETFs. It monitors the number of consecutive bars that close above a chosen short-term moving average (which can be either a Simple Moving Average or an Exponential Moving Average). Once the count reaches a preset threshold and the current bar’s close exceeds the previous bar’s high within a designated trading window, a short entry is initiated. An optional EMA filter further refines entries by requiring that the current close is below the 200-period EMA, helping to ensure that trades are taken in a bearish environment.
█ HOW ARE THE CONSECUTIVE BULLISH COUNTS CALCULATED?
The strategy utilizes a counter variable, `bullCount`, to track consecutive bullish bars based on their relation to the short-term moving average. Here’s how the count is determined:
Initialize the Counter
The counter is initialized at the start:
var int bullCount = na
Bullish Bar Detection
For each bar, if the close is above the selected moving average (either SMA or EMA, based on user input), the counter is incremented:
bullCount := close > signalMa ? (na(bullCount) ? 1 : bullCount + 1) : 0
Reset on Non-Bullish Condition
If the close does not exceed the moving average, the counter resets to zero, indicating a break in the consecutive bullish streak.
█ SIGNAL GENERATION
1. SHORT ENTRY
A short signal is generated when:
The number of consecutive bullish bars (i.e., bars closing above the short-term MA) meets or exceeds the defined threshold (default: 3).
The current bar’s close is higher than the previous bar’s high.
The signal occurs within the specified trading window (between Start Time and End Time).
Additionally, if the EMA filter is enabled, the entry is only executed when the current close is below the 200-period EMA.
2. EXIT CONDITION
An exit signal is triggered when the current close falls below the previous bar’s low, prompting the strategy to close the short position.
█ ADDITIONAL SETTINGS
Threshold: The number of consecutive bullish bars required to trigger a short entry (default is 3).
Trading Window: The Start Time and End Time inputs define when the strategy is active.
Moving Average Settings: Choose between SMA and EMA, and set the MA length (default is 5), which is used to assess each bar’s bullish condition.
EMA Filter (Optional): When enabled, this filter requires that the current close is below the 200-period EMA, supporting entries in a downtrend.
█ PERFORMANCE OVERVIEW
This strategy is designed for stocks and ETFs and can be applied across various timeframes.
It seeks to capture mean reversion by shorting after a series of bullish bars suggests an overextended move.
The approach employs a contrarian short entry by waiting for a breakout (close > previous high) following consecutive bullish bars.
The adjustable moving average settings and optional EMA filter allow for further optimization based on market conditions.
Comprehensive backtesting is recommended to fine-tune the threshold, moving average parameters, and filter settings for optimal performance.
[SHORT ONLY] Consecutive Close>High[1] Mean Reversion Strategy█ STRATEGY DESCRIPTION
The "Consecutive Close > High " Mean Reversion Strategy is a contrarian daily trading system for stocks and ETFs. It identifies potential shorting opportunities by counting consecutive days where the closing price exceeds the previous day's high. When this consecutive day count reaches a predetermined threshold, and if the close is below a 200-period EMA (if enabled), a short entry is triggered, anticipating a corrective pullback.
█ HOW ARE THE CONSECUTIVE BULLISH COUNTS CALCULATED?
The strategy uses a counter variable called `bullCount` to track how many consecutive bars meet a bullish condition. Here’s a breakdown of the process:
Initialize the Counter
var int bullCount = 0
Bullish Bar Detection
Every time the close exceeds the previous bar's high, increment the counter:
if close > high
bullCount += 1
Reset on Bearish Bar
When there is a clear bearish reversal, the counter is reset to zero:
if close < low
bullCount := 0
█ SIGNAL GENERATION
1. SHORT ENTRY
A Short Signal is triggered when:
The count of consecutive bullish closes (where close > high ) reaches or exceeds the defined threshold (default: 3).
The signal occurs within the specified trading window (between Start Time and End Time).
2. EXIT CONDITION
An exit Signal is generated when the current close falls below the previous bar’s low (close < low ), prompting the strategy to exit the position.
█ ADDITIONAL SETTINGS
Threshold: The number of consecutive bullish closes required to trigger a short entry (default is 3).
Start Time and End Time: The time window during which the strategy is allowed to execute trades.
EMA Filter (Optional): When enabled, short entries are only triggered if the current close is below the 200-period EMA.
█ PERFORMANCE OVERVIEW
This strategy is designed for Stocks and ETFs on the Daily timeframe and targets overextended bullish moves.
It aims to capture mean reversion by entering short after a series of consecutive bullish closes.
Further optimization is possible with additional filters (e.g., EMA, volume, or volatility).
Backtesting should be used to fine-tune the threshold and filter settings for specific market conditions.
[SHORT ONLY] Internal Bar Strength (IBS) Mean Reversion Strategy█ STRATEGY DESCRIPTION
The "Internal Bar Strength (IBS) Strategy" is a mean-reversion strategy designed to identify trading opportunities based on the closing price's position within the daily price range. It enters a short position when the IBS indicates overbought conditions and exits when the IBS reaches oversold levels. This strategy is Short-Only and was designed to be used on the Daily timeframe for Stocks and ETFs.
█ WHAT IS INTERNAL BAR STRENGTH (IBS)?
Internal Bar Strength (IBS) measures where the closing price falls within the high-low range of a bar. It is calculated as:
IBS = (Close - Low) / (High - Low)
- Low IBS (≤ 0.2) : Indicates the close is near the bar's low, suggesting oversold conditions.
- High IBS (≥ 0.8) : Indicates the close is near the bar's high, suggesting overbought conditions.
█ SIGNAL GENERATION
1. SHORT ENTRY
A Short Signal is triggered when:
The IBS value rises to or above the Upper Threshold (default: 0.9).
The Closing price is greater than the previous bars High (close>high ).
The signal occurs within the specified time window (between `Start Time` and `End Time`).
2. EXIT CONDITION
An exit Signal is generated when the IBS value drops to or below the Lower Threshold (default: 0.3). This prompts the strategy to exit the position.
█ ADDITIONAL SETTINGS
Upper Threshold: The IBS level at which the strategy enters trades. Default is 0.9.
Lower Threshold: The IBS level at which the strategy exits short positions. Default is 0.3.
Start Time and End Time: The time window during which the strategy is allowed to execute trades.
█ PERFORMANCE OVERVIEW
This strategy is designed for Stocks and ETFs markets and performs best when prices frequently revert to the mean.
The strategy can be optimized further using additional conditions such as using volume or volatility filters.
It is sensitive to extreme IBS values, which help identify potential reversals.
Backtesting results should be analyzed to optimize the Upper/Lower Thresholds for specific instruments and market conditions.
IPO Date ScreenerThis script, the IPO Date Screener, allows traders to visually identify stocks that are relatively new, based on the number of bars (days) since their IPO. The user can set a custom threshold for the number of days (bars) after the IPO, and the script will highlight new stocks that fall below that threshold.
Key Features:
Customizable IPO Days Threshold: Set the threshold for considering a stock as "new." Since Pine screener limits number bars to 500, it will work for stocks having trading days below 500 since IPO which almost 2 years.
Column Days since IPO: Sort this column from low to high to see newest to oldest STOCK with 500 days of trading.
Since a watchlist is limited to 1000 stocks, use this pines script to screen stocks within the watch list having trading days below 500 or user can select lower number of days from settings.
This is not helpful to add on chart, this is to use on pine screener as utility.
2xSPYTIPS Strategy by Fra public versionThis is a test strategy with S&P500, open source so everyone can suggest everything, I'm open to any advice.
Rules of the "2xSPYTIPS" Strategy :
This trading strategy is designed to operate on the S&P 500 index and the TIPS ETF. Here’s how it works:
1. Buy Conditions ("BUY"):
- The S&P 500 must be above its **200-day simple moving average (SMA 200)**.
- This condition is checked at the **end of each month**.
2. Position Management:
- If leverage is enabled (**2x leverage**), the purchase quantity is increased based on a configurable percentage.
3. Take Profit:
- A **Take Profit** is set at a fixed percentage above the entry price.
4. Visualization & Alerts:
- The **SMA 200** for both S&P 500 and TIPS is plotted on the chart.
- A **BUY signal** appears visually and an alert is triggered.
What This Strategy Does NOT Do
- It does not use a **Stop Loss** or **Trailing Stop**.
- It does not directly manage position exits except through Take Profit.