指標和策略
Bionic -- Expected Weekly Levels (Public)This script will draw lines for Expected Weekly Levels based upon Previous Friday Close, Implied Volatility (EOD Friday), and the square root of Days to Expire (always 7) / 365.
Script will draw 2 high and low levels:
*1st levels are 1 standard deviation from the Previous Friday Close.
* 2nd levels are 2 standard deviation from the Previous Friday Close.
There are also a 1/2 Low and 1/2 Low 1st level. These are 1/2 a standard deviation and act more as a point of interest level. 1/2 levels have 34% probability.
Configurations:
* All lines styles are individually configurable
* All lines can individually be turned on/off
* Text for all lines can be changed
* Global config allows for the
* Lines to show the price on the label
* Lines to have text in the label
* Hide or show all labels
* Lines offset from price is configurable
* Label size is configurable
[TEST gpt ]RSI & Volume Contrarian Strategy vtest okaytest okaytest okaytest okaytest okaytest okaytest okaytest okaytest okaytest okaytest okay
dine1197 15m Trend Strategy for XAUUSD This is the best strategy for trading on XAUUSD at 15 Minutes timeframe for which you get a signal as per the trend.
EMA Analyses Intramir EMA 8
EMA 50
EMA 200
Crosses 8-50
in constant development ....
With more Indicator for more backtesting Strategies
Shax Trader
4EMA+3EMA+WMAAll Important Moving Average including 4 configurable EMA, 3 EMA200 (High, Close, Low) and WMA 720. It it essential MA must use.
Crypto Intraday Futures Strategy//@version=5
strategy("Crypto Intraday Futures Strategy", overlay=true, margin_long=100, margin_short=100, commission_type=strategy.commission.percent, commission_value=0.05, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Input parameters
fast_length = input.int(9, "Fast EMA Length")
slow_length = input.int(21, "Slow EMA Length")
rsi_length = input.int(14, "RSI Length")
overbought = input.int(70, "Overbought Level")
oversold = input.int(30, "Oversold Level")
stop_loss = input.float(1.0, "Stop Loss (%)") / 100
take_profit = input.float(2.0, "Take Profit (%)") / 100
session_close = input.session("2300-0000", "Session Close Time")
// Calculate indicators
fast_ema = ta.ema(close, fast_length)
slow_ema = ta.ema(close, slow_length)
rsi = ta.rsi(close, rsi_length)
// Time condition for session close
is_session = time(timeframe.period, session_close)
close_time = not is_session and is_session
// Trading conditions
ema_bullish = ta.crossover(fast_ema, slow_ema)
ema_bearish = ta.crossunder(fast_ema, slow_ema)
rsi_bullish = rsi < oversold
rsi_bearish = rsi > overbought
// Entry conditions
long_condition = ema_bullish and rsi_bullish
short_condition = ema_bearish and rsi_bearish
// Exit conditions
stop_level = strategy.position_avg_price * (1 - stop_loss)
take_level = strategy.position_avg_price * (1 + take_profit)
// Execute strategy
if close_time
strategy.close_all()
if long_condition and not close_time
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", "Long", stop=stop_level, limit=take_level)
if short_condition and not close_time
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", "Short", stop=stop_level, limit=take_level)
// Plotting
plot(fast_ema, color=color.blue, title="Fast EMA")
plot(slow_ema, color=color.orange, title="Slow EMA")
hline(overbought, "Overbought", color=color.red)
hline(oversold, "Oversold", color=color.green)
Camarilla Trading Strategy//@version=5
strategy("Camarilla Trading Strategy", overlay=true)
// Input levels
S1 = input(100, title="S1")
S2 = input(98, title="S2")
S3 = input(96, title="S3")
S4 = input(94, title="S4")
R1 = input(104, title="R1")
R2 = input(106, title="R2")
R3 = input(108, title="R3")
R4 = input(110, title="R4")
open_price = input(97, title="Open Price")
// Current price
current_price = close
// Trading Logic
var string trade_signal = "No trade signal"
var float stoploss = na
var float target1 = na
var float target2 = na
var float target3 = na
if open_price > S3 and open_price < R3
if current_price < S3
trade_signal := "BUY if price moves above S3"
stoploss := (S3 + S4) / 2
target1 := R1
target2 := R2
target3 := R3
if current_price > R3
trade_signal := "SELL if price moves below R3"
stoploss := (R3 + R4) / 2
target1 := S1
target2 := S2
target3 := S3
if open_price >= R3 and open_price <= R4
if current_price > R4
trade_signal := "BUY"
stoploss := R3
target1 := R3 * 1.005
target2 := R3 * 1.01
target3 := R3 * 1.015
if current_price < R3
trade_signal := "SELL"
stoploss := (R3 + R4) / 2
target1 := S1
target2 := S2
target3 := S3
if open_price >= S4 and open_price <= S3
if current_price > S3
trade_signal := "BUY"
stoploss := (S3 + S4) / 2
target1 := R1
target2 := R2
target3 := R3
if current_price < S4
trade_signal := "SELL"
stoploss := (S3 + S4) / 2
target1 := S4 * 0.995
target2 := S4 * 0.99
target3 := S4 * 0.985
if open_price >= R4
if current_price < R3
trade_signal := "SELL"
stoploss := (R3 + R4) / 2
target1 := S1
target2 := S2
target3 := S3
if open_price <= S4
if current_price > S3
trade_signal := "BUY"
stoploss := (S3 + S4) / 2
target1 := R1
target2 := R2
target3 := R3
// Plot trade signals on chart
label = label.new(x=time, y=current_price, text=trade_signal, color=color.white, size=size.small)
// Execute trades
if trade_signal == "BUY"
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", from_entry="Long", stop=stoploss, limit=target3)
if trade_signal == "SELL"
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", from_entry="Short", stop=stoploss, limit=target3)
Market open (Asia) vertical markerShows a vertical shaded marker on the start of the trading day , which is in the Asia open. It puts a thicker marker on Monday's open, to visually see start of weeks in multi-day charts
RSI & Volume Divergence SignalThought for a second
Introducing the Dual Divergence Trading Indicator – your secret weapon to unlock hidden market reversals with precision and confidence.
Key Features:
Dual Confirmation: Simultaneously analyzes divergences between price and RSI as well as price and volume. When both indicators align, you receive clear BUY or SELL signals, reducing false entries.
Dynamic Pivot Detection: Utilizes advanced pivot algorithms to pinpoint key highs and lows, ensuring that divergence signals are both timely and reliable.
Visual Clarity: Bold “BUY” and “SELL” labels are plotted directly on your chart, making it easy to see potential trade opportunities at a glance.
Customizable Settings: Fine-tune the lookback period and RSI parameters to suit your trading style and the unique dynamics of different markets.
Built with Pine Script™ v6: Engineered for performance and accuracy on TradingView, giving you a competitive edge in fast-moving markets.
Why Choose Dual Divergence?
In today's volatile markets, relying on a single indicator can be risky. Our Dual Divergence Trading Indicator brings you the best of both worlds by confirming divergence signals through two independent sources—RSI and volume. This dual confirmation helps you identify genuine trend reversals before they unfold, so you can enter trades with greater confidence.
Whether you’re a seasoned trader or just starting out, this indicator empowers you to make data-driven decisions, cut through market noise, and stay one step ahead of the competition.
Elevate your trading strategy and discover hidden opportunities with the Dual Divergence Trading Indicator—because in trading, precision makes all the difference.
Feel free to adjust the parameters and settings to align with your personal trading style and market preferences. Happy Trading!
Candle Stick PatternsThis is a simple code to identify the most useful candlestick patterns on your chart.
The following patterns are supported:
bullish_harami
bearish_harami
bullish_engulfing
bearish_engulfing
hammer
hanging_man
gapping_up_doji
gapping_down_doji
takuri_line
dark_cloud_cover
piercing
homing_pigeon
descending_hawk
tweezers_bottom
tweezers_top
inverted_hammer
shooting_star
morning_star
evening_star
When you add the script to your chart, by default the bullish harami pattern will be visible.
To add your favourite pattern, go to the settings and tick the pattern of your choice.
Fibonacci Levels and EMAsTradingView Pine Script error explanation – “The 'undeclared identifier' error happens when TradingView cannot find the variable or function that we try to use.”
TRADINGCODE.NET
Pine Script scope and assignment solution – Define variables in global scope and use := inside if blocks
STACKOVERFLOW.COM
. This prevents “undeclared identifier” errors for variables set in conditional logic.
Pine Script plotting rules – “You can't use plot statements in ... any other local block in a script.” (must be global)
TOUCH-DT.COM
.
Example of invalid plot parameter causing error – using an unsupported 'dashed' style in plot() led to an undeclared identifier issue
REDDIT.COM
. Always use valid plot styles or drawing functions for custom line styles.
Fibonacci level calculation example – computing fib retracement levels from a high and low price
TRADINGVIEW.COM
(standard 23.6%, 38.2%, 50%, 61.8% formula).
CMP vs ATH PercentageThis indicator helps traders and investors track how the current market price (CMP) compares to the all-time high (ATH) price of an asset. It calculates the percentage difference between the CMP and ATH and displays it visually on the chart. A label is placed on the latest bar, showing key information like:
ATH (All-Time High Price)
CMP (Current Market Price)
Percentage Comparison (CMP as a percentage of ATH)
Additionally, the indicator plots a horizontal line at the ATH level to provide a clear visual reference for the price history.
Use Cases:
Identify price levels relative to historical highs.
Gauge whether the price is nearing or far from its ATH.
Quickly assess how much the price has recovered or declined from the ATH.
Customization:
You can modify the label's style, color, or text formatting according to your preferences. This indicator is useful for long-term analysis, especially when tracking stocks, indices, or other financial instruments on a weekly timeframe.
Note:
This indicator is designed to work on higher timeframes (e.g., daily or weekly) where ATH levels are more meaningful.
Toggle Timeframe MA BunchIndicator:
- 4 adjustable length MA's
- Set to EMA by default, can switch to SMA
- You can also hide one or more moving averages if you want
Uses:
- MA's chop in sideways markets, but are good for confirming trend reversals
- Can look at one short MA crossing over/under another
- Can look at short MA's crossing over/under long MA's
- Longer MA's can be used as support levels/zones for price on higher timeframes
The adjustable MA ribbon saves taking up multiple indicator slots on the chart.
Gap-Adjusted ChartEffect: Shifts prices to eliminate gaps, but distorts actual price levels (use for visual analysis only)
Session Gap RemoverIt calculates the gap between the current session’s open and the previous session’s close.
Accumulates these gaps over time and subtracts them from all subsequent prices.
This creates a continuous chart without gaps but distorts absolute price levels (use for technical analysis, not actual trading).
RSI + Bollinger Bands + MA200 This indicator incorporates momentum indicators of the RSI and Bollinger Bands and shows overbought and oversold areas when both indicators conditions have been met and lastly the 200ma gives the long term direction of the instrument.
Shifted Buy PressureDifferentiated Buy Pressure Indicator Documentation
Overview: The Differentiated Buy Pressure indicator is a custom Pine Script™ indicator designed to measure and visualize buy and sell pressure in the market. It calculates buy pressure based on a combination of volume, range, and gap, and provides a differentiated buy pressure which is shifted by 90°, offering predictive insights.
Inputs:
Window Size: The window size for average calculation (default: 20).
Show Overlay: Option to show the price overlay (default: false).
Overlay Boost Factor: Boosting factor for overlaying the price (default: 0.01).
Calculations:
Relative Range: Calculated as (high - low) / close.
Average Range: Simple moving average of the relative range over the specified window.
Average Volume: Simple moving average of the volume over the specified window.
Relative Gap: Calculated as open / close .
Average Gap: Simple moving average of the relative gap over the specified window.
Buy Pressure: Calculated using the formula: buy_pressure = -math.log(relative_range / avg_range * volume / avg_volume * relative_gap / avg_gap)
Differentiated Buy Pressure: Calculated as the difference between the current and previous buy pressure: diff_buy_pressure = buy_pressure - buy_pressure
Plots:
Zero Line: A horizontal line at zero for reference.
Buy Pressure: Plotted in blue, representing the calculated buy pressure.
Differentiated Buy Pressure: Plotted in red, representing the differentiated buy pressure.
Overlay: Optionally plots the price overlay boosted by the differentiated buy pressure.
Labels:
Labels are created to display the buy pressure and differentiated buy pressure values on the chart.
Usage: This indicator helps traders visualize the buy and sell pressure in the market. Positive values indicate buy pressure, while negative values indicate sell pressure. The differentiated buy pressure, shifted by 90°, provides predictive insights into future market movements.
This documentation provides a comprehensive overview of the Differentiated Buy Pressure indicator, explaining its purpose, inputs, calculations, and usage.
KAI QUANTUM Candles Analysis - Yearly BreakdownThe "KAI QUANTUM Analysis – Yearly Breakdown" indicator offers a comprehensive, year-by-year examination of candlestick behavior, enabling traders and analysts to gauge market dynamics over extended periods. Key features include:
Yearly Aggregation:
The indicator groups candlestick data by year, providing a clear snapshot of market behavior for each period.
Dual-Color Analysis:
It categorizes candles as bullish (green) or bearish (red) and computes statistics separately for each, allowing you to assess both upward and downward market trends.
Average Body Size & Candle Count:
For each year, the indicator calculates the average body size of green and red candles and tracks the total number of each, helping you understand overall market volatility and momentum.
Top 10 Candle Analysis:
It identifies the ten largest candles (by body size) in each year and computes their average size, offering insight into the most significant market moves during that period.
Largest Candle Metrics:
The indicator determines the absolute size of the largest green and red candles in each year.
Percentage Move Calculation:
In addition to absolute values, it computes the largest move as a percentage of the open price for both green and red candles. This allows you to see not only which year experienced the biggest moves but also how those moves compare relative to the opening price.
Clear Tabular Display:
All the computed statistics are organized in an on-chart table, making it easy to compare yearly trends at a glance.
Ideal for daily and higher timeframes, this indicator is a valuable tool for long-term market analysis, enabling you to identify trends, assess volatility, and make informed trading decisions based on historical market behavior.