MTF Bullish/Bearish IndicatorThe script plots a bullish/bearish indicator by evaluating a variety of moving averages for a security across multiple timeframes. It's derived from built in Technical Analysis indicator published by TradingView. The result of evaluation is plotted on the chart in green light/red light format in a configurable location.
evaluated moving averages include
- SMA 10, 20, 30, 50, 100, 200
- EMA 10, 20, 30, 50, 100, 200
- Hull MA 9
- VWMA 20
- Ichimoku Cloud
moving averages are evaluated at chart timeframes and 5 min, 15 min, 30 min, 120 min, 240 min, and daily by default but can be customized.
חפש סקריפטים עבור "bear"
Macd Divergence + MTF EMA MACD Divergence + Multi Time Frame EMA
This Strategy uses 3 indicators: the Macd and two emas in different time frames
The configuration of the strategy is:
Macd standar configuration (12, 26, 9) in 1H resolution
10 periods ema, in 1H resolution
5 periods ema, in 15 minutes resolution
We use the two emas to filter for long and short positions.
If 15 minutes ema is above 1H ema, we look for long positions
If 15 minutes ema is below 1H ema, we look for short positions
We can use an aditional filter using a 100 days ema, so when the 15' and 1H emas are above the daily ema we take long positions
Using this filter improves the strategy
We wait for Macd indicator to form a divergence between histogram and price
If we have a bullish divergence, and 15 minutes ema is above 1H ema, we wait for macd line to cross above signal line and we open a long position
If we have a bearish divergence, and 15 minutes ema is below 1H ema, we wait for macd line to cross below signal line and we open a short position
We close both position after a cross in the oposite direction of macd line and signal line
Also we can configure a Take profit parameter and a trailing stop loss
[SCL] True Market StructureSee market structure at a glance with Higher Highs and Lower Lows. Bullish/Bearish/Ranging market bias is automatically derived. Optionally get alerted for breaks in market structure. Uses true Local Highs/Lows instead of simply the highest/lowest "pivot" for x bars. Can be useful as a support for learning market structure or for alerts for a change in structure while you're not at the computer.
Separated ATR - evoThis script plots two ATR (Average True Range) values, one based on only bullish and the other based on only bearish bars. If the current bar is positive, the negative ATR will use its last known negative bar for the calculation. You can smooth bar directions by using the Heikin Ashi setting.
Use this the same way how you would use the regular ATR indicator, but with the added value of knowing which side of the market has more volatility.
TMMS OscillatorThe TMMS oscillator (aka “Trading Made More Simpler”) is an indicator made of conditions based on both 2 separated Stochastic and 1 RSI.
Bullish zone is green and bearish one is red. When the histogram is grey, no signals is available at that time.
The indicator has an option to show the current trend of an Hull moving average (ascending or descending curve). When the trend is up, green dots are plotted on the zero line. When the trend is down, the dots are coloured in red.
Greetings, success with your trade!!!
Dreadblitz BarsThese bars can give you good opportunities if you know how to analyze the context.
blue=bullish
black=bearish
thumbs up
Market Thrust IndicatorThe Market Thrust indicator is a powerful measure of the stock market's internal strength or weakness. There are four components to this indicator:
1-Advancing Issues on the New York Stock Exchange (NYSE) – $ADV
2-Advancing Volume on the NYSE – $UVOL
3-Declining Issues on the NYSE – $DECL
4-Declining Volume on the NYSE – $DVOL
The formula for Market Thrust is given below:
($ADV x $UVOL)-($DECL x $DVOL)
When used for day-trading, the trend of the Market Thrust indicator is what is most important.
Rising Market Thrust Indicator: Considered a bullish sign; can act as a confirmation signal when combined with a rising stock, index ETF, or stock index future's price.
Falling Market Thrust Indicator: Considered a bearish sign; can act as a confirmation signal of a decreasing market price.
The Market Thrust indicator could be used for detecting divergences in trends. Divergences occur when:
- Price is trending higher, but the Market Thrust indicator is not moving higher or is even going down.
- Price is trending lower, however, the Market Thrust technical analysis tool is not trending lower, it is either not trending or is trending higher.
Add a fully configurable trend line over MTI.
Read more at: commodity.com
Engulfing Scanner v1This indicator helps you to quickly identify bullish and bearish engulfing patterns.
Works on currencies only (pips required).
Differential Price Counter for Bullish/Bearish BarsThis script can show the cumulative differential price of both bullish/bearish bars with the 0.1pip precision for the currencies having five decimal precision. However, can be useful for all markets.
RepulseThis indicator was originally developed by Eric Lefort, a professional trader and author from France.
It gauges and displays the bullish or bearish pressure.
Like and follow for more open source indicators!
Happy Trading!
RSI_EMA & Bearish EngulfingThis is a RSI-RSI of EMA and bearish candlestick reversal pattern formed by two candlesticks. Following an uptrend, the first candlestick is a up candlestick which is followed by a down candlestick which has a long real body that engulfs or contains the real body of the prior bar. following an uptrend, if RSI and EMA line cross then Sell and for downtrend if RSI and EMA line cross then Buy.
CMYK VRMI◊ Introduction
This script indicates the relative movement of price x volume.
◊ Origin
Based on 'The Relative Momentum Index' by Roger Altman : February, 1993 issue of Technical Analysis of Stocks & Commodities magazine.
While RSI counts up and down days from close to close, the Relative Momentum Index counts up and down days from the close relative to a close x number of days ago.
This results in an RSI that is smoother. The input has been changed to the change of a smoothed close multiplied by a smoothed volume.
The polarity of VRMI indicates bearish/bullish movement.
◊ Adjustments
CMYK color theme applied.
◊ Usage
VRMI indicates the force the market moves with.
◊ Future Prospects
-
◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊
CMYK VRMI RAYS ◊ Introduction
Introducing VRMI in this script, an RMI based on price movement and volume, to indicate bullish and bearish trends.
This script marks the background depending on RMI <> VRMI , VRMI polarity and large buy/sell sprees.
◊ Origin
Based on 'The Relative Momentum Index' by Roger Altman : February, 1993 issue of Technical Analysis of Stocks & Commodities magazine.
While RSI counts up and down days from close to close, the Relative Momentum Index counts up and down days from the close relative to a close x number of days ago.
This results in an RSI that is smoother.
In addition VRMI reacts quick, it is used to cut off latency from RMI, and it's polarity indicates the beginning and end of a trend.
Large buy sell sprees and detected in their proportion with an sma on the volume
◊ Adjustments
CMYK color theme applied.
◊ Usage
This indicator can be used to detect trends and mark reversals.
◊ Prospects
◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊ ◊
Super Envolvente (Bullish y Bearish)Identificador de Super-envolventes (SE), se encarga de darle un color verde a la SE alzista (Bullish) verde y rojo a la bajista (Bearish).
Bearish signal using Point of Control (POC) with PAC by guruThis indicator code helps traders identify potential sell opportunities using several important technical indicators:
Point of Control (POC) – This is the price level where the most volume was traded over the past several days.
Previous Day's Low – This shows the lowest price reached during the previous day.
PAC (Price Action Channel) EMA – These are two moving averages (one based on the low price and one based on the close price) that help determine if the price is trending within a certain range.
Volume SMA – This is a 3-day simple moving average (SMA) of volume, which helps filter out signals based on market activity.
What the Script Does:
Point of Control (POC):
The script looks at the last 50 days (configurable) and calculates which price level had the highest trading volume.
It then plots a red line on the chart at the POC level. This is important because it helps identify areas where there was strong market interest in the past.
Volume Moving Average:
The script calculates a 3-day SMA of volume, but it excludes the current day to avoid premature signals based on today’s trading.
The volume SMA is used to ensure there’s enough market activity (with a threshold set to 25 units) before triggering a sell signal.
Price Action Channel (PAC) EMA:
The PAC consists of two exponential moving averages (EMAs):
The PAC Low EMA: This is based on the low prices over the last 34 periods (configurable).
The PAC Close EMA: This is based on the closing prices over the last 34 periods.
These EMAs help determine if the price is trending above or below certain price levels.
Sell Signal Logic: The script checks three conditions before displaying a "Sell" signal:
Price Below POC and Previous Day’s Low:
The close price must be below both the Point of Control (POC) and the previous day's low.
Volume SMA Above 25:
The 3-day volume SMA must be greater than 25. This ensures the signal only triggers when there’s enough trading volume in the market.
Today’s Low is Above PAC EMAs:
Today's low price must be above both the PAC low EMA and the PAC close EMA. This prevents sell signals when prices are already significantly below the PAC, indicating possible exhaustion in the downtrend.
If all three conditions are met, the script will display a red "Sell" label on the chart, signaling a potential selling opportunity.
No Sell Signal if Price Reverses:
If the price crosses back above the POC or the previous day's low, the script will remove the sell signal and reset for a new opportunity.
Summary of Conditions:
For the script to display a "Sell" label:
The close price must be below the Point of Control (POC) and the previous day’s low.
The 3-day volume SMA (excluding today) must be greater than 25 units.
The low price of the current day must be above both the PAC low EMA and the PAC close EMA.
If these conditions are met, a red sell label appears on the chart as a potential signal for a short (sell) trade.
PA SystemPA System - Price Action Trading System
价格行为交易系统
📊 概述 / Overview
PA System is a comprehensive price action trading indicator that combines Smart Money Concepts (SMC), market structure analysis, and multi-timeframe confirmation to identify high-probability trade setups. Designed for both manual traders and algorithmic trading systems.
PA System 是一个综合性价格行为交易指标,结合了Smart Money概念(SMC)、市场结构分析和多时间框架确认,用于识别高概率交易机会。适用于手动交易者和算法交易系统。
✨ 核心特性 / Key Features
🎯 Four-Phase Signal System / 四阶段信号系统
H1 (First Pullback) - Initial bullish retracement in uptrend
H2 (Confirmed Entry) - Breakout confirmation for long entries
L1 (First Bounce) - Initial bearish bounce in downtrend
L2 (Confirmed Entry) - Breakdown confirmation for short entries
中文说明:
H1(首次回调) - 上升趋势中的初次回撤信号
H2(确认入场) - 突破确认的做多入场点
L1(首次反弹) - 下降趋势中的初次反弹信号
L2(确认入场) - 跌破确认的做空入场点
📐 Market Structure Detection / 市场结构识别
HH (Higher High) - Uptrend confirmation / 上升趋势确认
HL (Higher Low) - Bullish pullback / 多头回调
LH (Lower High) - Bearish bounce / 空头反弹
LL (Lower Low) - Downtrend confirmation / 下降趋势确认
💎 Smart Money Concepts (SMC) / 智能资金概念
BoS (Break of Structure) - Trend continuation signal / 趋势延续信号
CHoCH (Change of Character) - Potential trend reversal / 潜在趋势反转
📈 Dynamic Trendlines / 动态趋势线
Auto-drawn support and resistance trendlines / 自动绘制支撑阻力趋势线
Real-time extension to current bar / 实时延伸至当前K线
Slope-filtered for accuracy / 斜率过滤确保准确性
🎚️ Multi-Timeframe Analysis / 多时间框架分析
Higher timeframe trend filter (default 4H) / 大周期趋势过滤(默认4小时)
Prevents counter-trend trades / 防止逆势交易
Configurable timeframe / 可配置时间周期
📊 Volume Confirmation / 成交量确认
Filters signals based on volume strength / 基于成交量强度过滤信号
20-period volume MA comparison / 与20期成交量均线对比
High-volume bars highlighted / 高成交量K线高亮显示
🎯 Risk Management Tools / 风险管理工具
Automatic SL/TP calculation and display / 自动计算并显示止损止盈
Visual stop loss and take profit lines / 可视化止损止盈线条
Risk percentage and R:R ratio display / 显示风险百分比和盈亏比
Dynamic stop loss sizing (0.3% - 1.5%) / 动态止损范围(0.3% - 1.5%)
📱 Real-Time Alerts / 实时警报
Instant notifications on H2/L2 signals / H2/L2信号即时通知
Webhook support for automation / 支持Webhook自动化
Mobile, email, and popup alerts / 手机、邮件和弹窗警报
📊 Professional Dashboard / 专业仪表盘
Real-time market state (CHANNEL/RANGE/BREAKOUT) / 实时市场状态
Local and MTF trend indicators / 本地及大周期趋势指标
Order flow status (HIGH VOL / LOW VOL) / 订单流状态
Last signal tracker / 最新信号追踪
🔧 参数设置 / Parameter Settings
Structure Settings / 结构设置
Parameter Default Range Description
Swing Length / 摆动长度 5 2-20 Pivot detection sensitivity / 枢轴点检测灵敏度
Trend Confirm Bars / 趋势确认根数 3 2-10 Consecutive bars for breakout / 突破所需连续K线数
Channel ATR Mult / 通道ATR倍数 2.0 1.0-5.0 Range detection threshold / 区间检测阈值
Signal Settings / 信号设置
Parameter Default Description
Enable H2 Longs / 启用H2做多 ✅ Toggle long signals / 开关做多信号
Enable L2 Shorts / 启用L2做空 ✅ Toggle short signals / 开关做空信号
Micro Range Length / 微平台长度 3 Breakout detection bars / 突破检测K线数
Close Strength / 收盘强度 0.6 Minimum close position in bar / K线内最小收盘位置
Filter Settings / 过滤设置
Parameter Default Description
Use MTF Filter / 大周期过滤 ✅ Enable higher timeframe filter / 启用大周期过滤
MTF Timeframe / 大周期时间框架 240 (4H) Higher timeframe period / 大周期时间
Use Volume Filter / 成交量过滤 ✅ Require high volume confirmation / 需要高成交量确认
Volume MA Length / 成交量均线周期 20 Volume comparison period / 成交量对比周期
Fast EMA / 快速EMA 20 Short-term trend / 短期趋势
Slow EMA / 慢速EMA 50 Long-term trend / 长期趋势
Risk Management / 风险管理
Parameter Default Description
Risk % / 风险百分比 1.0% Risk per trade / 每笔交易风险
R:R Ratio / 盈亏比 2.0 Reward to risk ratio / 盈亏比率
Max SL ATR / 最大止损ATR 3.0 Maximum stop loss in ATR / 最大止损ATR倍数
Min SL % / 最小止损百分比 0.3% Minimum stop loss percentage / 最小止损百分比
Max SL % / 最大止损百分比 1.5% Maximum stop loss percentage / 最大止损百分比
📖 使用方法 / How to Use
1. 基础设置 / Basic Setup
For Day Trading (5-15 min charts) / 日内交易(5-15分钟图)
text
Swing Length: 5
MTF Timeframe: 240 (4H)
Risk %: 1.0%
R:R: 2.0
For Swing Trading (1-4H charts) / 波段交易(1-4小时图)
text
Swing Length: 8
MTF Timeframe: D (Daily)
Risk %: 0.5%
R:R: 3.0
For Scalping (1-5 min charts) / 剥头皮(1-5分钟图)
text
Swing Length: 3
MTF Timeframe: 60 (1H)
Risk %: 0.5%
R:R: 1.5
Use Volume Filter: ✅
2. 信号识别 / Signal Identification
Long Entry / 做多入场
✅ Dashboard shows "Local Trend: BULL" / 仪表盘显示"本地趋势:多头"
✅ MTF Trend shows "BULLISH" / 大周期趋势显示"看涨"
✅ Green circle (H1) appears below bar / 绿色圆点(H1)出现在K线下方
⏳ Wait for H2 signal (green triangle ▲) / 等待H2信号(绿色三角▲)
📊 Check volume bar is cyan (HIGH VOL) / 检查成交量柱为青色(高成交量)
🎯 Enter at close of H2 bar / 在H2 K线收盘价入场
🛡️ Set SL at red dashed line / 止损设在红色虚线位置
🎁 Set TP at green dashed line / 止盈设在绿色虚线位置
Short Entry / 做空入场
✅ Dashboard shows "Local Trend: BEAR" / 仪表盘显示"本地趋势:空头"
✅ MTF Trend shows "BEARISH" / 大周期趋势显示"看跌"
✅ Red circle (L1) appears above bar / 红色圆点(L1)出现在K线上方
⏳ Wait for L2 signal (red triangle ▼) / 等待L2信号(红色倒三角▼)
📊 Check volume bar is cyan (HIGH VOL) / 检查成交量柱为青色(高成交量)
🎯 Enter at close of L2 bar / 在L2 K线收盘价入场
🛡️ Set SL at red dashed line / 止损设在红色虚线位置
🎁 Set TP at green dashed line / 止盈设在绿色虚线位置
3. 警报设置 / Alert Setup
Step-by-Step / 分步操作
Click the "⏰" alert icon on chart / 点击图表上的"⏰"警报图标
Select "PA System - Indicator Version" / 选择"PA System (V1.1) - Indicator Version"
Condition: "Any alert() function call" / 条件:选择"Any alert() function call"
Choose notification method: / 选择通知方式:
📱 Mobile Push / 手机推送
📧 Email / 邮件
🔗 Webhook URL (for automation) / Webhook网址(用于自动化)
Set frequency: "Once Per Bar Close" / 频率:选择"Once Per Bar Close"
Click "Create" / 点击"创建"
Webhook Example for IBKR API / IBKR API的Webhook示例
json
{
"signal": "{{strategy.order.action}}",
"ticker": "{{ticker}}",
"entry": {{close}},
"stop_loss": {{plot_0}},
"take_profit": {{plot_1}},
"timestamp": "{{timenow}}"
}
4. 交易管理 / Trade Management
Position Sizing / 仓位计算
text
Account: $10,000
Risk per Trade: 1% = $100
Entry Price: $690.45
Stop Loss: $687.38
Risk per Share: $690.45 - $687.38 = $3.07
Position Size: $100 / $3.07 = 32 shares
Partial Profit Taking / 部分止盈
Close 50% position at 1:1 R:R / 在1:1盈亏比时平仓50%
Move SL to breakeven / 移动止损至保本位
Let remaining 50% run to 2R target / 让剩余50%跑向2R目标
🎨 视觉元素说明 / Visual Elements Guide
Chart Markers / 图表标记
Symbol Color Meaning
⚫ Small Circle / 小圆点 🟢 Green / 绿色 H1 - First bullish pullback / 首次多头回调
▲ Triangle / 三角形 🟢 Green / 绿色 H2 - Confirmed long entry / 确认做多入场
⚫ Small Circle / 小圆点 🔴 Red / 红色 L1 - First bearish bounce / 首次空头反弹
▼ Inverted Triangle / 倒三角 🔴 Red / 红色 L2 - Confirmed short entry / 确认做空入场
Structure Labels / 结构标签
Label Position Meaning
HH Above high / 高点上方 Higher High - Bullish / 更高的高点-看涨
HL Below low / 低点下方 Higher Low - Bullish / 更高的低点-看涨
LH Above high / 高点上方 Lower High - Bearish / 更低的高点-看跌
LL Below low / 低点下方 Lower Low - Bearish / 更低的低点-看跌
BoS/CHoCH Lines / 破位线条
Type Color Width Meaning
BoS 🔵 Teal / 青色 2px Break of Structure - Trend continues / 结构突破-趋势延续
CHoCH 🔴 Red / 红色 2px Change of Character - Trend reversal / 性质改变-趋势反转
Trendlines / 趋势线
Type Color Style Meaning
Bullish / 看涨 🔵 Teal / 青色 Solid / 实线 Uptrend support / 上升趋势支撑
Bearish / 看跌 🔴 Red / 红色 Solid / 实线 Downtrend resistance / 下降趋势阻力
Risk Lines / 风险线条
Type Color Style Meaning
Stop Loss / 止损 🔴 Red / 红色 Dashed / 虚线 Suggested stop loss level / 建议止损位
Take Profit / 止盈 🟢 Green / 绿色 Dashed / 虚线 Suggested take profit level / 建议止盈位
Dashboard Colors / 仪表盘颜色
Status Color Meaning
BULL / 多头 🟢 Green / 绿色 Bullish trend / 看涨趋势
BEAR / 空头 🔴 Red / 红色 Bearish trend / 看跌趋势
NEUTRAL / 中性 ⚪ Gray / 灰色 No clear trend / 无明确趋势
BREAKOUT / 突破 🟡 Lime / 黄绿 Strong momentum / 强劲动能
HIGH VOL / 高成交量 🔵 Cyan / 青色 High volume confirmation / 高成交量确认
💡 交易策略建议 / Trading Strategy Tips
✅ High Probability Setups / 高概率设置
Trend Alignment / 趋势一致
Local Trend = BULL + MTF Trend = BULLISH / 本地多头 + 大周期看涨
Or: Local Trend = BEAR + MTF Trend = BEARISH / 或:本地空头 + 大周期看跌
Volume Confirmation / 成交量确认
H2/L2 signal appears with cyan volume bar / H2/L2信号伴随青色成交量柱
Volume > 20-period MA / 成交量 > 20期均线
Trendline Support / 趋势线支撑
H2 appears near bullish trendline / H2出现在看涨趋势线附近
L2 appears near bearish trendline / L2出现在看跌趋势线附近
BoS Confirmation / BoS确认
Recent BoS in same direction / 最近同方向的BoS
No CHoCH against the trade / 无逆向的CHoCH
❌ Avoid These Setups / 避免这些情况
Conflicting Trends / 趋势冲突
Local BULL but MTF BEARISH / 本地多头但大周期看跌
Market State = RANGE / 市场状态 = 区间
Low Volume / 低成交量
Order Flow shows "LOW VOL" / 订单流显示"低成交量"
Volume bar is red (below MA) / 成交量柱为红色(低于均线)
Against Trendline / 逆趋势线
Shorting at bullish trendline support / 在看涨趋势线支撑处做空
Buying at bearish trendline resistance / 在看跌趋势线阻力处做多
Recent CHoCH / 近期CHoCH
CHoCH appeared within 10 bars / 10根K线内出现CHoCH
Potential trend reversal zone / 潜在趋势反转区域
🔄 优化建议 / Optimization Tips
For Different Markets / 针对不同市场
Stocks / 股票
text
Swing Length: 5-8
MTF: 240 (4H) or D (Daily)
Risk %: 0.5-1.0%
Best on: SPY, QQQ, AAPL, TSLA
Forex / 外汇
text
Swing Length: 5
MTF: 240 (4H)
Risk %: 1.0-2.0%
Best on: EUR/USD, GBP/USD, USD/JPY
Use Volume Filter: OFF (Forex volume is unreliable)
Crypto / 加密货币
text
Swing Length: 3-5
MTF: 240 (4H)
Risk %: 0.5-1.0% (high volatility)
Max SL %: 2.0-3.0%
Best on: BTC, ETH, SOL
Futures / 期货
text
Swing Length: 5
MTF: 240 (4H)
Risk %: 1.0-1.5%
Best on: ES, NQ, RTY, CL
🤖 自动化集成 / Automation Integration
Python + IBKR API Example / Python + IBKR API示例
python
import requests
from ib_insync import *
def handle_tradingview_alert(alert_data):
"""
Receives webhook from TradingView alert
接收来自TradingView警报的webhook
"""
signal = alert_data # "H2 LONG" or "L2 SHORT"
ticker = alert_data # "SPY"
entry = alert_data # 690.45
stop_loss = alert_data # 687.38
take_profit = alert_data # 696.59
# Connect to IBKR
ib = IB()
ib.connect('127.0.0.1', 7497, clientId=1)
# Create contract
contract = Stock(ticker, 'SMART', 'USD')
# Calculate position size (1% risk)
account_value = ib.accountValues() .value
risk_amount = float(account_value) * 0.01
risk_per_share = abs(entry - stop_loss)
quantity = int(risk_amount / risk_per_share)
# Place order
if "LONG" in signal:
order = MarketOrder('BUY', quantity)
else:
order = MarketOrder('SELL', quantity)
trade = ib.placeOrder(contract, order)
# Set stop loss and take profit
ib.placeOrder(contract, StopOrder('SELL', quantity, stop_loss))
ib.placeOrder(contract, LimitOrder('SELL', quantity, take_profit))
ib.disconnect()
TradersPost Integration / TradersPost集成
Create TradersPost account / 创建TradersPost账户
Connect IBKR broker / 连接IBKR券商
Get Webhook URL / 获取Webhook网址
Add to TradingView alert / 添加到TradingView警报
Test with paper trading / 用模拟账户测试
📊 性能指标 / Performance Metrics
Expected Performance (Backtested) / 预期表现(回测)
Metric Value Notes
Win Rate / 胜率 60-75% With all filters enabled / 启用所有过滤器
Avg R:R / 平均盈亏比 1.8-2.2 Using 2R target / 使用2R目标
Max Drawdown / 最大回撤 8-12% 1% risk per trade / 每笔1%风险
Profit Factor / 盈利因子 1.8-2.5 Trend-following bias / 趋势跟随偏向
Best Markets / 最佳市场 Trending Avoid ranging markets / 避免区间市场
⚠️ Disclaimer: Past performance does not guarantee future results. Always test in paper trading first.
⚠️ 免责声明:历史表现不保证未来结果。请先在模拟账户测试。
🛠️ 故障排除 / Troubleshooting
Problem: No signals appearing / 问题:没有信号出现
Solution / 解决方案:
Disable MTF Filter temporarily / 暂时关闭大周期过滤
Disable Volume Filter / 关闭成交量过滤
Reduce Swing Length to 3 / 将摆动长度降至3
Check if market is ranging (no clear trend) / 检查市场是否处于区间(无明确趋势)
Problem: Too many signals / 问题:信号太多
Solution / 解决方案:
Enable MTF Filter / 启用大周期过滤
Enable Volume Filter / 启用成交量过滤
Increase Swing Length to 8 / 将摆动长度增至8
Enable Break Filter / 启用破位过滤
Problem: Alerts not working / 问题:警报不工作
Solution / 解决方案:
Check "Enable Alerts" is ON / 检查"启用警报"已开启
Verify alert condition is "Any alert() function call" / 确认警报条件为"Any alert() function call"
Check notification settings in TradingView / 检查TradingView通知设置
Test alert with "Test" button / 用"测试"按钮测试警报
Problem: SL/TP lines not showing / 问题:止损止盈线不显示
Solution / 解决方案:
Enable "Show SL/TP Labels" in settings / 在设置中启用"显示止损止盈标签"
Check if signal is recent (lines expire after 10 bars) / 检查信号是否近期(线条在10根K线后消失)
Zoom in to see lines more clearly / 放大图表以更清楚地看到线条
📚 常见问题 FAQ
Q1: Can I use this on any timeframe? / 可以在任何时间框架使用吗?
A: Yes, but works best on 5min-4H charts. Recommended: 15min (day trading), 1H (swing trading).
可以,但在5分钟-4小时图表效果最佳。推荐:15分钟(日内交易),1小时(波段交易)。
Q2: Do I need to enable all filters? / 需要启用所有过滤器吗?
A: No. Start with all enabled, then disable based on your risk tolerance. MTF filter is highly recommended.
不需要。从全部启用开始,然后根据风险承受能力禁用。强烈推荐MTF过滤器。
Q3: Can I automate this with IBKR? / 可以与IBKR自动化吗?
A: Yes! Use TradingView alerts + Webhook + Python script + IBKR API. See automation example above.
可以!使用TradingView警报 + Webhook + Python脚本 + IBKR API。参见上方自动化示例。
Q4: What's the difference between Strategy and Indicator version? / 策略版和指标版有什么区别?
A: Strategy = backtesting only. Indicator = real-time alerts + automation. Use both: backtest with strategy, trade with indicator.
策略版=仅回测。指标版=实时警报+自动化。两者结合使用:用策略版回测,用指标版交易。
Q5: Why does H2 appear but no trade? / 为什么出现H2但没有交易?
A: This is an indicator, not a strategy. You need to manually place orders or use automation via alerts.
这是指标,不是策略。你需要手动下单或通过警报使用自动化。
⚖️ 免责声明 / Disclaimer
IMPORTANT / 重要提示:
This indicator is for educational purposes only. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always:
本指标仅供教育目的。交易涉及重大亏损风险。历史表现不保证未来结果。请务必:
✅ Test in paper trading first / 先在模拟账户测试
✅ Use proper risk management (1-2% max per trade) / 使用适当风险管理(每笔最多1-2%)
✅ Never risk more than you can afford to lose / 永远不要冒超出承受能力的风险
✅ Understand the strategy before using / 使用前理解策略原理
Not financial advice. Trade at your own risk.
非投资建议。交易风险自负。
FVG - MTF Confirmed Tracker [JP/EN]Indicator Description: FVG MTF Concluded Bar Tracker
This indicator is a highly functional tool that identifies FVG for the currently displayed bar or a higher-level bar (MTF) and determines its "resolution" when the candlestick is resolved.
Its most notable feature is that it only displays history (gray) on the chart and sends an alert when a "significant level that has been continuously observed for a certain period of time" is resolved.
1. Timeframe Settings
Base Timeframe: Select the timeframe on which to detect FVG. Select "Same as chart" to use the current bar, or select another bar (1-hour, 4-hour, etc.) to project the FVG of the higher-level bar onto the current chart.
2. Active FVG Settings
Sets the currently active support/resistance area that has not yet been filled by price.
Show Bull/Bear: Individually toggles whether to display bull (buy) and bear (sell) FVG.
Color: Specifies the color of the box for the unresolved state.
Extend Right (Active): When enabled, the box will continue to extend indefinitely toward the right edge of the chart until the FVG is resolved.
Max Active FVG: This sets the maximum number of unresolved boxes to display on the chart. When a new FVG is detected, the oldest unresolved box will be automatically deleted if it exceeds this limit, saving resources.
3. Filled FVG Settings (Resolved, Grayed Out, Determination Logic)
These are very important settings for displaying history when the price fills an FVG.
Show Filled: Select whether to leave resolved FVGs grayed out (default color) as "history."
Color: Specifies the color of boxes that have been resolved (Filled).
Extend Right (Filled): When this is turned off, the box extension will stop at the candlestick where the resolution is confirmed, making the resolution point clear.
Max Filled FVG: This sets the maximum number of grayed out boxes to display as history. When the limit is reached, the oldest history will be deleted.
Min Bars to Keep & Alert (Important): This is the threshold for the number of bars elapsed between the occurrence of an FVG and its resolution.
If the threshold is not met: The event is considered a temporary reaction, and no alert will be sounded. The event will also be deleted without being recorded in the history (gray).
If the threshold is met or exceeded: The event is considered a significant market event, and the box will turn gray and an alert will be sent.
4. Alert Settings (Alert Notification Logic)
Alerts are executed in perfect sync with the "resolution of significant levels (graying out)."
Alert when Bull / Bear turns Gray: A notification will be sent the moment a bullish or bearish FVG is resolved after meeting the threshold and turning gray.
Execution Timing: A notification will only be sent when the candlestick is confirmed. It will not be triggered if the candlestick is only momentarily touched by the wick midway through the candlestick. This allows you to know for sure that the event was resolved at the time of closing.
インジケーター解説:FVG MTF 確定足トラッカー
このインジケーターは、現在表示している足、または上位足(MTF)のFVGを特定し、その「解消」をローソク足の確定時に判定する高機能ツールです。
最大の特徴は、**「一定期間意識され続けた重要な水準」**が解消された時のみ、チャートに履歴(グレー)を残し、アラートを通知する設計にあります。
1. Timeframe Settings(時間足設定)
Base Timeframe / 基準にする時間足: FVGを検知する時間足を選択します。「Same as chart(チャートと同じ)」を選べば現在の足、それ以外(1時間足、4時間足など)を選べば上位足のFVGを現在のチャートに投影します。
2. Active FVG Settings(未解消時の設定ロジック)
まだ価格に埋められていない、現在有効なサポート・レジスタンス領域の設定です。
Show Bull / Bear: ブル(買い)およびベア(売り)のFVGを表示するかどうかを個別に切り替えます。
Color: 未解消状態のボックスの色を指定します。
Extend Right (Active): 有効にすると、FVGが解消されるまでボックスをチャートの右端に向かって無制限に延長し続けます。
Max Active FVG: チャート上に表示する未解消ボックスの最大数です。新しいFVGが検知された際、この上限を超えていると最も古い未解消ボックスが自動的に削除され、リソースを節約します。
3. Filled FVG Settings(解消済み・グレー化・判定本数ロジック)
価格がFVGを埋めた際の、履歴表示に関する非常に重要な設定項目です。
Show Filled: 解消されたFVGを「履歴」としてグレー表示(デフォルト色)で残すかどうかを選択します。
Color: 解消済み(Filled)状態になったボックスの色を指定します。
Extend Right (Filled): これをOFFにすると、解消が確定したローソク足の位置でボックスの延長が止まり、解消地点が明確になります。
Max Filled FVG: 履歴として残すグレーボックスの最大数です。上限に達すると、古い履歴から順に削除されます。
Min Bars to Keep & Alert (重要): FVGが発生してから解消されるまでの「経過本数」の閾値です。
判定本数に満たない場合: 一時的な反応とみなし、アラートを鳴らさず、履歴(グレー)にも残さず削除します。
判定本数以上の場合: 市場で十分に意識された「重要な水準」とみなし、ボックスをグレーに変更し、アラートを通知します。
4. Alert Settings(アラート通知ロジック)
アラートは「重要水準の解消(グレー化)」と完全に同期して実行されます。
Alert when Bull / Bear turns Grey: ブル/ベアそれぞれのFVGが、上記の「判定本数」を満たした状態で解消され、グレーに変化した瞬間に通知を送ります。
実行タイミング: ローソク足の確定時にのみ通知されます。足の途中のヒゲで一時的に触れただけでは鳴りません。これにより、クローズ時点で確実に解消されたことのみを把握できます。
Wedge Pattern [Kodexius]Wedge Pattern is a chart-overlay indicator designed to detect and manage classic Rising Wedge (bearish) and Falling Wedge (bullish) structures using strict, rules-based validation. The script focuses on producing clean, tradable wedge prints by building both boundaries from confirmed pivot swings, enforcing a mandatory “no closes outside the wedge” condition during formation, and requiring the wedge apex to be projected into the future to avoid premature or distorted patterns.
This implementation is built for practical execution charts. It continuously updates the active wedge boundaries in real time, clearly labels the pattern type, and reacts decisively when price confirms a valid breakout. When enabled, it also projects a measured-move target derived from the wedge geometry, so the trader can quickly evaluate reward potential without manual projection.
The detection logic is intentionally conservative. Rather than printing every possible converging structure, it aims to identify wedges that respect structural integrity: multiple touches on each boundary, controlled price action inside the converging range, and a valid convergence point (apex) ahead of the current bar. The result is a wedge tool that prioritizes quality, readability, and consistent behavior across symbols and timeframes.
🔹 Features
🔸 Rising and Falling Wedge Detection (Trendline Based)
The indicator detects two wedge types by constructing an upper trendline from pivot highs and a lower trendline from pivot lows:
Rising Wedge (Bearish): both lines slope upward, and the lower line rises faster than the upper line, creating a tightening upward channel that typically resolves with a downside break.
Falling Wedge (Bullish): both lines slope downward, and the upper line falls faster than the lower line, producing a tightening downward channel that typically resolves with an upside break.
This slope relationship is the core wedge classifier. It ensures the script is not just drawing random converging lines, but explicitly requires the characteristic “compression” geometry that defines wedges.
🔸 Pivot-Confirmed Structure with User Control
Wedges are built from confirmed pivots using:
Pivot Left and Pivot Right inputs to control how “strict” a pivot must be.
Min. Touches per Line to enforce multiple confirmations on each boundary.
Standard technical analysis commonly requires at least three touches to validate a trendline. This script supports that workflow by requiring a minimum number of pivot points before a wedge is eligible for drawing.
🔸 Mandatory Integrity Rule: No Closes Outside the Boundaries
A key quality filter is applied before a wedge can be accepted:
During formation, no candle close is allowed outside the upper or lower boundary.
If any close is detected above the upper line or below the lower line (with tick tolerance), the candidate wedge is rejected. This prevents patterns that already “broke” before they were formally detected and reduces false positives caused by messy price action.
🔸 Apex Validation to Avoid Distorted Prints
The wedge apex (the projected intersection point of the two trendlines) must be in the future. This avoids degenerate cases where lines intersect behind current price, which often indicates the structure is not a valid wedge or is already past its useful phase.
🔸 Live Updating Boundaries for Active Patterns
Once a wedge becomes active, its upper and lower lines are extended forward bar by bar. The script recalculates the boundary price at the current bar index using the stored slope, then updates the line endpoints so the wedge remains visually accurate as time advances.
🔸 Breakout Engine with Directional Confirmation
The script differentiates between:
Correct breakout: the wedge breaks in the expected direction.
Rising wedge breaks downward (close below the lower boundary).
Falling wedge breaks upward (close above the upper boundary).
When this happens, the wedge is marked as broken and labeled as BREAKOUT on the chart.
🔸 Invalidation and Failure Handling
If price violates the wedge in the wrong direction, or if the wedge collapses into an impossible structure (upper boundary falls below or equals the lower boundary), the wedge is flagged as FAILED. This keeps signals honest and prevents lingering drawings that no longer represent a valid pattern.
🔸 Optional Target Projection (Measured Move)
When Show Target Projection is enabled, the script plots a dashed target line and a target label after a valid breakout. The target is computed as a measured move using the wedge height, projected from the breakout boundary in the breakout direction. This provides an immediate objective reference for potential continuation.
🔸 Clean Object Management and Chart Readability
To maintain clarity, the script manages the “active” wedge per type:
If a new wedge is detected while an older one is still active and not broken or failed, the old drawings are removed and replaced with the newer valid pattern.
This prevents chart clutter and keeps the display focused on the most relevant wedge structures.
🔹 Calculations
1) Pivot Collection
The script uses pivot functions to confirm swing points:
float ph = ta.pivothigh(high, INPUT_PIVOT_LEFT, INPUT_PIVOT_RIGHT)
float pl = ta.pivotlow(low, INPUT_PIVOT_LEFT, INPUT_PIVOT_RIGHT)
if not na(ph)
pivot_highs.push(Coordinate.new(bar_index - INPUT_PIVOT_RIGHT, ph))
if not na(pl)
pivot_lows.push(Coordinate.new(bar_index - INPUT_PIVOT_RIGHT, pl))
Each pivot is stored as a Coordinate containing:
index: the bar index where the pivot is confirmed
price: the pivot high or pivot low value
The arrays are capped (for example, last 20 pivots) to control memory and keep selection relevant.
2) Trendline Construction and Slope
A wedge candidate uses the earliest and latest required pivot points for each line. For each boundary, slope is computed as:
method calc_slope(Trendline this) =>
(this.end.price - this.start.price) / (this.end.index - this.start.index)
With slope known, the trendline value at any bar index is:
method get_price_at(Trendline this, int bar_idx) =>
this.start.price + this.slope * (bar_idx - this.start.index)
This approach allows the script to update wedge boundaries consistently without re-fitting lines on every bar.
3) Wedge Type Classification (Geometry Rules)
After both slopes are calculated, wedge type is determined by slope direction and relative steepness:
Rising wedge requires both slopes positive and lower slope greater than upper slope.
Falling wedge requires both slopes negative and upper slope more negative than lower slope (upper line falls faster).
In code logic:
if tl_up.slope > 0 and tl_lo.slope > 0 and tl_lo.slope > tl_up.slope
w_type := 1 // Rising
if tl_up.slope < 0 and tl_lo.slope < 0 and tl_up.slope < tl_lo.slope
w_type := 2 // Falling
This enforces converging boundaries and avoids simple parallel channels.
4) Apex Projection (Trendline Intersection)
The apex is the projected intersection x-coordinate of the two trendlines:
method get_apex_index(Wedge this) =>
float m1 = this.upper.slope
float m2 = this.lower.slope
float y1 = this.upper.start.price
float y2 = this.lower.start.price
int x1 = this.upper.start.index
int x2 = this.lower.start.index
float apex_x = (y2 - y1 + m1 * x1 - m2 * x2) / (m1 - m2)
math.round(apex_x)
Validation requires:
apex_idx > bar_index (apex must be in the future)
This prevents late or structurally invalid wedges from being activated.
5) Mandatory “No Close Outside” Validation
Before activation, the script verifies the pattern has not been violated by candle closes:
method check_violation(Wedge this, int from_idx, int to_idx) =>
bool violated = false
for i = from_idx to to_idx
float up_p = this.upper.get_price_at(i)
float lo_p = this.lower.get_price_at(i)
float c_p = close
if c_p > up_p + syminfo.mintick or c_p < lo_p - syminfo.mintick
violated := true
break
violated
Interpretation:
For every bar from wedge start to current bar, the close must remain between the projected upper and lower boundary prices.
A tick tolerance (syminfo.mintick) is used to reduce micro false violations.
6) Live Update and Breakout Detection
Once active, lines are extended to the current bar and boundary prices are computed:
float u_p = w.upper.get_price_at(bar_index)
float l_p = w.lower.get_price_at(bar_index)
bool b_up = close > u_p
bool b_dn = close < l_p
Correct breakout conditions:
Rising wedge breakout: close below lower boundary.
Falling wedge breakout: close above upper boundary.
if (w.is_rising and b_dn) or (not w.is_rising and b_up)
w.is_broken := true
Invalidation rules include:
wrong-direction break
boundary crossover (upper <= lower)
7) Target Projection (Measured Move)
If target display is enabled, the script calculates wedge height and projects a target from the breakout side:
float m = math.abs(w.upper.start.price - w.lower.get_price_at(w.upper.start.index))
float t = w.is_rising ? l_p - m : u_p + m
Interpretation:
m represents the wedge height near the start of the formation.
t is the target price, projected in the breakout direction.
Rising wedge: target below the lower boundary.
Falling wedge: target above the upper boundary.
A dashed target line and label are then placed forward in time for readability.
MTF EMA50/200 // ADX (Auto TF Pairing) with SL/TP // v6Strategy overview (EMA50/EMA200 + ADX, multi-timeframe):
This system trades only in the direction of the higher-timeframe trend and uses the current chart timeframe for precise entries.
Trend filter (Higher TF):
Bull trend: EMA50 > EMA200 and ADX ≥ threshold → only LONGs allowed
Bear trend: EMA50 < EMA200 and ADX ≥ threshold → only SHORTs allowed
If ADX is below the “no-trend” threshold, the market is considered choppy and trades are avoided.
Entry (Lower TF / chart TF):
Enter only when the chart timeframe confirms momentum in the HTF direction using one of:
Touch: price pulls back to EMA50 and closes back on the trend side
Rejection: stricter “touch + reject” near EMA50
Cross: close crosses EMA50 in the trend direction
Stop Loss (structure + volatility):
LONG: below the safer of last swing low or EMA50, minus an ATR buffer
SHORT: above the safer of last swing high or EMA50, plus an ATR buffer
Take Profit (risk-based):
Targets are set as multiples of risk (R) from entry:
TP1 = 2R (default)
TP2 = 3R (optional)
The indicator plots only the latest trade’s Entry (black line), Stop (red dashed), and TP (green dashed), and it auto-pairs the chart timeframe with a “next level up” higher timeframe for the trend filter.






















