Japan Yen Carry Trade to Risk Ratio Sharpe Ratio By UncleBFMStep-by-Step Calculation in the ScriptFetch Rates:Pulls rates dynamically using request.security() from user-specified symbols (e.g., TVC:JP10Y for yen, TVC:US10Y for target). If unavailable (NA), uses fallback inputs (e.g., 0.25% for yen, 4.50% for target).
Converts rates to decimals: (target_rate - yen_rate) / 100.
Calculate Carry:Carry = (Target Rate - Yen Rate) / 100
Example: If US 10Y yield is 4.50% and Japan 10Y is 0.25%, carry = (4.50 - 0.25) / 100 = 0.0425 (4.25% annual yield).
Calculate Daily Log Returns:Log Returns = ln(Close / Close ), where Close is the current price of the pair (e.g., USDJPY) and Close is the previous day's price.
This measures daily percentage changes in a way suitable for volatility calculations.
Calculate Annualized Volatility:Volatility = Standard Deviation of Log Returns over a lookback period (default 63 days, ~3 months) × √252.
Example: If the standard deviation of USDJPY log returns is 0.005 (0.5% daily), annualized volatility = 0.005 × √252 ≈ 0.0794 (7.94%).
Compute the Ratio:Ratio = Carry / Volatility
Example: Using above, 0.0425 / 0.0794 ≈ 0.535.
If volatility is zero, the ratio is set to NA to avoid division errors.
Plot:Plots the ratio as a line, with optional thresholds (e.g., 0.2 for "high attractiveness") to guide interpretation.
NotesDynamic Rates: Using bond yields (e.g., TVC:JP10Y) or policy rates (e.g., ECONOMICS:JPINTR) makes the indicator responsive to historical and current rate changes, unlike static inputs.
Context: BIS reports use similar ratios to assess carry trade viability. For USDJPY in 2025, with Fed rates around 4.5% and BoJ at 0.25–0.5%, the carry is positive but sensitive to volatility spikes (e.g., during 2024 unwind events).
Usage: Apply to a yen pair chart (e.g., USDJPY, AUDJPY). Adjust symbols for the target currency (e.g., TVC:AU10Y for AUD). The ratio helps compare carry trade profitability across pairs or over time.
Indicadores e estratégias
Customizable Fixed Range Support & ResistanceTraders often overlook the fixed range support and resistance, especially if they are round numbers. If you make some observations, you will see that buyers and sellers engage in numerous transactions at those levels. You can have a look at the screenshots presented here (find the red boxes!) or check it out for yourselves on the instrument's chart that you prefer. This indicator will be a big help for day traders and scalpers to set their entries, profit targets, and stop loss levels.
Katz Calypso Indicator (Refactored)Overview
The Katz Calypso Indicator is a comprehensive momentum oscillator designed to identify potential entry and exit points in the market. At its core, it uses the True Strength Index (TSI) to gauge the strength and direction of a trend. To enhance signal accuracy and reduce false positives, the indicator integrates several optional filters, including the Waddah Attar Explosion, an EMA filter, and an ATR filter. It also provides an optional RVGI-based exit signal system.
This tool is designed to provide a clear, visual representation of market momentum, with customizable filters to adapt to various trading styles and market conditions.
How to Use the Indicator
The indicator is displayed in a separate pane below the main price chart.
TSI Line (Blue): This is the main oscillator line. Its position relative to the zero line indicates the overall trend bias (above 0 is bullish, below is bearish).
Signal Line (Red): A moving average of the TSI line. Crossovers between the TSI and Signal Line are the primary triggers for trade signals.
Zero Line: The centerline of the oscillator. A cross of the Zero Line can indicate a significant shift in momentum.
Overbought/Oversold Levels: These user-defined levels (defaulting to 65 and -65) help identify potential exhaustion points in a trend, which can be used for taking profits.
On-Chart Signals: The indicator plots shapes directly on the chart to make signals easy to spot:
Green Triangles (Up): Indicate long entry or continuation signals.
Red Triangles (Down): Indicate short entry or continuation signals.
Yellow Triangles: Suggest taking profits.
Maroon/Lime Triangles: Indicate an exit based on a signal cross (like RVGI or the Zero Line).
Trading Rules
Long Trade Rules
Entry: A long trade is signaled when ALL of the following conditions are met:
The blue TSI Line crosses above the red Signal Line.
The blue TSI Line is above the 0 Zero Line.
All enabled filters (Waddah Attar, EMA, ATR) confirm bullish conditions.
A green triangle labeled "Long" will appear below the price.
Exit (Take Profit): A take-profit signal for a long trade is generated when either of these occurs:
The TSI Line crosses below the Overbought level.
The TSI Line crosses back below the Signal Line while still above zero.
A yellow triangle labeled "TPL" (Take Profit Long) will appear above the price.
Exit (Stop/Reverse): A signal to exit a long trade is generated when either of these occurs:
The TSI Line crosses below the 0 Zero Line.
The RVGI Exit filter is enabled and generates a bearish crossover signal.
A maroon triangle labeled "Exit Long" will appear above the price.
Short Trade Rules
Entry: A short trade is signaled when ALL of the following conditions are met:
The blue TSI Line crosses below the red Signal Line.
The blue TSI Line is below the 0 Zero Line.
All enabled filters (Waddah Attar, EMA, ATR) confirm bearish conditions.
A red triangle labeled "Short" will appear above the price.
Exit (Take Profit): A take-profit signal for a short trade is generated when either of these occurs:
The TSI Line crosses above the Oversold level.
The TSI Line crosses back above the Signal Line while still below zero.
A yellow triangle labeled "TPS" (Take Profit Short) will appear below the price.
Exit (Stop/Reverse): A signal to exit a short trade is generated when either of these occurs:
The TSI Line crosses above the 0 Zero Line.
The RVGI Exit filter is enabled and generates a bullish crossover signal.
A lime green triangle labeled "Exit Short" will appear below the price.
Optional Filters
You can enable or disable these filters in the indicator's settings to fine-tune its sensitivity.
Waddah Attar Explosion Filter: This filter measures trend strength and volatility. When enabled, it ensures that entries are only taken during periods of strong, confirmed momentum, helping to avoid sideways or choppy markets.
EMA Price Filter: A classic trend filter. When enabled, it will only allow long entries if the price is above the specified Exponential Moving Average and short entries only if the price is below it.
ATR Filter: This acts as a volatility-based filter to prevent chasing a move. It helps ensure that you are not entering a long trade when the price has already moved too far above its EMA, or vice-versa for a short trade.
RVGI Exit Filter: The Relative Vigor Index (RVGI) is used here exclusively as an exit signal. When enabled, a crossover of the RVGI and its signal line can provide an earlier exit signal before the TSI crosses the zero line, potentially locking in profits sooner.
Disclaimer: This indicator is provided for educational and informational purposes only. It is not financial advice. Trading carries a high level of risk, and you can lose more than your initial investment. You should use this indicator at your own risk and discretion. Always conduct your own research and consider your risk tolerance before making any trading decisions.
AlgoPilotX - OptionScope with Call/Put Bias BB SqueezeUnlock the power of options trading with real-time trend insights! AlgoPilotX - OptionScope combines multi-timeframe trend analysis, Bollinger Band squeezes, RSI signals, and ATR-based strike zones into one intuitive dashboard . Instantly see call/put bias, volatility squeezes, and optimal strike distances—perfect for traders who want actionable signals at a glance.
Features include:
✅ Multi-timeframe bullish/bearish trend detection
⚡ Bollinger Band squeeze alerts for volatility breakouts
📊 ATR-based dynamic strike zones for calls and puts
🔴🟢 RSI overbought/oversold signals
🚀 Visual arrows and a real-time dashboard panel
🔔 Fully alert-ready for automated notifications
Make smarter, faster trading decisions with OptionScope—the ultimate options trading companion.
Call/Put Bias
Shows overall market bias for calls or puts based on multi-timeframe trend analysis
Green = Call bias, Red = Put bias, Gray = Neutral
BB Squeeze
Detects low volatility periods that may lead to breakouts
Yellow = Squeeze active, Gray = No squeeze
Strike Distance
Suggests call and put strike levels based on ATR
Blue background
RSI
Indicates overbought/oversold conditions
Red = Overbought, Green = Oversold, Gray = Neutral
Parthiban - Stock Market BuyParthiban - Stock Market Buy
For BUY, condition
continuos 3 down candle
then forms Indecision candle
next candle close above Indecision candle
price above 500 EMA
For sell, condition
continuos 3 up candle
then forms Indecision candle
next candle close below Indecision candle
price below 500 EMA
Z-Score Mean Reversion StrategyBased on Indicator "Rolling Z- Score trend" by QuantAlgo
The Z-Score Mean Reversion Strategy is a statistical trading approach that exploits price extremes and their tendency to return to average levels. It uses the Z-Score indicator to identify when an asset has deviated significantly from its statistical mean, creating high-probability reversal opportunities.
Core Concept:
Z-Score measures how many standard deviations price is from its moving average
When Z-Score reaches extreme levels (±1.5 or more), price is statistically "stretched"
The strategy trades the expected "snap back" to the mean
Works best in ranging or mean-reverting markets
How It Works:
LONG Entry: When price becomes oversold (Z-Score < -1.5), expect upward reversion
SHORT Entry: When price becomes overbought (Z-Score > +1.5), expect downward reversion
Exit: When price returns closer to the mean or reaches opposite extreme
Risk Management: Stop loss at -3% and take profit at +5% by default
🎯 Best Settings by Market & Timeframe
Cryptocurrency (High Volatility)
Preset: Scalping
Timeframe: 15m - 1H
Lookback: 10-15 periods
Entry Threshold: 1.0 - 1.5
Stop Loss: 2-3%
Take Profit: 3-5%
Notes: Crypto moves fast; use tighter parameters for quicker signals
Forex (Medium Volatility)
Preset: Default or Swing Trading
Timeframe: 1H - 4H
Lookback: 20-25 periods
Entry Threshold: 1.5 - 2.0
Stop Loss: 1-2%
Take Profit: 2-4%
Notes: Works well on major pairs during normal market conditions
Stocks (Lower Volatility)
Preset: Swing Trading
Timeframe: 4H - Daily
Lookback: 25-30 periods
Entry Threshold: 1.5 - 1.8
Stop Loss: 2-4%
Take Profit: 4-8%
Notes: Best on liquid stocks; avoid during earnings or major news
Indices (Trend + Ranging)
Preset: Trend Following
Timeframe: Daily - Weekly
Lookback: 35-50 periods
Entry Threshold: 2.0 - 2.5
Stop Loss: 3-5%
Take Profit: 5-10%
Notes: Higher threshold reduces false signals; captures major reversals
⚙️ Optimal Configuration Guide
Conservative (Lower Risk, Fewer Trades)
Lookback Period: 30-40
Entry Threshold: 2.0-2.5
Exit Threshold: 0.8-1.0
Stop Loss: 3-4%
Take Profit: 6-10%
Momentum Filter: ON
Balanced (Recommended Starting Point)
Lookback Period: 20-25
Entry Threshold: 1.5-1.8
Exit Threshold: 0.5-0.6
Stop Loss: 2-3%
Take Profit: 4-6%
Momentum Filter: OFF
Aggressive (Higher Risk, More Trades)
Lookback Period: 10-15
Entry Threshold: 1.0-1.2
Exit Threshold: 0.3-0.4
Stop Loss: 1-2%
Take Profit: 2-4%
Momentum Filter: OFF
💡 Pro Tips for Best Results
When the Strategy Works Best:
✅ Ranging markets with clear support/resistance
✅ High liquidity assets (major pairs, large-cap stocks)
✅ Normal market conditions (avoid during crashes or parabolic runs)
✅ Mean-reverting assets (avoid strong trending stocks)
When to Avoid:
❌ Strong trending markets (price won't revert)
❌ Low liquidity / low volume periods
❌ Major news events (earnings, FOMC, NFP)
❌ Market crashes or euphoria phases
Optimization Process:
Start with "Default" preset on your chosen timeframe
Backtest 6-12 months to see performance
Adjust Entry Threshold first (lower = more trades, higher = fewer but stronger signals)
Fine-tune Stop Loss/Take Profit based on average trade duration
Consider Momentum Filter if getting too many false signals
Key Metrics to Monitor:
Win Rate: Target 50-60% (mean reversion typically has moderate win rate)
Profit Factor: Aim for >1.5
Average Trade Duration: Should match your timeframe (scalping: minutes/hours, swing: days)
Max Drawdown: Keep under 20% of capital
📈 Quick Start Recommendation
For most traders, start here:
Timeframe: 1H or 4H
Preset: Default (Lookback 20, Threshold 1.5)
Stop Loss: 3%
Take Profit: 5%
Momentum Filter: OFF (turn ON if too many false entries)
Test on BTCUSD, EURUSD, or SPY first, then adapt to your preferred instruments!
Shashwat Khurana (v6) – VWAP ±1SD + RSI + ATR Filter A multi-factor volatility-adjusted mean-reversion model integrating dynamic liquidity thresholds and higher-order momentum filters for asymmetric risk calibration
nitai Daily ATR – Top Right PanelThis script calculates the Daily ATR (Average True Range) and displays it in a compact panel on the top-right corner of the chart.
The panel includes:
• ATR in USD (based on a user-defined period, default = 30)
• ATR% – volatility expressed as a percentage of the price
• ATR% EMA – smoothed volatility trend using an Exponential Moving Average
• Close + ATR and Close – ATR – projected upper and lower daily range levels
Use this tool to quickly assess daily volatility, compare stocks by relative movement, and support risk management (e.g., stop-loss placement).
Designed for traders who want a clean and simple volatility dashboard directly on the chart.
Simplified Wave Trend Overbought/OversoldThis is just a variation of the popular wave trend that I find to be nicer to look at.
Mekayl's Session Zones//@version=5
indicator("Mekayl's Session zones", overlay=true, max_boxes_count=200)
// --- Colors
asiaFill = color.new(#3b3333, 80)
preLdnFill = color.new(#292323, 80)
ldnFill = color.new(#242222, 80)
preNyFill = color.new(#443322, 80)
nyFill = color.new(#664422, 80)
asiaBorder = color.new(#4d718f, 0)
preLdnBorder = color.new(#00897B, 0)
ldnBorder = color.new(#B2EBF2, 0)
preNyBorder = color.new(#FFA500, 0)
nyBorder = color.new(#FF8C00, 0)
// --- Sessions
asia_sess = "0100-0600"
preldn_sess = "0600-0800"
ldn_sess = "0800-1200"
preNY_sess = "1200-1300"
ny_sess = "1300-1700"
tz = "Europe/London"
// --- Variables for boxes & labels
var box asia_box = na
var label asia_label = na
var box pre_box = na
var label pre_label = na
var box ldn_box = na
var label ldn_label = na
var box preNY_box = na
var label preNY_label = na
var box ny_box = na
var label ny_label = na
// --- Function to get horizontal center above box
f_label_xy(b) =>
x = (box.get_left(b) + box.get_right(b)) / 2
y = box.get_top(b) + 3 * syminfo.mintick
// --- Asia box
asia_in = not na(time(timeframe.period, asia_sess, tz))
if asia_in
if na(asia_box)
asia_box := box.new(left=bar_index, top=high, right=bar_index, bottom=low, bgcolor=asiaFill, border_color=asiaBorder, border_width=2)
= f_label_xy(asia_box)
asia_label := label.new(x, y, "asia", style=label.style_none, textcolor=color.new(asiaBorder,0), size=size.normal)
else
box.set_right(asia_box, bar_index)
box.set_top(asia_box, math.max(box.get_top(asia_box), high))
box.set_bottom(asia_box, math.min(box.get_bottom(asia_box), low))
= f_label_xy(asia_box)
label.set_xy(asia_label, x, y)
else
if not na(asia_box)
box.set_right(asia_box, bar_index)
asia_box := na
asia_label := na
// --- Pre-London box
pre_in = not na(time(timeframe.period, preldn_sess, tz))
if pre_in
if na(pre_box)
pre_box := box.new(left=bar_index, top=high, right=bar_index, bottom=low, bgcolor=preLdnFill, border_color=preLdnBorder, border_width=2)
= f_label_xy(pre_box)
pre_label := label.new(x, y, "pre_ldn", style=label.style_none, textcolor=color.new(preLdnBorder,0), size=size.normal)
else
box.set_right(pre_box, bar_index)
box.set_top(pre_box, math.max(box.get_top(pre_box), high))
box.set_bottom(pre_box, math.min(box.get_bottom(pre_box), low))
= f_label_xy(pre_box)
label.set_xy(pre_label, x, y)
else
if not na(pre_box)
box.set_right(pre_box, bar_index)
pre_box := na
pre_label := na
// --- London box
ldn_in = not na(time(timeframe.period, ldn_sess, tz))
if ldn_in
if na(ldn_box)
ldn_box := box.new(left=bar_index, top=high, right=bar_index, bottom=low, bgcolor=ldnFill, border_color=ldnBorder, border_width=2)
= f_label_xy(ldn_box)
ldn_label := label.new(x, y, "ldn", style=label.style_none, textcolor=color.new(ldnBorder,0), size=size.normal)
else
box.set_right(ldn_box, bar_index)
box.set_top(ldn_box, math.max(box.get_top(ldn_box), high))
box.set_bottom(ldn_box, math.min(box.get_bottom(ldn_box), low))
= f_label_xy(ldn_box)
label.set_xy(ldn_label, x, y)
else
if not na(ldn_box)
box.set_right(ldn_box, bar_index)
ldn_box := na
ldn_label := na
// --- Pre-New York box
preNY_in = not na(time(timeframe.period, preNY_sess, tz))
if preNY_in
if na(preNY_box)
preNY_box := box.new(left=bar_index, top=high, right=bar_index, bottom=low, bgcolor=preNyFill, border_color=preNyBorder, border_width=2)
= f_label_xy(preNY_box)
preNY_label := label.new(x, y, "pre-ny", style=label.style_none, textcolor=color.new(preNyBorder,0), size=size.normal)
else
box.set_right(preNY_box, bar_index)
box.set_top(preNY_box, math.max(box.get_top(preNY_box), high))
box.set_bottom(preNY_box, math.min(box.get_bottom(preNY_box), low))
= f_label_xy(preNY_box)
label.set_xy(preNY_label, x, y)
else
if not na(preNY_box)
box.set_right(preNY_box, bar_index)
preNY_box := na
preNY_label := na
// --- New York box
ny_in = not na(time(timeframe.period, ny_sess, tz))
if ny_in
if na(ny_box)
ny_box := box.new(left=bar_index, top=high, right=bar_index, bottom=low, bgcolor=nyFill, border_color=nyBorder, border_width=2)
= f_label_xy(ny_box)
ny_label := label.new(x, y, "ny", style=label.style_none, textcolor=color.new(nyBorder,0), size=size.normal)
else
box.set_right(ny_box, bar_index)
box.set_top(ny_box, math.max(box.get_top(ny_box), high))
box.set_bottom(ny_box, math.min(box.get_bottom(ny_box), low))
= f_label_xy(ny_box)
label.set_xy(ny_label, x, y)
else
if not na(ny_box)
box.set_right(ny_box, bar_index)
ny_box := na
ny_label := na
Stockbee Trend IntensityThis is a simple measure of trend and turns green or red depending on direction. The indicator also shows volume.
Scenario Screener — Consolidation → Bullish SetupThe script combines multiple indicators to filter out false signals and only highlight strong conditions:
Consolidation Check
Uses ATR % of price → filters out stocks in tight ranges.
Uses Choppiness Index → confirms sideways/non-trending behavior.
Momentum Shift (Bullish Bias)
MACD Histogram > 0 → bullish momentum starting.
RSI between 55–70 → strength without being overbought.
Stochastic %K & %D > 70 → confirms strong momentum.
Volume & Accumulation
Chaikin Money Flow (CMF > 0) → buying pressure.
Chaikin Oscillator > 0 (debug only) → accumulation phase.
Trend Direction
+DI > -DI (from DMI) → buyers stronger than sellers.
ADX between 18–40 → healthy trend strength (not too weak, not overheated).
Breakout Filter (Optional)
If enabled, requires price to cross above 20 SMA before signal confirmation.
📈 Outputs
✅ Green label (“MATCH”) below the bar when all bullish conditions align.
✅ Background highlight (light green) when signal appears.
✅ Info Table (top-right) summarizing key values:
Signal = True/False
MACD, CMF, Chaikin values
6 EMAThis indicator allows you to set up 6 EMAs.
By default, the EMAs are based on the candle's closing price.
The default values are 7, 20, 60, 120, 200, and 400, and you can toggle each EMA on or off as needed.
Natural Moving Averages (Jim Sloman's Ocean Theory)Natural Moving Averages invented by Jim Sloman.
Code copied by IA from the TradeStation code.
Includes the Fast and the Regular NMAs.
Jim Sloman invented Ocean Theory and the NMA is its building block.
ES/NQ, Pre-Market High & Low (04:00 AM - 09:30 AM)This indicator marks the Pre market high and Pre market low from 04:00am to 09:30am for any us Index
tclibLibrary "tclib"
super_smoother(data, smoothing_period)
Parameters:
data (float)
smoothing_period (int)
SATHYA SMA Signal)This indicator overlays 20, 50, and 200 Simple Moving Averages (SMAs) on the chart. It generates bullish signals when the 20 SMA crosses above the 200 SMA before the 50 SMA, with both above 200 SMA. Bearish signals occur when the 20 SMA crosses below the 200 SMA before the 50 SMA, with both below 200 SMA. Signals appear as distinct triangles on the chart, helping traders identify trend reversals based on systematic SMA crossovers and order of crossing.
维加斯双通道策略Vegas Channel Comprehensive Strategy Description
Strategy Overview
A comprehensive trading strategy based on the Vegas Dual Channel indicator, supporting dynamic position sizing and fund management. The strategy employs a multi-signal fusion mechanism including classic price crossover signals, breakout signals, and retest signals, combined with trend filtering, RSI+MACD filtering, and volume filtering to ensure signal reliability.
Core Features
Dynamic Position Sizing: Continue adding positions on same-direction signals, close all positions on opposite signals
Smart Take Profit/Stop Loss: ATR-based dynamic TP/SL, updated with each new signal
Fund Management: Supports dynamic total amount management for compound growth
Time Filtering: Configurable trading time ranges
Risk Control: Maximum order limit to prevent over-leveraging
Leverage Usage Instructions
Important: This strategy does not use TradingView's margin functionality
Setup Method
Total Amount = Actual Funds × Leverage Multiplier
Example: Have 100U actual funds, want to use 10x leverage → Set total amount to 100 × 10 = 1000U
Trading Amount Calculation
Each trade percentage is calculated based on leveraged amount
Example: Set 10% → Actually trade 100U margin × 10x leverage = 1000U trading amount
Maximum Orders Configuration
Must be used in conjunction with leveraged amount
Example: 1000U total amount, 10% per trade, maximum 10 orders = maximum use of 1000U
Note: Do not exceed 100% of total amount to avoid over-leveraging
Parameter Configuration Recommendations
Leverage Configuration Examples
Actual funds 100U, 5x leverage, total amount setting 500U, 10% per trade, 50U per trade, recommended maximum orders 10
Actual funds 100U, 10x leverage, total amount setting 1000U, 10% per trade, 100U per trade, recommended maximum orders 10
Actual funds 100U, 20x leverage, total amount setting 2000U, 5% per trade, 100U per trade, recommended maximum orders 20
Risk Control
Conservative: 5-10x leverage, 10% per trade, maximum 5-8 orders
Aggressive: 10-20x leverage, 5-10% per trade, maximum 10-15 orders
Extreme: 20x+ leverage, 2-5% per trade, maximum 20+ orders
Strategy Advantages
Signal Reliability: Multiple filtering mechanisms reduce false signals
Capital Efficiency: Dynamic fund management for compound growth
Risk Controllable: Maximum order limits prevent liquidation
Flexible Configuration: Supports various leverage and fund allocation schemes
Time Control: Configurable trading hours to avoid high-risk periods
Usage Notes
Ensure total amount is set correctly (actual funds × leverage multiplier)
Maximum orders should not exceed the range allowed by total funds
Recommend starting with conservative configuration and gradually adjusting parameters
Regularly monitor strategy performance and adjust parameters timely
维加斯通道综合策略说明
策略概述
基于维加斯双通道指标的综合交易策略,支持动态加仓和资金管理。策略采用多信号融合机制,包括经典价穿信号、突破信号和回踩信号,结合趋势过滤、RSI+MACD过滤和成交量过滤,确保信号的可靠性。
核心功能
动态加仓:同向信号继续加仓,反向信号全部平仓
智能止盈止损:基于ATR的动态止盈止损,每次新信号更新
资金管理:支持动态总金额管理,实现复利增长
时间过滤:可设置交易时间范围
风险控制:最大订单数限制,防止过度加仓
杠杆使用说明
重要:本策略不使用TradingView的保证金功能
设置方法
总资金 = 实际资金 × 杠杆倍数
示例:实际有100U,想使用10倍杠杆 → 总资金设置为 100 × 10 = 1000U
交易金额计算
每笔交易百分比基于杠杆后的金额计算
示例:设置10% → 实际交易 100U保证金 × 10倍杠杆 = 1000U交易金额
最大订单数配置
必须配合杠杆后的金额使用
示例:1000U总资金,10%单笔,最大10单 = 最多使用1000U
注意:不要超过总资金的100%,避免过度杠杆
参数配置建议
杠杆配置示例
实际资金100U,5倍杠杆,总资金设置500U,单笔百分比10%,单笔金额50U,建议最大订单数10单
实际资金100U,10倍杠杆,总资金设置1000U,单笔百分比10%,单笔金额100U,建议最大订单数10单
实际资金100U,20倍杠杆,总资金设置2000U,单笔百分比5%,单笔金额100U,建议最大订单数20单
风险控制
保守型:5-10倍杠杆,10%单笔,最大5-8单
激进型:10-20倍杠杆,5-10%单笔,最大10-15单
极限型:20倍以上杠杆,2-5%单笔,最大20单以上
策略优势
信号可靠性:多重过滤机制,减少假信号
资金效率:动态资金管理,实现复利增长
风险可控:最大订单数限制,防止爆仓
灵活配置:支持多种杠杆和资金配置方案
时间控制:可设置交易时间,避开高风险时段
使用注意事项
确保总资金设置正确(实际资金×杠杆倍数)
最大订单数不要超过总资金允许的范围
建议从保守配置开始,逐步调整参数
定期监控策略表现,及时调整参数
My script//@version=6
strategy("Elite Option Signal Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === INPUTS ===
fastLength = input.int(9, title="Fast MA Length")
slowLength = input.int(21, title="Slow MA Length")
trendLength = input.int(50, title="Trend MA Length")
rsiLength = input.int(14, title="RSI Length")
rsiOversold = input.int(30, title="RSI Oversold Level")
rsiOverbought = input.int(70, title="RSI Overbought Level")
useStopLoss = input.bool(true, title="Use Stop Loss?")
stopLossPercent = input.float(2.0, title="Stop Loss %", minval=0.1, maxval=10.0)
// === INDICATORS ===
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)
trendMA = ta.sma(close, trendLength)
rsi = ta.rsi(close, rsiLength)
// === CONDITIONS ===
bullishTrend = close > trendMA
bearishTrend = close < trendMA
longCondition = ta.crossover(fastMA, slowMA) and bullishTrend and rsi < rsiOverbought
shortCondition = ta.crossunder(fastMA, slowMA) and bearishTrend and rsi > rsiOversold
// === EXECUTION ===
if longCondition
strategy.entry("Long", strategy.long)
if useStopLoss
strategy.exit("Exit Long", "Long", stop=close * (1 - stopLossPercent / 100))
if shortCondition
strategy.entry("Short", strategy.short)
if useStopLoss
strategy.exit("Exit Short", "Short", stop=close * (1 + stopLossPercent / 100))
// === PLOTS ===
plot(fastMA, color=color.green, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")
plot(trendMA, color=color.blue, title="Trend MA")
plotshape(longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup)
plotshape(shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown)
Fed Funds Rate-of-ChangeFed Funds Rate-of-Change
What it does:
This indicator pulls the Effective Federal Funds Rate (FRED:FEDFUNDS, monthly) and measures how quickly it’s changing over a user-defined lookback. It offers stabilized change metrics that avoid the “near-zero blow-up” you see with naive % ROC. The plot turns red only when the signal is below the lower threshold and heading down (i.e., value < –threshold and slope < 0).
This indicator is meant to be useful in monitoring fast cuts on the part of the FED - a signal that has preceded recession or market pullbacks in times prior.
Change modes: Percentage, log and delta.
Percent ROC (ε floor): 100 * (now - prev) / max(prev, ε)
Log change (ε): 100 * (ln(now + ε) - ln(prev + ε))
Delta (bps): (now - prev) * 100 (basis points; avoids percentage math)
Tip: For “least drama,” use Delta (bps). For relative change without explosions near zero, use Log change (ε).
Key inputs:
Lookback (months): ROC window in calendar months (because source is monthly).
Change Metric: one of the three options above.
ε (percentage points): small constant (e.g., 0.25 pp) used by Percent ROC (ε) and Log change (ε) to stabilize near-zero values.
EMA Smoothing length: light smoothing of the computed series.
Clip |value| at: optional hard cap to tame outliers (0 = off).
Threshold % / Threshold bps: lower/upper threshold band; unit adapts to the selected metric.
Plot as histogram: optional histogram view.
Coloring / signal logic
Red: value is below the lower threshold (–threshold) and the series is falling on the current bar.
How to use:
Add to any chart (timeframe doesn’t matter; data is monthly under the hood).
Pick a Change Metric and set Lookback (e.g., 3–6 months).
Choose a reasonable threshold:
Percent/Log: try 10–20%
Delta (bps): try 50–100 bps
Optionally smooth (EMA 3–6) and/or clip extreme spikes.
Interpretation
Sustained red often marks periods of accelerating downside in the Fed Funds change metric (e.g., policy easing momentum when using bps).
Neutral (gray) provides context without implying direction bias.
Notes & limitations
Source is monthly FRED series; values update on monthly closes and are stable (no intrabar repainting of the monthly series).
Threshold units switch automatically with the metric (%, %, or bps).
Smoothing/clip are convenience tools; adjust conservatively to avoid masking important shifts.
Relative Strength vs. Benchmark (相對強度)This "Relative Strength vs. Benchmark" indicator helps you see a stock's true performance against a benchmark (like the S&P 500) at a glance. By calculating the price ratio between the two, it strips away the overall market noise, allowing you to focus on identifying true market leaders and underperforming laggards.
How It Works
Core Formula: Relative Strength = Stock Price / Benchmark Index Price
A Rising Line: Means the stock is outperforming the benchmark.
A Falling Line: Means the stock is underperforming the benchmark.
The indicator also includes a Moving Average (MA) of the Relative Strength line itself. This MA helps to confirm the trend of relative strength and filter out short-term noise.
How to Use
Find Market Leaders: When the market is in an uptrend or consolidating, look for stocks whose RS line is breaking out to new highs.
Avoid Laggards: If the RS line is consistently below its moving average or making new lows, the stock is significantly underperforming the market and should be treated with caution.
Trend Change Signals: A cross of the RS line above its MA can be seen as a signal that a new trend of relative outperformance is beginning. A cross below suggests the trend is weakening.
Features & Settings
Customizable Benchmark: You can change the default benchmark from TWSE:TSE to any symbol you need, such as SP:SPX for the S&P 500 or NASDAQ:NDX for the Nasdaq 100.
Adjustable MA Length: Customize the period for the RS Moving Average to fit your trading style (short-term or long-term).
Visual Toggle: Easily turn the colored background fill on or off according to your preference.
Hope you find this tool helpful in your analysis!
Hybrid Trend MAHybrid Trend MA (Pine Script v6)
This indicator combines Exponential Moving Averages (EMA) and Arnaud Legoux Moving Averages (ALMA) into a single hybrid trend-following tool. It is designed to help traders visualize medium- and long-term trend directions while also capturing smoother short-term signals.
Key Features:
EMA Trend Structure
Three EMAs are plotted (lengths: 38, 62, 200).
Each EMA line changes color depending on whether it is rising or falling relative to the others:
Red → Strong uptrend alignment.
Lime → Strong downtrend alignment.
Aqua → Neutral or transition.
The indicator also fills the space between EMA zones with silver shading to highlight trend channels.
ALMA Trend Confirmation
Two ALMA curves are plotted (lengths: 13, 50).
Similar rising/falling logic is applied to color them:
Red → Bullish alignment and rising.
Green → Bearish alignment and falling.
Cyan → Neutral or uncertain trend.
A cross marker is plotted whenever the fast and slow ALMA lines cross, which may serve as an entry/exit confirmation.
Customizable Smoothing
The smoothe setting controls how many bars are checked to confirm whether an EMA or ALMA is rising/falling, helping reduce noise.
How to Use:
Trend Identification: The EMA set shows the larger market structure. When all EMAs align in direction and color, the trend is stronger.
Entry & Exit Confirmation: The ALMA cross signals can be used to refine entries and exits within the broader EMA trend.
Dynamic Visuals: Colored EMAs + ALMAs make it easy to distinguish bullish, bearish, and ranging conditions at a glance.