EMA Crossover Strategy (15m)50 and 200 ema crossing when leaving anchor. when 50 and 200 crosses will give you direction of where market is going. wait for a pull back and take trade. sl on highest or lowest point of apex tp open . when you see multiple equal ( low or High) get put of trade.
Cari dalam skrip untuk "北证50+股票+新浪财经"
The Lazy Trader - Index (ETF) Trend Following Robot50/150 moving average, index (ETF) trend following robot. Coded for people who cannot psychologically handle dollar-cost-averaging through bear markets and extreme drawdowns (although DCA can produce better results eventually), this robot helps you to avoid bear markets. Be a fair-weathered friend of Mr Market, and only take up his offer when the sun is shining! Designed for the lazy trader who really doesn't care...
Recommended Chart Settings:
Asset Class: ETF
Time Frame: Daily
Necessary ETF Macro Conditions:
a) Country must have healthy demographics, good ratio of young > old
b) Country population must be increasing
c) Country must be experiencing price-inflation
Default Robot Settings:
Slow Moving Average: 50 (integer) //adjust to suit your underlying index
Fast Moving Average: 150 (integer) //adjust to suit your underlying index
Bullish Slope Angle: 5 (degrees) //up angle of moving averages
Bearish Slope Angle: -5 (degrees) //down angle of moving averages
Average True Range: 14 (integer) //input for slope-angle formula
Risk: 100 (%) //100% risk means using all equity per trade
ETF Test Results (Default Settings):
SPY (1993 to 2020, 27 years), 332% profit, 20 trades, 6.4 profit factor, 7% drawdown
EWG (1996 to 2020, 24 years), 310% profit, 18 trades, 3.7 profit factor, 10% drawdown
EWH (1996 to 2020, 24 years), 4% loss, 26 trades, 0.9 profit factor, 36% drawdown
QQQ (1999 to 2020, 21 years), 232% profit, 17 trades, 3.6 profit factor, 2% drawdown
EEM (2003 to 2020, 17 years), 73% profit, 17 trades, 1.1 profit factor, 3% drawdown
GXC (2007 to 2020, 13 years), 18% profit, 14 trades, 1.3 profit factor, 26% drawdown
BKF (2009 to 2020, 11 years), 11% profit, 13 trades, 1.2 profit factor, 33% drawdown
A longer time in the markets is better, with the exception of EWH. 6 out of 7 tested ETFs were profitable, feel free to test on your favourite ETF (default settings) and comment below.
Risk Warning:
Not tested on commodities nor other financial products like currencies (code will not work), feel free to leave comments below.
Moving Average Slope Angle Formula:
Reproduced and modified from source:
50 & 200 SMA + RSI Average Strategy (Long Only, Single Trade)It works better in trending markets. It delivers its best performance in the 4-hour to 1-day timeframes.
50-Minute Opening Range BreakoutThis is a test of the opening range with Bearish/Bullish confirmation
50-Line Oscillator // (\_/)
// ( •.•)
// (")_(")
25-Line Oscillator
Description:
The 25-Line Oscillator is a sophisticated technical analysis tool designed to visualize market trends through the use of multiple Simple Moving Averages (SMAs). This indicator computes a series of 26 SMAs, incrementally increasing the base length, providing traders with a comprehensive view of price dynamics.
Features:
Customizable Base Length: Adjust the base length of the SMAs according to trading preferences, enhancing versatility for different market conditions.
Rainbow Effect: The indicator employs a visually appealing rainbow color scheme to differentiate between the various trend lines, making it easy to identify crossovers and momentum shifts.
Crossovers Detection: The script includes logic to detect crossover events between consecutive trend lines, which can serve as signals for potential entry or exit points in trading.
Clear Visualization: Suitable for both novice and seasoned traders, the plots enable quick interpretation of trends and market behavior.
How to Use:
Add the indicator to your chart and customize the base length as desired.
Observe the rainbow-colored lines for trend direction.
Look for crossover events between the SMAs as potential trading signals.
Application: This indicator is particularly useful for swing traders and trend followers who aim to capitalize on market momentum and identify reversals. By monitoring the behavior of multiple SMAs, traders can gain insights into the strength and direction of price movements over various time frames.
AK Simple Moving Average 50 days Simple Moving average suitable for Intraday on 1Hr,30Min.15Min Time frames
1. When candle crossing above SMA Line - Go for Long Entries
2. When candle crossing below SMA Line - Go for short Entries
50 SMA / 200 EMA / 128EMA Moving Average CrossFound success using 50SMA vs 200EMA.
128 EMA also charted for it's BTC relevance.
50/100/200 Moving Averages (Pine Script For Copy)by fresca
SCRIPT LANGUAGE
Copy script below and adjust based on your preferences.
-function (change function from "sma" to "ema", "wma" and more)
-length (25 Day, 150 Day or add more averages to the three in this script.)
-color, (red, yellow, etc. or use color hex codes i.e. #FEDA15, #FFAD8F, etc.)
-transparency (set to desired level 1-100)
Or add more options.
RESOURCES
Color hex codes site: www.canva.com
Trading View Pine Script Editor Reference Guide: www.tradingview.com
Taint's Multi Time Frame MA50-100-200 SMA with two 200 EMA's all with the ability choose a time frame for each.
Z-EMA Fusion BandsDesigned with crypto markets in mind, particularly Bitcoin , it builds on the concept that the 1-Week 50 EMA often serves as a long-term bull/bear market threshold — an area where institutional bias, momentum shifts, and cyclical rotations tend to occur.
🔹 Core Components & Synergies:
1. 1W 50 EMA (Higher Timeframe)
- This EMA is calculated on a weekly timeframe, regardless of your current chart.
- In crypto, price above the 1W 50 EMA typically aligns with long-term bull market phases, while extended periods below can signify bearish macro structure.
- The slope of the EMA is also analyzed to add directional confidence to trend strength.
2. ±1 Standard Deviation Bands
- Surrounding the 50 EMA, these bands visualize normal price dispersion relative to trend.
- When price consistently hugs or breaks outside these bands, it often reflects market expansion, volatility events, or mean-reversion opportunity.
3. Z-Score Gradient Fill
- The area between the bands is filled using a Z-score-based gradient, which dynamically adjusts color based on how far price is from the EMA (in terms of standard deviations).
- Color shifts from aqua (near EMA) to fuchsia (far from EMA) help you spot price compression, equilibrium, or overextension at a glance.
- The fill also uses transparency scaling, making it fade as price stretches further, emphasizing the core structure.
4. Directional EMA Coloring
- The EMA line itself is colored based on:
- The slope of the EMA (rising/falling)
- Whether the HTF candle is bullish or bearish
- This provides intuitive color-coded confirmation of momentum alignment or potential exhaustion.
5. Price/EMA Divergence Detection
- The script detects bullish and bearish divergence between price and the EMA (rather than using a traditional oscillator).
- Bullish Divergence: Price makes a lower low, EMA makes a higher low.
- Bearish Divergence: Price makes a higher high, EMA makes a lower high.
- These signals often mark transitional zones where momentum fades before a trend reversal or correction.
📊 Suggested Uses:
🔸 Swing and Position Trading:
- Use the 1W 50 EMA as a macro-trend anchor.
- Stay long-biased when price is above with positive slope, and short-biased when below.
- Consider entries near band edges for mean-reversion plays, especially if confluence forms with divergence signals.
🔸 Volatility-Based Filtering:
- Use the Z-score fill to identify volatility compression (near EMA) or expansion (edge of bands).
- Combine this with breakout strategies or dynamic position sizing.
🔸 Divergence Confirmation:
- Combine divergence markers with HTF EMA slope for high-probability setups.
- Bullish div + EMA flattening/rising can signal the start of accumulation after a macro dip.
🔸 Multi-Timeframe Analysis:
- Works well as a structural overlay on intraday charts (1H, 4H, 1D).
- Use this indicator to track long-term bias while executing lower timeframe trades.
⚠️ Disclaimer:
This indicator is designed for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any asset.
Always use proper risk management, and combine with your own analysis, tools, and strategy. Performance in past market conditions does not guarantee future results.
Dynamic Ratchet Trend Strategy [VIX Filter]Overview This strategy is a long-only trend-following system designed to capture major market moves while strictly managing downside risk through a state-machine based "Ratchet" exit logic. It incorporates a volatility filter using the CBOE VIX index to stay out of (or exit) the market during high-stress environments.
Key Features
1. Multi-Condition Entries The strategy looks for momentum shifts and trend breakouts using four Simple Moving Averages (25, 50, 100, 200).
Momentum Cross: SMA 25 crossover above SMA 50.
Trend Breakouts: A specific "3-Bar Breakout" logic above the SMA 50, 100, or 200. This requires the price to hold above the SMA for 3 consecutive bars after being below it, reducing false signals compared to simple closes.
2. VIX Volatility Filter Before entering any trade, the script checks the CBOE:VIX.
Filter: If VIX is above the threshold (default 32), new entries are blocked.
Panic Exit: If you are in a position and the VIX spikes above the threshold, the strategy executes an immediate "Panic Exit" to preserve capital during market crashes.
3. The "Ratchet" Exit System (3 Stages) Unlike a standard trailing stop, this strategy uses a 3-stage dynamic exit mechanism that tightens as profits grow:
Stage 0 (Initial Risk): Standard percentage-based Stop Loss from the entry price.
Stage 1 (The Lock-In): Triggered when profit hits 10% (configurable).
Unique Logic: Instead of trailing from the highest high, the stop is calculated based on the price at the exact moment this stage was triggered. It "steps up" once and holds, securing the initial move without being prematurely stopped out by normal volatility.
Stage 2 (Trailing Mode): Triggered when profit hits 15% (configurable).
The strategy switches to a classic Trailing Stop, following the percentage distance from the Highest High.
4. Emergency Backup A "Dead Cross" (SMA 25 crossing under SMA 50) acts as a final fail-safe to close positions if the trend reverses completely before hitting a stop.
Settings & Inputs
SMAs: Customize the lengths for all four moving averages.
VIX Filter: Toggle the filter on/off and set the panic threshold.
Exit Logic: Fully customizable percentages for Initial SL, Stage 1 Trigger/Distance, and Stage 2 Trigger/Trailing Distance.
Disclaimer This script is for educational purposes only. Past performance is not indicative of future results. Always manage your risk appropriately.
Ratchet Exit Trend Strategy with VIX FilterThis strategy is a trend-following system designed specifically for volatile markets. Instead of focusing solely on the "perfect entry," this script emphasizes intelligent trade management using a custom **"Ratchet Exit System."**
Additionally, it integrates a volatility filter based on the CBOE Volatility Index (VIX) to minimize risk during extreme market phases.
### 🎯 The Concept: Ratchet Exit
The "Ratchet" system operates like a mechanical ratchet tool: the Stop Loss can only move in one direction (up, for long trades) and "locks" into specific stages. The goal is to give the trade "room to breathe" initially to avoid being stopped out by noise, then aggressively reduce risk as the trade moves into profit.
The exit logic moves through 3 distinct phases:
1. **Phase 0 (Initial Risk):** At the start of the trade, a wide Stop Loss is set (Default: 10%) to tolerate normal market volatility.
2. **Phase 1 (Risk Reduction):** Once the trade reaches a specific floating profit (Default: +10%), the Stop Loss is raised and "pinned" to a fixed value (Default: -8% from entry). This drastically reduces risk while keeping the trade alive.
3. **Phase 2 (Trailing Mode):** If the trend extends to a higher profit zone (Default: +15%), the Stop switches to a dynamic Trailing Mode. It follows the **Highest High** at a fixed percentage distance (Default: 8%).
### 🛡️ VIX Filter & Panic Exit
High volatility is often the enemy of trend-following strategies.
* **Entry Filter:** The system will not enter new positions if the VIX is above a user-defined threshold (Default: 32). This helps avoid entering "falling knife" markets.
* **Panic Exit:** If the VIX spikes above the threshold (32) while a trade is open, the position is closed immediately to protect capital (Emergency Exit).
### 📈 Entry Signals
The strategy trades **LONG only** and uses Simple Moving Averages (SMAs) to identify trends:
* **Golden Cross:** SMA 25 crosses over SMA 50.
* **3-Bar Breakouts:** A confirmation logic where the price must close above the SMA 50, 100, or 200 for 3 consecutive bars.
### ⚙️ Settings (Inputs)
All parameters are fully customizable via the settings menu:
* **SMAs:** Lengths for the trend indicators (Default: 25, 50, 100, 200).
* **VIX Filter:** Toggle the filter on/off and adjust the panic threshold.
* **Ratchet Settings:** Percentages for Initial Stop, Trigger Levels for Stages 1 & 2, and the Trailing Distance.
### ⚠️ Technical Note & Risk Warning
This script uses `request.security` to fetch VIX data. Please ensure you understand the risks associated with trading leveraged or volatile assets. Past performance is not indicative of future results.
Trend Breakout & Ratchet Stop System [Market Filter]Description:
This strategy implements a robust trend-following system designed to capture momentum moves while strictly managing downside risk through a multi-stage "Ratchet" exit mechanism and broad market filters.
It is designed for swing traders who want to align individual stock entries with the overall market direction.
How it works:
1. Market Regime Filters (The "Safety Check") Before taking any position, the strategy checks the health of the broader market to avoid "catching falling knives."
Broad Market Filter: By default, it checks NASDAQ:QQQ (adjustable). If the benchmark is trading below its SMA 200, the strategy assumes a Bear Market and suppresses all new long entries.
Volatility Filter (VIX): Uses CBOE:VIX to gauge fear. If the VIX is above a specific threshold (Default: 32), entries are paused, and existing positions can optionally be closed to preserve capital.
2. Entry Logic Entries are based on Momentum and Trend confirmation. A position is opened if filters are clear AND one of the following occurs:
Golden Cross: SMA 25 crosses over SMA 50.
SMA Breakouts: A "Three-Bar-Break" logic confirms a breakout above the SMA 50, 100, or 200 (price must establish itself above the moving average).
3. The "Ratchet" Exit System The exit logic evolves as the trade progresses, tightening risk like a ratchet:
Stage 0 (Initial Risk): Starts with a standard percentage Stop Loss from the entry price.
Stage 1 (Breakeven/Lock): Once the price rises by Profit Step 1 (e.g., +10%), the Stop Loss jumps to a tighter level and locks there. This secures the initial move.
Stage 2 (Trailing Mode): If the price continues to rise to Profit Step 2 (e.g., +15%), the Stop Loss converts into a dynamic Trailing Stop relative to the Highest High. This allows the trade to run as long as the trend persists.
Additional Exits:
Dead Cross: Closes position if SMA 25 crosses under SMA 50.
VIX Panic: Emergency exit if volatility spikes above the threshold.
Settings & Customization:
SMAs: Adjustable lengths for all Moving Averages.
Filters: Toggle Market/VIX filters on/off and choose your benchmark ticker (e.g., SPY or QQQ).
Risk Management: Fully customizable percentages for the Ratchet steps (Initial SL, Stage 1 Trigger, Trailing distance).
Moving Average 13 Exponential//@version=6
indicator(title="Moving Average 13 Exponential", shorttitle="EMA", overlay=true, timeframe="", timeframe_gaps=true)
len = input.int(9, minval=1, title="Length")
src = input(close, title="Source")
offset = input.int(title="Offset", defval=0, minval=-500, maxval=500, display = display.data_window)
out = ta.ema(src, len)
plot(out, title="EMA", color=color.yellow, offset=offset)
// Smoothing MA inputs
GRP = "Smoothing"
TT_BB = "Only applies when 'SMA + Bollinger Bands' is selected. Determines the distance between the SMA and the bands."
maTypeInput = input.string("None", "Type", options = , group = GRP, display = display.data_window)
var isBB = maTypeInput == "SMA + Bollinger Bands"
maLengthInput = input.int(14, "Length", group = GRP, display = display.data_window, active = maTypeInput != "None")
bbMultInput = input.float(2.0, "BB StdDev", minval = 0.001, maxval = 50, step = 0.5, tooltip = TT_BB, group = GRP, display = display.data_window, active = isBB)
var enableMA = maTypeInput != "None"
// Smoothing MA Calculation
ma(source, length, MAtype) =>
switch MAtype
"SMA" => ta.sma(source, length)
"SMA + Bollinger Bands" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
// Smoothing MA plots
smoothingMA = enableMA ? ma(out, maLengthInput, maTypeInput) : na
smoothingStDev = isBB ? ta.stdev(out, maLengthInput) * bbMultInput : na
plot(smoothingMA, "EMA-based MA", color=color.yellow, display = enableMA ? display.all : display.none, editable = enableMA)
bbUpperBand = plot(smoothingMA + smoothingStDev, title = "Upper Bollinger Band", color=color.green, display = isBB ? display.all : display.none, editable = isBB)
bbLowerBand = plot(smoothingMA - smoothingStDev, title = "Lower Bollinger Band", color=color.green, display = isBB ? display.all : display.none, editable = isBB)
fill(bbUpperBand, bbLowerBand, color= isBB ? color.new(color.green, 90) : na, title="Bollinger Bands Background Fill", display = isBB ? display.all : display.none, editable = isBB)






















