Simple Moving Average Double HelixThis one is a mix of colour-coded moving averages and Ichimoku. It features two pairs of SMAs--default values of 9/20 and 50/200. Each SMA will be green when it rises and red when it falls. The spaces between each pair will fill with green or red depending on which line is on top. 9 over 20 or 50 over 200 makes a green cloud; if 9 or 50 falls below, the cloud will switch to green.
There's also the Ichimoku lagging span and a 35-period SMA (grey) that can be used as a trailing stop loss guideline.
Ideal long setup:
9, 20, 50, and 200 SMA are all green
both clouds are green
lagging span is above historic price action
Ideal short setup:
9, 20, 50, and 200 SMA are all red
both clouds are red
lagging span is below historic price action
Wyszukaj w skryptach "黄金近50年的走势"
RSI5_50 with DivergenceThis is variation of RSI Divergence strategy.
I have added a filter (long term RSI) to the Rules. strategy BUYs when RSI 50 period is above 50 line and there is divergence on the short term RSI
settings
=========
short term RSI period 5
long term RSI period 50
stopLoss is 8% --- if setting is enabled
BUY Rule
========
RSI 50 is above 50 line
short term RSI is showing divergence
Add to existing
==============
if already in position, BUY when shorTermRSI is crossing above 20
TakeProfit
=========
when longTermRSI reaches 60,65, 70 and 75 level , take partial profits .
(not when crossing down --- This may affect on profits , because when price goes down , it goes very fast )
Exit
=====
when longTermRSI is crossing down 30
OR stopLoss value hits
Note: When I tested this with GOOGL stock , I have got excellent results ... any experts there , please check everything is good with scripting ...
Happy Trading
PowerX Strategy Bar Coloring [OFFICIAL VERSION]This script colors the bars according to the PowerX Strategy by Markus Heitkoetter:
The PowerX Strategy uses 3 indicators:
- RSI (7)
- Stochastics (14, 3, 3)
- MACD (12, 26 , 9)
The bars are colored GREEN if...
1.) The RSI (7) is above 50 AND
2.) The Stochastic (14, 3, 3) is above 50 AND
3.) The MACD (12, 26, 9) is above its Moving Average, i.e. MACD Histogram is positive.
The bars are colored RED if...
1.) The RSI (7) is below 50 AND
2.) The Stochastic (14, 3, 3) is below 50 AND
3.) The MACD (12, 26, 9) is below its Moving Average, i.e. MACD Histogram is negative.
If only 2 of these 3 conditions are met, then the bars are black (default color)
We highly recommend plotting the indicators mentioned above on your chart, too, so that you can see when bars are getting close to being "RED" or "GREEN", e.g. RSI is getting close to the 50 line.
BO - Bar's direction Signal - BacktestingBO - Bar's direction Signal - Backtesting Options:
A. Factors Calculate probability of x bars same direction
1. Periods Counting: Data to count From day/month/year To day/month/year
2. Trading Time: only cases occurred in trading time were counted.
B. Timezone
1. Trading time depend on Time zone and specified chart.
2. Enable Highlight Trading Time to check your period time is correct
C. Date Backtesting
* Only cases occurred in Date Backtesting were reported.
D. Setup Options & Rule
1. Reversal after 2 bars same direction
* Probability of 3 bars same direction < 50
* 2 bars same direction is start of series
2. Reversal after 3 bars same direction
* Probability of 4 bars same direction < 50
* 3 bars same direction is start of series
3. Reversal after 4 bars same direction
* Probability of 4 bars same direction < 50
* 3 bars same direction is start of series
4. Reversal after 5 bars same direction
* Probability of 5 bars same direction < 50
* 4 bars same direction is start of series
5. Reversal after 6 bars same direction
* Probability of 6 bars same direction < 50
* 5 bars same direction is start of series
Technical Analysis - Panel Info//A. Oscillators & B. Moving Averages base on TradingView's Technical Analysis by ThiagoSchmitz
//C.Pivot base on Ultimate Pivot Points Alerts by elbartt
//D. Summary & Panel info by anhnguyen14
Panel Info base on these indicators:
A. Oscillators
1. Rsi (14)
2. Stochastic (14,3,3)
3. CCI (20)
4. ADX (14)
5. AO
6. Momentum (10)
7. MACD (12,26)
8. Stoch RSI (3,3,14,14)
9. %R (14)
10. Bull bear
11. UO (7,14,28)
B. Moving Averages
1. SMA & EMA: 5-10-20-30-50-100-200
2. Ichimoku Cloud - Baseline (26)
3. Hull MA (9)
C. Pivot
1. Traditional
2. Fibonacci
3. Woodie
4. Camarilla
D. Summary
Sum_red=A_red+B_red+C_red
Sum_blue=A_blue+B_blue+C_blue
sell_point=(Sum_red/32)*100
buy_point=(Sum_blue/32)*100
sell =
Sum_red>Sum_blue
and sell_point>50
Strong_sell =
A_red>A_blue
and B_red>B_blue
and C_red>C_blue
and sell_point>50
and not crossunder(sell_point,75)
buy =
Sum_red>Sum_blue
and buy_point>50
Strong_buy =
A_red50
and not crossunder(buy_point,75)
neutral = not sell and not Strong_sell and not buy and not Strong_buy
Multi SMA EMA WMA HMA BB (5x8 MAs Bollinger Bands) MAX MTF - RRBMulti SMA EMA WMA HMA 4x7 Moving Averages with Bollinger Bands MAX MTF by RagingRocketBull 2019
Version 1.0
All available MAX MTF versions are listed below (They are very similar and I don't want to publish them as separate indicators):
ver 1.0: 4x7 = 28 MTF MAs + 28 Levels + 3 BB = 59 < 64
ver 2.0: 5x6 = 30 MTF MAs + 30 Levels + 3 BB = 63 < 64
ver 3.0: 3x10 = 30 MTF MAs + 30 Levels + 3 BB = 63 < 64
ver 4.0: 5(4+1)x8 = 8 CurTF MAs + 32 MTF MAs + 20 Levels + 3 BB = 63 < 64
ver 5.0: 6(5+1)x6 = 6 CurTF MAs + 30 MTF MAs + 24 Levels + 3 BB = 63 < 64
ver 6.0: 4(3+1)x10 = 10 CurTF MAs + 30 MTF MAs + 20 Levels + 3 BB = 63 < 64
Fib numbers: 8, 13, 21, 34, 55, 89, 144, 233, 377
This indicator shows multiple MAs of any type SMA EMA WMA HMA etc with BB and MTF support, can show MAs as dynamically moving levels.
There are 4 MA groups + 1 BB group, a total of 4 TFs * 7 MAs = 28 MAs. You can assign any type/timeframe combo to a group, for example:
- EMAs 9,12,26,50,100,200,400 x H1, H4, D1, W1 (4 TFs x 7 MAs x 1 type)
- EMAs 8,13,21,30,34,50,55,89,100,144,200,233,377,400 x M15, H1 (2 TFs x 14 MAs x 1 type)
- D1 EMAs and SMAs 8,13,21,30,34,50,55,89,100,144,200,233,377,400 (1 TF x 14 MAs x 2 types)
- H1 WMAs 13,21,34,55,89,144,233; H4 HMAs 9,12,26,50,100,200,400; D1 EMAs 12,26,89,144,169,233,377; W1 SMAs 9,12,26,50,100,200,400 (4 TFs x 7 MAs x 4 types)
- +1 extra MA type/timeframe for BB
There are several versions: Simple, MTF, Pro MTF, Advanced MTF, MAX MTF and Ultimate MTF. This is the MAX MTF version. The Differences are listed below. All versions have BB
- Simple: you have 2 groups of MAs that can be assigned any type (5+5)
- MTF: +2 custom Timeframes for each group (2x5 MTF) +1 TF for BB, TF XY smoothing
- Pro MTF: 4 custom Timeframes for each group (4x3 MTF), 1 TF for BB, MA levels and show max bars back options
- Advanced MTF: +4 extra MAs/group (4x7 MTF), custom Ticker/Symbols, Timeframe <>= filter, Remove Duplicates Option
- MAX MTF: +2 subtypes/group, packed to the limit with max possible MAs/TFs: 4x7, 5x6, 3x10, 4(3+1)x10, 5(4+1)x8, 6(5+1)x6
- Ultimate MTF: +individual settings for each MA, custom Ticker/Symbols
MAX MTF version tests the limits of Pinescript trying to squeeze as many MAs/TFs as possible into a single indicator.
It's basically a maxed out Advanced version with subtypes allowing for mixed types within a group (i.e. both emas and smas in a single group/TF)
Pinescript has the following limits:
- max 40 security calls (6 calls are reserved for dupe checks and smoothing, 2 are used for BB, so only 32 calls are available)
- max 64 plot outputs (BB uses 3 outputs, so only 61 plot outputs are available)
- max 50000 (50kb) size of the compiled code
Based on those limits, you can only have the following MAs/TFs combos in a single script:
1. 4x7, 5x6, 3x10 - total number of MTF MAs must always be <= 32, and you can still have BB and Num Levels = total MAs, without any compromises
2. 5(4+1)x8, 6(5+1)x6, 4(3+1)x10 - you can use the Current Symbol/Timeframe as an extra (+1) fixed TF with the same number of MTF MAs
- you don't need to call security to display MAs on the Current Symbol/Timeframe, so the total number of MTF MAs remains the same and is still <= 32
- to fit that many MAs into the max 64 plot outputs limit you need to reduce the number of levels (not every MA Group will have corresponding levels)
Features:
- 4x7 = 28 MAs of any type
- 4x MTF groups with XY step line smoothing
- +1 extra TF/type for BB MAs
- 2 MA subtypes within each group/TF
- 4x7 = 28 MA levels with adjustable group offsets, indents and shift
- supports any existing type of MA: SMA, EMA, WMA, Hull Moving Average (HMA)
- custom tickers/symbols for each group
- show max bars back option
- show/hide both groups of MAs/levels/BB and individual MAs
- timeframe filter: show only MAs/Levels with TFs <>= Current TF
- hide MAs/Levels with duplicate TFs
- support for custom TFs that are not available in free accounts: 2D, 3D etc
- support for timeframes in H: H, 2H, 4H etc
Notes:
- Uses timeframe textbox instead of input resolution dropdown to allow for 240 120 and other custom TFs
- Uses symbol textbox instead of input symbol to avoid establishing multiple dummy security connections to the current ticker - otherwise empty symbols will prevent script from running
- Possible reasons for missing MAs on a chart:
- there may not be enough bars in history to start plotting it. For example, W1 EMA200 needs at least 200 bars on a weekly chart.
- for charts with low/fractional prices i.e. 0.00002 << 0.001 (default Y smoothing step) decrease Y smoothing as needed (set Y = 0.0000001) or disable it completely (set X,Y to 0,0)
- for charts with high price values i.e. 20000 >> 0.001 increase Y smoothing as needed (set Y = 10-20). Higher values exceeding MAs point density will cause it to disappear as there will be no points to plot. Different TFs may require diff adjustments
- TradingView Replay Mode UI and Pinescript security calls are limited to TFs >= D (D,2D,W,MN...) for free accounts
- attempting to plot any TF < D1 in Replay Mode will only result in straight lines, but all TFs will work properly in history and real-time modes. This is not a bug.
- Max Bars Back (num_bars) is limited to 5000 for free accounts (10000 for paid), will show error when exceeded. To plot on all available history set to 0 (default)
- Slow load/redraw times. This indicator becomes slower, its UI less responsive when:
- Pinescript Node.js graphics library is too slow and inefficient at plotting bars/objects in a browser window. Code optimization doesn't help much - the graphics engine is the main reason for general slowness.
- the chart has a long history (10000+ bars) in a browser's cache (you have scrolled back a couple of screens in a max zoom mode).
- Reload the page/Load a fresh chart and then apply the indicator or
- Switch to another Timeframe (old TF history will still remain in cache and that TF will be slow)
- in max possible zoom mode around 4500 bars can fit on 1 screen - this also slows down responsiveness. Reset Zoom level
- initial load and redraw times after a param change in UI also depend on TF. For example: D1/W1 - 2 sec, H1/H4 - 5-6 sec, M30 - 10 sec, M15/M5 - 4 sec, M1 - 5 sec. M30 usually has the longest history (up to 16000 bars) and W1 - the shortest (1000 bars).
- when indicator uses more MAs (plots) and timeframes it will redraw slower. Seems that up to 5 Timeframes is acceptable, but 6+ Timeframes can become very slow.
- show_last=last_bars plot limit doesn't affect load/redraw times, so it was removed from MA plot
- Max Bars Back (num_bars) default/custom set UI value doesn't seem to affect load/redraw times
- In max zoom mode all dynamic levels disappear (they behave like text)
- Dupe check includes symbol: symbol, tf, both subtypes - all must match for a duplicate group
- For the dupe check to work correctly a custom symbol must always include an exchange prefix. BB is not checked for dupes
Good Luck! Feel free to learn from/reuse the code to build your own indicators.
Multi SMA EMA WMA HMA BB (4x5 MAs Bollinger Bands) Adv MTF - RRBMulti SMA EMA WMA HMA 4x5 Moving Averages with Bollinger Bands Advanced MTF by RagingRocketBull 2019
Version 1.0
This indicator shows multiple MAs of any type SMA EMA WMA HMA etc with BB and MTF support, can show MAs as dynamically moving levels.
There are 4 MA groups + 1 BB group, a total of 4 TFs * 5 MAs = 20 MAs. You can assign any type/timeframe combo to a group, for example:
- EMAs 12,26,50,100,200 x H1, H4, D1, W1 (4 TFs x 5 MAs x 1 type)
- EMAs 8,10,13,21,30,50,55,100,200,400 x M15, H1 (2 TFs x 10 MAs x 1 type)
- D1 EMAs and SMAs 8,10,12,26,30,50,55,100,200,400 (1 TF x 10 MAs x 2 types)
- H1 WMAs 7,77,89,167,231; H4 HMAs 12,26,50,100,200; D1 EMAs 89,144,169,233,377; W1 SMAs 12,26,50,100,200 (4 TFs x 5 MAs x 4 types)
- +1 extra MA type/timeframe for BB
There are several versions: Simple, MTF, Pro MTF, Advanced MTF and Ultimate MTF. This is the Advanced MTF version. The Differences are listed below. All versions have BB
- Simple: you have 2 groups of MAs that can be assigned any type (5+5)
- MTF: +2 custom Timeframes for each group (2x5 MTF) +1 TF for BB, TF XY smoothing
- Pro MTF: 4 custom Timeframes for each group (4x3 MTF), 1 TF for BB, MA levels and show max bars back options
- Advanced MTF: +2 extra MAs/group (4x5 MTF), custom Ticker/Symbols, Timeframe <>= filter, Remove Duplicates Option
- Ultimate MTF: +individual settings for each MA, custom Ticker/Symbols
Features:
- 4x5 = 20 MAs of any type
- 4x MTF groups with XY step line smoothing
- +1 extra TF/type for BB MAs
- 4x5 = 20 MA levels with adjustable group offsets, indents and shift
- supports any existing type of MA: SMA, EMA, WMA, Hull Moving Average (HMA)
- custom tickers/symbols for each group - you can compare MAs of the same symbol across exchanges
- show max bars back option
- show/hide both groups of MAs/levels/BB and individual MAs
- timeframe filter: show only MAs/Levels with TFs <>= Current TF
- hide MAs/Levels with duplicate TFs
- support for custom TFs that are not available in free accounts: 2D, 3D etc
- support for timeframes in H: H, 2H, 4H etc
Notes:
- Uses timeframe textbox instead of input resolution dropdown to allow for 240 120 and other custom TFs
- Uses symbol textbox instead of input symbol to avoid establishing multiple dummy security connections to the current ticker - otherwise empty symbols will prevent script from running
- Possible reasons for missing MAs on a chart:
- there may not be enough bars in history to start plotting it. For example, W1 EMA200 needs at least 200 bars on a weekly chart.
- price << default Y smoothing step 5. For charts with low/fractional prices (i.e. 0.00002 << 5) adjust X Y smoothing as needed (set Y = 0.0000001) or disable it completely (set X,Y to 0,0)
- TradingView Replay Mode UI and Pinescript security calls are limited to TFs >= D (D,2D,W,MN...) for free accounts
- attempting to plot any TF < D1 in Replay Mode will only result in straight lines, but all TFs will work properly in history and real-time modes. This is not a bug.
- Max Bars Back (num_bars) is limited to 5000 for free accounts (10000 for paid), will show error when exceeded. To plot on all available history set to 0 (default)
- Slow load/redraw times. This indicator becomes slower, its UI less responsive when:
- Pinescript Node.js graphics library is too slow and inefficient at plotting bars/objects in a browser window. Code optimization doesn't help much - the graphics engine is the main reason for general slowness.
- the chart has a long history (10000+ bars) in a browser's cache (you have scrolled back a couple of screens in a max zoom mode).
- Reload the page/Load a fresh chart and then apply the indicator or
- Switch to another Timeframe (old TF history will still remain in cache and that TF will be slow)
- in max possible zoom mode around 4500 bars can fit on 1 screen - this also slows down responsiveness. Reset Zoom level
- initial load and redraw times after a param change in UI also depend on TF. For example:
D1/W1 - 2 sec, H1/H4 - 5-6 sec, M30 - 10 sec, M15/M5 - 4 sec, M1 - 5 sec.
M30 usually has the longest history (up to 16000 bars) and W1 - the shortest (1000 bars).
- when indicator uses more MAs (plots) and timeframes it will redraw slower. Seems that up to 5 Timeframes is acceptable, but 6+ Timeframes can become very slow.
- show_last=last_bars plot limit doesn't affect load/redraw times, so it was removed from MA plot
- Max Bars Back (num_bars) default/custom set UI value doesn't seem to affect load/redraw times
- In max zoom mode all dynamic levels disappear (they behave like text)
1. based on 3EmaBB, uses plot*, barssince and security functions
2. you can't set certain constants from input due to Pinescript limitations - change the code as needed, recompile and use as a private version
3. Levels = trackprice implementation
4. Show Max Bars Back = show_last implementation
5. swma has a fixed length = 4, alma and linreg have additional offset and smoothing params
6. Smoothing is applied by default for visual aesthetics on MTF. To use exact ma mtf values (lines with stair stepping) - disable it
Good Luck! You can explore, modify/reuse the code to build your own indicators.
BB Quick Fire5 Bollinger Bands in levels 50,2.0 | 50,2.5 |50,3.0 |50,3.5 |50,4.0
This is used to identify pullbakcs and future pitchfork's.
CM Stochastic POP Method 2-Jake Bernstein_V1Yesterday Jake Bernstein authorized me to post his updated results with the Stochastic Pop Trading System he developed many years ago.
You can take a look at the Original System with Updated Settings at
This indicator is a different set of rules Jake mentioned in the PDF he allowed me to post.
To view the PDF use this link:
dl.dropboxusercontent.com
Today we’re releasing the version described in the PDF that uses the StochK values of 55, 50, and 45. The rules are discussed in the PDF but here is a simple breakdown:
Enter Long when StochK is below 50 and Crosses Above 55
Exit Long on Cross Below 55
Enter Short when StochK is Above 50 and crosses Below 45
Exit Short on Cross Above 45
Two Important Items to understand about this method:
To code the rules Precisely we need a function that will be available when Strategy Capabilities are released on TradingView.
There is one of Jakes Profit Maximizing Strategies that needs to be integrated with this code…which again we need the Strategy based Function that will be coming soon.
To Compare this system to the Stochastic Pop Method 1 System shown yesterday at I used the same Symbol and dates for you to compare…but remember to give this Method 2 System a Fair Look/Evaluation…we need the Soon To Be Released…TradingView Strategy Capabilities.
BackTesting Results Example: EUR-USD Daily Chart Since 01/01/2005
Strategy 1 – Stochastic Pop Method 2 System:
Go Long When Stochasticis below 50 and Crosses Above 55. Go Short When Stochastic is above 50 and Crosses Below 45. Exit Long/Short When Stochastic has a Reverse Cross of Entry Value.
Results:
Total Trades = 151
Profit = 40,758 Pips
Win% = 37.1%
Profit Factor = 1.26
Avg Trade = 270 Pips Profit
***Most Consecutive Wins = 4 ... Most Consecutive Losses = 7
Strategy 2:
Rules - Proprietary Optimization Jake Will Teach. Only Added 1 Additional Exit Rule.
Results:
Total Trades = 151
Profit = 60.305 Pips
Win% = 37.1%
Profit Factor = 1.38
Avg Trade = 399 Pips Profit
***Most Consecutive Wins = 4 ... Most Consecutive Losses = 7
Indicator Includes:
-Ability to Color Candles (CheckBox In Inputs Tab)
Green = Long Trade
Blue = No Trade
Red = Short Trade
Jake Bernstein will be a contributor on TradingView when Backtesting/Strategies are released. Jake is one of the Top Trading System Developers in the world with 45+ years experience and he is going to teach TradingView.com’s community how to create Trading Systems and how to Optimize the correct way.
Link To PDF:
dl.dropboxusercontent.com
Link to Original Version of Indicator with Updated Settings.
Algoticks.in: Supertrend Strategy (Directional option sample)Supertrend Strategy - User Guide
Overview
This is a trend-following strategy based on the Supertrend indicator. It generates signals when the trend direction changes (Green to Red or Red to Green). It is fully integrated with Algoticks.in API for automated trading on Delta Exchange, with specialized logic for Options trading.
Strategy Logic
Long Signal: When Supertrend flips to Green (Bullish Trend Start)
Short Signal: When Supertrend flips to Red (Bearish Trend Start)
Automatically closes opposite positions before entering new ones
Quick Setup
1. Add to TradingView
Open TradingView and go to the chart
Click "Pine Editor" at the bottom
Paste the script code
Click "Add to Chart"
2. Configure Strategy Parameters
Strategy Settings
ATR Length (default: 10): The lookback period for Average True Range
Factor (default: 3.0): The multiplier for the ATR bands. Higher values = fewer signals (less noise), Lower values = more signals (scalping).
General API Settings
Paper Trading : Enable for testing without real money
Signal Type : Choose "Trading Signal" (default) for tracking
Exchange : DELTA (Delta Exchange)
Segment :
futures - Perpetual contracts
options - Call/Put options
spot - Spot trading
Order Settings: Basic
Quantity : Number of contracts (e.g., 1, 0.5, 2)
Validity :
GTC - Good Till Cancelled
IOC - Immediate or Cancel
FOK - Fill or Kill
DAY - Day order
Product : cross_margin or isolated_margin
Order Settings: Entry Type
Choose how orders are executed:
Market Order : Immediate fill at best price
Limit Order : Fill at specified price or better
Stop Market : Triggers at stop price, then market order
Stop Limit : Triggers at stop price, then limit order
Entry Prices (for Limit/Stop orders)
Limit Price:
Price : The value to use
Type : Last Price / Mark Price / Index Price
Mode :
Absolute - Exact price (e.g., 65000)
Relative - Offset from entry price
% Checkbox : If checked, relative uses percentage; if unchecked, uses points
Example:
Absolute: 65000 → Order at exactly 65000
Relative 1% (checked): Entry ± 1% of entry price
Relative 100 (unchecked): Entry ± 100 points
Trigger Price: Same logic as Limit Price, used for Stop orders
Exit / Bracket Prices (SL/TP)
Stop Loss (SL):
Type : Price type to monitor (Mark Price recommended)
Mode : Absolute or Relative
% : Percentage or points
SL : Stop loss value (e.g., 2 for 2%)
Trig : Optional trigger price (creates Stop-Limit SL)
Take Profit (TP): Same structure as SL
Example:
Long entry at 65000, SL = 2% → Exit at 63700 (65000 - 2%)
Short entry at 65000, TP = 3% → Exit at 63050 (65000 - 3%)
3. Options Trading Setup (CRITICAL)
This strategy has special logic for Options trading to handle directional bias correctly.
Scenario A: Options Buying (Long Volatility)
You want to BUY Calls when the trend is Up, and BUY Puts when the trend is Down.
Segment : options
Strike Selection : Dynamic
Algo Type : Options Buying Algo
What happens:
Long Signal (Green Supertrend) → System sends BUY action. Backend buys a Call (CE) .
Short Signal (Red Supertrend) → System sends BUY action. Backend buys a Put (PE) .
Scenario B: Options Selling (Short Volatility)
You want to SELL Puts when the trend is Up (Bullish), and SELL Calls when the trend is Down (Bearish).
Segment : options
Strike Selection : Dynamic
Algo Type : Options Selling Algo
What happens:
Long Signal (Green Supertrend) → System sends SELL action. Backend sells a Put (PE) .
Short Signal (Red Supertrend) → System sends SELL action. Backend sells a Call (CE) .
Dynamic Strike Settings:
Strike Offset : 0 (ATM), +1 (OTM for Calls/ITM for Puts), -1 (ITM for Calls/OTM for Puts)
Strike Interval : Gap between strikes (e.g., BTC: 500, ETH: 50)
Expiry Date Formats:
T+0 - Today
T+1 - Tomorrow
current week - This Friday
next week - Next Friday
current month - Last Friday of month
131125 - Specific date (13 Nov 2025)
4. Create Alert for Automation
Right-click on chart → "Add Alert"
Condition : Select your strategy name
Alert Actions : Webhook URL
Webhook URL : Your Algoticks.in API endpoint
Message : Leave as {{strategy.order.alert_message}} (contains JSON)
Click "Create"
The alert will automatically send JSON payloads to your API when signals occur.
Example Configurations
Futures Trend Following
Strategy: ATR=10, Factor=3.0
Segment: futures
Order Type: market_order
Quantity: 1
SL: 2% (Relative)
TP: 6% (Relative)
Options Buying (Directional)
Segment: options
Strike Selection: Dynamic
Algo Type: Options Buying Algo
Strike Offset: 0 (ATM)
Strike Interval: 500 (for BTC)
Expiry: current week
Order Type: market_order
Important Notes
Paper Trading First : Always test with paper trading enabled before live trading
Order Tags : Automatically generated for tracking (max 18 chars)
Position Management : Strategy closes opposite positions automatically
Signal Confirmation : Uses barstate.isconfirmed to prevent repainting
JSON Payload : All settings are converted to JSON and sent via webhook
Troubleshooting
No signals : Check if Supertrend is flipping on your timeframe
Orders not executing : Verify webhook URL and API credentials
Wrong strikes : Double-check Strike Interval for your asset
SL/TP not working : Ensure values are non-zero and mode is correct
Support
For API setup and connector configuration, see visit Algoticks.in documentation.
CRT + SMC MY//@version=5
indicator("CRT + SMC MultiTF (Fixed Requests)", overlay=true, max_labels_count=500, max_boxes_count=200)
// ---------------- INPUTS ----------------
htfTF = input.string("60", title="HTF timeframe (60=1H, 240=4H)")
midTF = input.string("5", title="Mid timeframe (5 or 15)")
execTF = input.string("1", title="Exec timeframe (1 for sniper)")
useMAfilter = input.bool(true, "Require HTF MA filter")
htf_ma_len = input.int(50, "HTF MA length")
showOB = input.bool(true, "Show Order Blocks (midTF)")
showFVG = input.bool(true, "Show Fair Value Gaps (execTF)")
showEntries = input.bool(true, "Show Entry arrows & SL/TP")
slBuffer = input.int(3, "SL buffer (ticks)")
rrTarget = input.float(4.0, "Default R:R target")
useKillzone = input.bool(false, "Use London/NY Killzone (approx NY-5 timezone)")
// ---------------- REQUESTS (ALL at top-level) ----------------
// HTF series
htf_open = request.security(syminfo.tickerid, htfTF, open)
htf_high = request.security(syminfo.tickerid, htfTF, high)
htf_low = request.security(syminfo.tickerid, htfTF, low)
htf_close = request.security(syminfo.tickerid, htfTF, close)
htf_ma = request.security(syminfo.tickerid, htfTF, ta.sma(close, htf_ma_len))
htf_prev_high = request.security(syminfo.tickerid, htfTF, high )
htf_prev_low = request.security(syminfo.tickerid, htfTF, low )
// midTF series for OB detection
mid_open = request.security(syminfo.tickerid, midTF, open)
mid_high = request.security(syminfo.tickerid, midTF, high)
mid_low = request.security(syminfo.tickerid, midTF, low)
mid_close = request.security(syminfo.tickerid, midTF, close)
mid_median_body = request.security(syminfo.tickerid, midTF, ta.median(math.abs(close - open), 8))
// execTF series for FVG and micro structure
exec_high = request.security(syminfo.tickerid, execTF, high)
exec_low = request.security(syminfo.tickerid, execTF, low)
exec_open = request.security(syminfo.tickerid, execTF, open)
exec_close = request.security(syminfo.tickerid, execTF, close)
// Also get shifted values needed for heuristics (all top-level)
exec_high_1 = request.security(syminfo.tickerid, execTF, high )
exec_high_2 = request.security(syminfo.tickerid, execTF, high )
exec_low_1 = request.security(syminfo.tickerid, execTF, low )
exec_low_2 = request.security(syminfo.tickerid, execTF, low )
mid_low_1 = request.security(syminfo.tickerid, midTF, low )
mid_high_1 = request.security(syminfo.tickerid, midTF, high )
// ---------------- HTF logic ----------------
htf_ma_bias_long = htf_close > htf_ma
htf_ma_bias_short = htf_close < htf_ma
htf_sweep_high = (htf_high > htf_prev_high) and (htf_close < htf_prev_high)
htf_sweep_low = (htf_low < htf_prev_low) and (htf_close > htf_prev_low)
htf_final_long = htf_sweep_low and (not useMAfilter or htf_ma_bias_long)
htf_final_short = htf_sweep_high and (not useMAfilter or htf_ma_bias_short)
// HTF label (single label updated)
var label htf_label = na
if barstate.islast
label.delete(htf_label)
if htf_final_long
htf_label := label.new(bar_index, high, "HTF BIAS: LONG", style=label.style_label_left, color=color.green, textcolor=color.white)
else if htf_final_short
htf_label := label.new(bar_index, low, "HTF BIAS: SHORT", style=label.style_label_left, color=color.red, textcolor=color.white)
// ---------------- midTF OB detection (heuristic) ----------------
mid_body = math.abs(mid_close - mid_open)
is_bear_mid = (mid_open > mid_close) and (mid_body >= mid_median_body)
is_bull_mid = (mid_open < mid_close) and (mid_body >= mid_median_body)
mid_bear_disp = is_bear_mid and (mid_low < mid_low_1)
mid_bull_disp = is_bull_mid and (mid_high > mid_high_1)
// Store last OB values (safe top-level assignments)
var float last_bear_ob_top = na
var float last_bear_ob_bot = na
var int last_bear_ob_time = na
var float last_bull_ob_top = na
var float last_bull_ob_bot = na
var int last_bull_ob_time = na
if mid_bear_disp
last_bear_ob_top := mid_open
last_bear_ob_bot := mid_close
last_bear_ob_time := timenow
if mid_bull_disp
last_bull_ob_top := mid_close
last_bull_ob_bot := mid_open
last_bull_ob_time := timenow
// Draw OB boxes (draw always but can be toggled)
if showOB
if not na(last_bear_ob_top)
box.new(bar_index - 1, last_bear_ob_top, bar_index + 1, last_bear_ob_bot, border_color=color.new(color.red,0), bgcolor=color.new(color.red,85))
if not na(last_bull_ob_top)
box.new(bar_index - 1, last_bull_ob_top, bar_index + 1, last_bull_ob_bot, border_color=color.new(color.green,0), bgcolor=color.new(color.green,85))
// ---------------- execTF FVG detection (top-level logic) ----------------
// simple 3-candle gap heuristic
bull_fvg_local = exec_low_2 > exec_high_1
bear_fvg_local = exec_high_2 < exec_low_1
// Compute FVG box coords at top-level
fvg_bull_top = exec_high_1
fvg_bull_bot = exec_low_2
fvg_bear_top = exec_high_2
fvg_bear_bot = exec_low_1
if showFVG
if bull_fvg_local
box.new(bar_index - 2, fvg_bull_top, bar_index, fvg_bull_bot, border_color=color.new(color.green,0), bgcolor=color.new(color.green,85))
if bear_fvg_local
box.new(bar_index - 2, fvg_bear_top, bar_index, fvg_bear_bot, border_color=color.new(color.red,0), bgcolor=color.new(color.red,85))
// ---------------- micro structure on execTF ----------------
micro_high = exec_high
micro_low = exec_low
micro_high_1 = exec_high_1
micro_low_1 = exec_low_1
micro_bos_long = micro_high > micro_high_1
micro_bos_short = micro_low < micro_low_1
// ---------------- killzone check (top-level) ----------------
kill_ok = true
if useKillzone
hh = hour(time('GMT-5'))
mm = minute(time('GMT-5'))
// London approx
inLondon = (hh > 2 or (hh == 2 and mm >= 45)) and (hh < 5 or (hh == 5 and mm <= 0))
inNY = (hh > 8 or (hh == 8 and mm >= 20)) and (hh < 11 or (hh == 11 and mm <= 30))
kill_ok := inLondon or inNY
// ---------------- Entry logic (top-level boolean decisions) ----------------
hasBullOB = not na(last_bull_ob_top)
hasBearOB = not na(last_bear_ob_top)
entryLong = htf_final_long and hasBullOB and micro_bos_long and bull_fvg_local and kill_ok
entryShort = htf_final_short and hasBearOB and micro_bos_short and bear_fvg_local and kill_ok
// ---------------- SL / TP suggestions and plotting ----------------
var label lastEntryLabel = na
if entryLong or entryShort
entryPrice = close
suggestedSL = entryLong ? (htf_low - slBuffer * syminfo.mintick) : (htf_high + slBuffer * syminfo.mintick)
slDist = math.abs(entryPrice - suggestedSL)
suggestedTP = entryLong ? (entryPrice + slDist * rrTarget) : (entryPrice - slDist * rrTarget)
if showEntries
label.delete(lastEntryLabel)
lastEntryLabel := label.new(bar_index, entryPrice, entryLong ? "ENTRY LONG" : "ENTRY SHORT", style=label.style_label_center, color=entryLong ? color.green : color.red, textcolor=color.white)
line.new(bar_index, suggestedSL, bar_index + 20, suggestedSL, color=color.orange, style=line.style_dashed)
line.new(bar_index, suggestedTP, bar_index + 40, suggestedTP, color=color.aqua, style=line.style_dashed)
plotshape(entryLong, title="Entry Long", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(entryShort, title="Entry Short", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
alertcondition(entryLong, title="CRT SMC Entry Long", message="Entry Long — HTF bias + midTF OB + execTF confirmation")
alertcondition(entryShort, title="CRT SMC Entry Short", message="Entry Short — HTF bias + midTF OB + execTF confirmation")
Algoticks.in: RSI StrategyRSI Strategy - User Guide
Overview
This is a Relative Strength Index (RSI) strategy that generates trading signals based on overbought and oversold levels. It integrates with Algoticks.in API for automated trading on Delta Exchange.
Strategy Logic
Long Signal: When RSI crosses above the Oversold level (Mean Reversion / Dip Buy)
Short Signal: When RSI crosses below the Overbought level (Mean Reversion / Top Sell)
Automatically closes opposite positions before entering new ones
Quick Setup
1. Add to TradingView
Open TradingView and go to the chart
Click "Pine Editor" at the bottom
Paste the script code
Click "Add to Chart"
2. Configure Strategy Parameters
Strategy Settings
RSI Length (default: 14): The lookback period for RSI calculation
Overbought Level (default: 70): Level above which the asset is considered overbought
Oversold Level (default: 30): Level below which the asset is considered oversold
General API Settings
Paper Trading : Enable for testing without real money
Signal Type : Choose "Trading Signal" (default) for tracking
Exchange : DELTA (Delta Exchange)
Segment :
futures - Perpetual contracts
options - Call/Put options
spot - Spot trading
Order Settings: Basic
Quantity : Number of contracts (e.g., 1, 0.5, 2)
Validity :
GTC - Good Till Cancelled
IOC - Immediate or Cancel
FOK - Fill or Kill
DAY - Day order
Product : cross_margin or isolated_margin
Order Settings: Entry Type
Choose how orders are executed:
Market Order : Immediate fill at best price
Limit Order : Fill at specified price or better
Stop Market : Triggers at stop price, then market order
Stop Limit : Triggers at stop price, then limit order
Entry Prices (for Limit/Stop orders)
Limit Price:
Price : The value to use
Type : Last Price / Mark Price / Index Price
Mode :
Absolute - Exact price (e.g., 65000)
Relative - Offset from entry price
% Checkbox : If checked, relative uses percentage; if unchecked, uses points
Example:
Absolute: 65000 → Order at exactly 65000
Relative 1% (checked): Entry ± 1% of entry price
Relative 100 (unchecked): Entry ± 100 points
Trigger Price: Same logic as Limit Price, used for Stop orders
Exit / Bracket Prices (SL/TP)
Stop Loss (SL):
Type : Price type to monitor (Mark Price recommended)
Mode : Absolute or Relative
% : Percentage or points
SL : Stop loss value (e.g., 2 for 2%)
Trig : Optional trigger price (creates Stop-Limit SL)
Take Profit (TP): Same structure as SL
Example:
Long entry at 65000, SL = 2% → Exit at 63700 (65000 - 2%)
Short entry at 65000, TP = 3% → Exit at 63050 (65000 - 3%)
3. Options Trading Setup (Only if Segment = Options)
Strike Selection Method
User Defined Mode:
Manually specify exact strike and option type
Best for: Trading specific levels
Required fields:
Strike Price : e.g., "65000"
Option Type : Call or Put
Dynamic Mode:
System calculates strike based on ATM price
Best for: Automated strategies
Required fields:
Algo Type : Options Buying or Selling
Strike Offset : 0 (ATM), +1 (above ATM), -1 (below ATM)
Strike Interval : Gap between strikes (e.g., BTC: 500, ETH: 50)
Expiry Date Formats:
T+0 - Today
T+1 - Tomorrow
current week - This Friday
next week - Next Friday
current month - Last Friday of month
131125 - Specific date (13 Nov 2025)
4. Create Alert for Automation
Right-click on chart → "Add Alert"
Condition : Select your strategy name
Alert Actions : Webhook URL
Webhook URL : Your Algoticks.in API endpoint
Message : Leave as {{strategy.order.alert_message}} (contains JSON)
Click "Create"
The alert will automatically send JSON payloads to your API when signals occur.
Example Configurations
Standard RSI Reversal
Strategy: RSI Length = 14, OB = 70, OS = 30
Segment: futures
Order Type: market_order
Quantity: 1
SL: 1.5% (Relative)
TP: 3% (Relative)
Aggressive Scalping
Strategy: RSI Length = 7, OB = 80, OS = 20
Segment: futures
Order Type: market_order
Quantity: 0.5
SL: 0.5% (Relative)
TP: 1% (Relative)
Important Notes
Paper Trading First : Always test with paper trading enabled before live trading
Order Tags : Automatically generated for tracking (max 18 chars)
Position Management : Strategy closes opposite positions automatically
Signal Confirmation : Uses barstate.isconfirmed to prevent repainting
JSON Payload : All settings are converted to JSON and sent via webhook
Troubleshooting
No signals : Check if RSI is actually reaching your OB/OS levels
Orders not executing : Verify webhook URL and API credentials
Wrong strikes : Double-check Strike Interval for your asset
SL/TP not working : Ensure values are non-zero and mode is correct
Support
For API setup and connector configuration, visit Algoticks.in documentation.
Static 5 EMA Pack by LMA simple display of 5 ems's using 8,21,50,55,200 as the lengths for the ema's.
YM Ultimate SNIPER v6# YM Ultimate SNIPER v6 - Documentation & Trading Guide
## 🎯 ORDERFLOW EDITION | Order Blocks + Liquidity Sweeps + IFVG
**TARGET: 3-7 High-Confluence Trades per Day**
**Philosophy: "Zones That Matter"**
---
## ⚡ WHAT'S NEW IN v6
### Major Additions
| Feature | Description | Orderflow Purpose |
|---------|-------------|-------------------|
| **Order Blocks** | Last opposing candle before significant move | Shows where institutions absorbed orders |
| **Liquidity Sweeps** | Sweep of swing H/L with rejection | Identifies stop hunts / trap reversals |
| **IFVG** | Inverse FVG when price reclaims a gap | Failed institutional move = reversal signal |
| **Zone Quality Score** | 0-10 rating for each zone | Only "zones that matter" display |
| **3-Tier Scoring** | Weak/Medium/Excellent classification | Better trade selection |
| **Enhanced Table** | Larger, categorized, color-coded | Instant situation awareness |
### Orderflow Mindset
This version is built around **institutional order flow concepts**:
1. **Institutions leave footprints** → Order Blocks mark where they filled orders
2. **Retail gets trapped** → Liquidity Sweeps show the trap before reversal
3. **Failed moves reverse hard** → IFVG marks failed institutional attempts
4. **Not all zones are equal** → Quality scoring filters noise
---
## 🎯 QUICK REFERENCE
```
┌─────────────────────────────────────────────────────────────────────────┐
│ YM ULTIMATE SNIPER v6 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ SIGNALS: │
│ S🎯 = S-Tier (50+ pts) → HOLD position │
│ A🎯 = A-Tier (25-49 pts) → SWING trade │
│ B🎯 = B-Tier (12-24 pts) → SCALP quick │
│ Z = Zone entry (quality FVG/OB zone) │
│ LS↑ = Bullish Liquidity Sweep (lows swept + rejection) │
│ LS↓ = Bearish Liquidity Sweep (highs swept + rejection) │
│ │
│ ZONES: │
│ 🟦 Blue boxes = Bullish Order Block (buy zone) │
│ 🟪 Pink boxes = Bearish Order Block (sell zone) │
│ 🟩 Green boxes = Bullish FVG (buy zone) │
│ 🟥 Red boxes = Bearish FVG (sell zone) │
│ 🟣 Purple dashed = IFVG (inverse - strong reversal zone) │
│ │
│ SCORE CLASSIFICATION: │
│ EXCELLENT (7.0+) = Full size, high confidence │
│ MEDIUM (4.5-6.9) = Standard size, good setup │
│ WEAK (<4.5) = No signal shown │
│ │
│ SESSIONS (ET): │
│ LDN = 3:00-5:00 AM (London) │
│ NY = 9:30-11:30 AM (New York Open) │
│ PWR = 3:00-4:00 PM (Power Hour) │
│ │
└─────────────────────────────────────────────────────────────────────────┘
```
---
## 📦 ORDER BLOCKS (OB)
### What Are Order Blocks?
Order blocks mark the **last opposing candle before a significant move**. This is where institutional traders absorbed retail orders before moving price in their intended direction.
### Detection Logic (Breaker Style)
```
BULLISH OB:
├── Last BEARISH candle before strong bullish move
├── Move after must be ≥ 1.5x ATR
├── Shows where institutions absorbed selling
└── Expect support when price returns
BEARISH OB:
├── Last BULLISH candle before strong bearish move
├── Move after must be ≥ 1.5x ATR
├── Shows where institutions absorbed buying
└── Expect resistance when price returns
```
### OB Quality Scoring
Each Order Block gets a strength score (0-10) based on:
- **Move strength** after the OB (ATR multiple)
- **Volume** on the OB candle
- **Body ratio** of the OB candle
Only OBs with strength ≥ 4 are displayed.
### Trading Order Blocks
| Scenario | Action |
|----------|--------|
| Price returns to Bull OB + buy delta | Look for LONG |
| Price returns to Bear OB + sell delta | Look for SHORT |
| OB + FVG overlap (thick border) | HIGH PROBABILITY |
| OB tested once (gray) | Still valid, often best entry |
| OB broken (closes through) | Invalidated, removed |
---
## 💎 LIQUIDITY SWEEPS
### What Are Liquidity Sweeps?
A liquidity sweep occurs when price **hunts stop losses** by briefly breaking a swing high/low, then **immediately reverses** back. This is the classic "stop hunt" or "liquidity grab."
### Detection Logic
```
BULLISH SWEEP (LS↑):
├── Price sweeps BELOW a recent swing low
├── Closes BACK ABOVE the swing level
├── Shows lower wick (rejection)
├── Buy delta dominance on the candle
└── SIGNAL: Lows swept, shorts trapped → GO LONG
BEARISH SWEEP (LS↓):
├── Price sweeps ABOVE a recent swing high
├── Closes BACK BELOW the swing level
├── Shows upper wick (rejection)
├── Sell delta dominance on the candle
└── SIGNAL: Highs swept, longs trapped → GO SHORT
```
### Why Sweeps Matter for Orderflow
1. **Retail stops get hit** → Liquidity provided to institutions
2. **Institutions fill orders** → At better prices thanks to the sweep
3. **Price reverses** → Move in intended direction begins
4. **You enter with institutions** → Not against them
### Sweep + Zone = High Probability
When a liquidity sweep happens AT or NEAR an Order Block or FVG zone, the probability increases significantly.
---
## 🔄 IFVG (INVERSE FVG)
### What Is an IFVG?
An Inverse FVG forms when price **fills an FVG and then reclaims it** in the opposite direction. This signals a **failed institutional move**.
### Detection Logic
```
BULLISH IFVG:
├── Bearish FVG was created (gap down)
├── Price fills the gap (tests zone)
├── Price CLOSES ABOVE the gap with buy delta
└── SIGNAL: Bears failed → Strong reversal UP
BEARISH IFVG:
├── Bullish FVG was created (gap up)
├── Price fills the gap (tests zone)
├── Price CLOSES BELOW the gap with sell delta
└── SIGNAL: Bulls failed → Strong reversal DOWN
```
### Why IFVG Is Powerful
- Shows institutional failure → Other side takes control
- Pre-assigned quality score of 8.0 (high priority)
- Often marks significant reversals
- Purple dashed boxes for easy identification
---
## 📊 ZONE QUALITY SCORING
### The "Zones That Matter" Filter
Not all FVGs and OBs are created equal. v6 implements a **Zone Quality Score** (0-10) that filters out low-quality zones.
### Quality Calculation
| Factor | Max Points | How Measured |
|--------|------------|--------------|
| Gap Size | 2.5 | Larger gap = more points |
| Impulse Strength | 2.5 | Stronger move = more points |
| Volume | 2.0 | Higher volume = more points |
| OB Alignment | 2.0 | FVG overlaps with OB = bonus |
| Session | 1.0 | Created in active session = bonus |
### Min Quality Threshold (Default: 6.0)
Zones scoring below this threshold **are not displayed**. Adjust in settings:
- **Conservative**: Set to 7.0+ (fewer, better zones)
- **Standard**: 6.0 (balanced)
- **Aggressive**: 4.0-5.0 (more zones, more noise)
### Visual Quality Indicators
- **Thick border**: Zone aligns with Order Block (high quality)
- **Bright color**: Fresh zone
- **Gray color**: Tested zone (still valid)
- **Removed**: Broken zone (invalidated)
---
## 📊 CONFLUENCE SCORING SYSTEM
### Score Components (Max ~12, normalized to 10)
| Factor | Points | Condition |
|--------|--------|-----------|
| **Tier** | 1-3 | B=1, A=2, S=3 |
| **FVG Zone** | +1.5 | Price in quality FVG |
| **Order Block** | +1.5 | Price in OB |
| **IFVG** | +1.0 | Price in Inverse FVG |
| **Strong Volume** | +1.0 | Volume ≥ 2x average |
| **Extreme Volume** | +0.5 | Volume ≥ 2.5x average |
| **Strong Delta** | +1.0 | Delta ≥ 70% |
| **Extreme Delta** | +0.5 | Delta ≥ 78% |
| **CVD Momentum** | +0.5-1.0 | CVD trending with signal |
| **Liquidity Sweep** | +1.5 | Recent sweep confirms direction |
### Score Classification
| Score | Class | Confidence | Position Size |
|-------|-------|------------|---------------|
| **7.0+** | EXCELLENT | Very High | Full size (100%) |
| **4.5-6.9** | MEDIUM | Good | Standard (75%) |
| **< 4.5** | WEAK | Low | No signal shown |
### Score Displayed in Table
The table shows both the numeric score and classification:
- Green background + "EXCELLENT" = Top tier setup
- Orange background + "MEDIUM" = Decent setup
- Gray + "WEAK" = Below threshold
---
## 📊 ENHANCED TABLE REFERENCE
The v6 table is organized into **4 sections**:
### CANDLE Section
| Row | What It Shows |
|-----|---------------|
| Points | Candle range in points + Tier (S/A/B/X) |
| Volume | Volume ratio + grade (🔥/✓✓/✓/✗) |
### ORDERFLOW Section
| Row | What It Shows |
|-----|---------------|
| Delta | Buy/Sell % + grade (🔥/✓✓/✓/—) |
| CVD | Direction + strength (▲▲ STRONG, ▲ UP, etc.) |
### STRUCTURE Section
| Row | What It Shows |
|-----|---------------|
| FVG Zone | Current zone status + quality score |
| Order Block | OB status (BULL OB / BEAR OB / —) |
| Liq Sweep | Recent sweep status + 🎯 indicator |
### SIGNAL Section
| Row | What It Shows |
|-----|---------------|
| Session | Current session (NY/LDN/PWR/OFF) + 🟢/🔴 |
| SCORE | Numeric score /10 + classification |
### Color Coding
- **🟢 Green/Lime**: Good, meets threshold, bullish
- **🟠 Orange/Amber**: Caution, borderline, medium
- **🔴 Red**: Bad, below threshold, bearish
- **⚪ Gray**: Inactive/neutral
- **🔥**: Extreme/exceptional reading
---
## ✅ ENTRY CHECKLIST v6
Before entering any trade:
### Basic Requirements
- Signal present (S🎯/A🎯/B🎯 or Z)
- Score ≥ 4.5 (MEDIUM or better)
- Session active (LDN/NY/PWR shows 🟢)
### Orderflow Confirmation
- Delta colored (not gray)
- CVD arrow matches direction
- Volume shows ✓ or better
### Structure Bonus (Any = Better)
- In FVG Zone
- In Order Block
- Recent Liquidity Sweep
- IFVG present
### Execute
- Enter at signal candle close
- Stop below/above candle (shown on chart)
- Target at calculated R:R level
---
## 🎯 IDEAL SETUPS (HIGH WIN RATE)
### Setup 1: Sweep + Zone + Tier
```
Conditions:
├── Liquidity Sweep just occurred (LS↑ or LS↓)
├── Price is at Order Block or FVG
├── Tier signal fires (S/A/B)
├── Score: 7+ EXCELLENT
└── Win Rate: ~75-85%
```
### Setup 2: IFVG + Delta Confirmation
```
Conditions:
├── IFVG just formed (purple zone)
├── Strong delta (70%+) in IFVG direction
├── CVD confirming
├── Score: 7+ EXCELLENT
└── Win Rate: ~70-80%
```
### Setup 3: OB + FVG Overlap
```
Conditions:
├── Order Block present
├── FVG zone overlaps with OB (thick border)
├── Price returns to overlap zone
├── Delta confirms direction
└── Win Rate: ~70-78%
```
### Setup 4: Clean Zone Entry
```
Conditions:
├── Quality zone (score 6+)
├── No tier signal but Z entry shows
├── Delta matches zone direction
├── In active session
└── Win Rate: ~65-72%
```
---
## ⛔ DO NOT TRADE
- Session shows "OFF" or 🔴
- Score < 4.5 (WEAK)
- Delta shows "—" (no dominance)
- CVD conflicts with signal direction
- Multiple conflicting zones
- Zone quality < 6
- Major news imminent (FOMC, NFP, CPI)
- Price chopping between zones
---
## 🔧 SETTINGS GUIDE
### Recommended Configurations
**Conservative (2-4 trades/day):**
```
Min Score Medium: 5.5
Min Score Excellent: 7.5
Min Zone Quality: 7.0
Min Volume Ratio: 2.0
Delta Threshold: 65%
```
**Standard (4-6 trades/day):**
```
Min Score Medium: 4.5
Min Score Excellent: 7.0
Min Zone Quality: 6.0
Min Volume Ratio: 1.8
Delta Threshold: 62%
```
**Aggressive (6-8 trades/day):**
```
Min Score Medium: 4.0
Min Score Excellent: 6.5
Min Zone Quality: 5.0
Min Volume Ratio: 1.5
Delta Threshold: 60%
```
---
## 🚨 ALERTS PRIORITY
### Must-Have Alerts
| Alert | Priority | Action |
|-------|----------|--------|
| ⭐ EXCELLENT LONG/SHORT | 🔴 CRITICAL | Drop everything, check NOW |
| 🎯 S-TIER | 🟠 HIGH | Evaluate within 10 seconds |
| 💎 LIQUIDITY SWEEP | 🟠 HIGH | Check for zone confluence |
| 🔄 IFVG | 🟡 MEDIUM | Note reversal potential |
### Useful Context Alerts
| Alert | Purpose |
|-------|---------|
| 📦 NEW OB | Mark institutional zone |
| 📦 NEW FVG | Mark gap zone |
| SESSION OPEN | Prepare to trade |
---
## 📈 TRADE JOURNAL v6
```
DATE: ___________
SESSION: ☐ LDN ☐ NY ☐ PWR
SETUP TYPE:
☐ Sweep + Zone ☐ IFVG ☐ OB+FVG ☐ Zone Entry
TRADE:
├── Time: _______
├── Signal: S🎯 / A🎯 / B🎯 / Z / LS
├── Direction: LONG / SHORT
├── Score: ___/10 (EXCELLENT / MEDIUM)
├── Entry: _______
├── Stop: _______
├── Target: _______
│
├── In FVG Zone: ☐ Yes ☐ No
├── In Order Block: ☐ Yes ☐ No
├── Liquidity Sweep: ☐ Yes ☐ No
├── IFVG Present: ☐ Yes ☐ No
│
├── Result: +/- ___ pts ($_____)
└── Notes: _______________________
DAILY SUMMARY:
├── Trades: ___
├── EXCELLENT setups: ___
├── MEDIUM setups: ___
├── Wins: ___ | Losses: ___
├── Net P/L: $_____
└── Best setup type: _______________________
```
---
## 🏆 GOLDEN RULES v6
> **"Institutions sweep, then move. Wait for the sweep."**
> **"Order Blocks show where they filled. Trade there."**
> **"IFVG = They failed. Take the other side."**
> **"Zone Quality 6+ or walk away."**
> **"EXCELLENT score = Green light. MEDIUM = Yellow light. WEAK = Red light."**
> **"Confluence beats conviction. Stack the factors."**
> **"Leave every trade with money. The next setup is coming."**
---
## 🔧 TROUBLESHOOTING
| Issue | Solution |
|-------|----------|
| No signals | Lower Min Score Medium to 4.0 |
| Too many signals | Raise Min Score Medium to 5.5+ |
| Too many zones | Raise Min Zone Quality to 7.0+ |
| Zones cluttering | Reduce Max Zones to 6-8 |
| OBs everywhere | Raise OB Min Strength to 1.8+ |
| Missing sweeps | Lower Sweep Lookback, reduce Min Wick Ratio |
| Table too small | Change Table Size to "large" |
| Wrong timezone | Check Session Timezone setting |
---
## 📝 TECHNICAL NOTES
- **Pine Script v6** (latest syntax)
- **Works on**: YM, MYM, NQ, MNQ, ES, MES, GC, MGC
- **Auto-detects** instrument for proper point calculation
- **Recommended TF**: 1-5 minute for day trading
- **Min TradingView Plan**: Free (no premium features required)
- **Max visual elements**: 500 labels, 500 boxes, 500 lines
---
*© Alexandro Disla - YM Ultimate SNIPER v6*
*Orderflow Edition | Zones That Matter*
mmmmFake Bullish Candle Detector //@version=5
indicator("Fake Bullish Candle Detector", overlay=true, max_labels_count=500)
// Inputs
wickPerc = input.float(50, "Max Wick % for True Bullish", step=1) // Upper wick % of total candle
volMultiplier = input.float(0.8, "Min Volume vs Previous Candles", step=0.1)
// Previous candle volumes
vol1 = volume
vol2 = volume
// Typical Price & VWAP per candle
tp = hlc3
vwap_candle = tp // per-candle VWAP (typical price)
// Candle data
body = math.abs(close - open)
candleHeight = high - low
upperWick = high - math.max(open, close)
upperWickPerc = (upperWick / candleHeight) * 100
// Volume check
lowVol = volume < (vol1 * volMultiplier) and volume < (vol2 * volMultiplier)
// Fake bullish condition
fakeBullish = (close > open) and (lowVol or upperWickPerc > wickPerc or close < high*0.9 or close < vwap_candle)
// Plot background for fake bullish
bgcolor(fakeBullish ? color.new(color.red, 80) : na)
// Optional: Label on fake bullish candles
if fakeBullish and barstate.isconfirmed
label.new(bar_index, high, "FAKE BULL", style=label.style_label_down, color=color.red, textcolor=color.white)
// Alert
alertcondition(fakeBullish, title="Fake Bullish Candle", message="Fake Bullish Candle detected on chart")
YM Ultimate SNIPER v5# YM Ultimate SNIPER v5 - Documentation & Trading Guide
## 🎯 Unified GRA + DeepFlow | YM/MYM Optimized
**TARGET: 3-7 High-Confluence Trades per Day**
---
## ⚡ QUICK START
```
┌─────────────────────────────────────────────────────────────────┐
│ YM ULTIMATE SNIPER v5 │
├─────────────────────────────────────────────────────────────────┤
│ │
│ SIGNALS: │
│ S🎯 = S-Tier (50+ pts) → HOLD position │
│ A🎯 = A-Tier (25-49 pts) → SWING trade │
│ B🎯 = B-Tier (12-24 pts) → SCALP quick │
│ Z = Zone entry (price at FVG zone) │
│ │
│ SESSIONS (ET): │
│ LDN = 3:00-5:00 AM (London) │
│ NY = 9:30-11:30 AM (New York Open) │
│ PWR = 3:00-4:00 PM (Power Hour) │
│ │
│ COLORS: │
│ 🟩 Green zones = Bullish FVG (buy zone) │
│ 🟥 Red zones = Bearish FVG (sell zone) │
│ 🟣 Purple lines = Single prints (S/R levels) │
│ │
│ TABLE (Top Right): │
│ Pts = Candle point range │
│ Tier = S/A/B/X classification │
│ Vol = Volume ratio (green = good) │
│ Delta = Buy/Sell dominance │
│ Sess = Current session │
│ Zone = In FVG zone status │
│ Score = Confluence score /10 │
│ CVD = Cumulative delta direction │
│ R:R = Risk:Reward ratio │
│ │
└─────────────────────────────────────────────────────────────────┘
```
---
## 📋 VERSION 5 CHANGES
### What's New
- **Removed all imbalance code** - caused compilation errors
- **Simplified delta analysis** - uses candle structure instead of intrabar data
- **Cleaner confluence scoring** - 5 clear factors, max 10 points
- **Reliable table** - updates on last bar only, no flickering
- **Works on YM and MYM** - same logic applies to micro contracts
### Removed Features
- Candle-anchored imbalance markers
- Imbalance S/R zones
- Intrabar volume profile analysis
- POC visualization
### Kept & Improved
- Tier classification (S/A/B)
- FVG zone detection & visualization
- Single print detection
- Session windows with backgrounds
- Confluence scoring
- Stop/Target auto-calculation
- All alerts
---
## 🎯 SIGNAL TYPES
### Tier Signals (S🎯, A🎯, B🎯)
These are high-confluence signals that pass all filters:
| Tier | Points | Value/Contract | Action | Hold Time |
|------|--------|----------------|--------|-----------|
| **S** | 50+ | $250+ | HOLD | 2-5 min |
| **A** | 25-49 | $125-245 | SWING | 1-3 min |
| **B** | 12-24 | $60-120 | SCALP | 30-90 sec |
**Filters Required:**
1. Tier threshold met (points)
2. Volume ≥ 1.8x average
3. Delta dominance ≥ 62%
4. Body ratio ≥ 70%
5. Range ≥ 1.3x average
6. Proper wicks (no reversal wicks)
7. CVD confirmation (optional)
8. In trading session
### Zone Signals (Z)
Zone entries trigger when:
- Price is inside an FVG zone
- Delta shows dominance in zone direction
- Volume is above average
- In active session
- No tier signal already present
---
## 📊 CONFLUENCE SCORING
**Maximum Score: 10 points**
| Factor | Points | Condition |
|--------|--------|-----------|
| Tier | 1-3 | B=1, A=2, S=3 |
| In Zone | +2 | Price inside FVG zone |
| Strong Volume | +2 | Volume ≥ 2x average |
| Strong Delta | +2 | Delta ≥ 70% |
| CVD Momentum | +1 | CVD trending with signal |
**Score Interpretation:**
- **7-10**: Elite setup - full size
- **5-6**: Good setup - standard size
- **4**: Minimum threshold - reduced size
- **< 4**: No signal shown
---
## ⏰ SESSION WINDOWS
### London (3:00-5:00 AM ET)
- European institutional flow
- Character: Slow build-up, clean trends
- Expected trades: 1-2
- Best for: Zone entries, A/B tier
### NY Open (9:30-11:30 AM ET)
- Highest volume, most institutional activity
- Character: Initial balance, breakouts
- Expected trades: 2-3
- Best for: S/A tier, zone confluence
### Power Hour (3:00-4:00 PM ET)
- End-of-day rebalancing, MOC orders
- Character: Mean reversion or trend acceleration
- Expected trades: 1-2
- Best for: Zone entries, B tier scalps
---
## 🟩 FVG ZONES
### What Are FVG Zones?
Fair Value Gaps (FVGs) are price gaps between candles where price moved so fast that a gap was left. These gaps often act as support/resistance.
### Zone Requirements
- Gap size ≥ 25% of ATR
- Impulse candle has strong body (≥ 70%)
- Impulse candle is 1.5x average range
- Volume above average on impulse
- Created during active session
### Zone States
1. **Fresh** (bright color) - Just created, untested
2. **Tested** (gray) - Price touched zone midpoint
3. **Broken** (removed) - Price closed through zone
### Trading FVG Zones
| Zone | Approach From | Expected |
|------|--------------|----------|
| 🟩 Bull | Above (falling) | Support - look for bounce |
| 🟥 Bear | Below (rising) | Resistance - look for rejection |
---
## 🟣 SINGLE PRINTS
Single prints mark candles with:
- Range > 1.3x average
- Body > 70% of range
- Volume > 1.8x average
- Clear delta dominance
These become horizontal support/resistance lines extending into the future.
---
## 📊 TABLE REFERENCE
| Row | Label | Meaning |
|-----|-------|---------|
| 1 | Pts | Current candle point range |
| 2 | Tier | S/A/B/X classification |
| 3 | Vol | Volume ratio vs 20-bar average |
| 4 | Delta | Buy/Sell percentage dominance |
| 5 | Sess | Current session (LDN/NY/PWR/OFF) |
| 6 | Zone | In FVG zone (BULL/BEAR/---) |
| 7 | Score | Confluence score out of 10 |
| 8 | CVD | Delta momentum direction |
| 9 | R:R | Risk:Reward if signal active |
### Color Coding
- **Green/Lime**: Good, meets threshold
- **Yellow**: Caution, borderline
- **Red**: Bad, below threshold
- **Gray**: Inactive/neutral
---
## 🔧 SETTINGS GUIDE
### Tier Thresholds
| Setting | Default | Notes |
|---------|---------|-------|
| S-Tier | 50 pts | ~$250/contract |
| A-Tier | 25 pts | ~$125/contract |
| B-Tier | 12 pts | ~$60/contract |
### Sniper Filters
| Setting | Default | Notes |
|---------|---------|-------|
| Min Volume Ratio | 1.8x | Lower = more signals |
| Delta Dominance | 62% | Lower = more signals |
| Body Ratio | 70% | Higher = fewer, cleaner |
| Range Multiplier | 1.3x | Higher = fewer, bigger moves |
| CVD Confirm | On | Off = more signals |
### Recommended Configurations
**Conservative (3-4 trades/day):**
```
Min Confluence: 6
Volume Ratio: 2.0
Delta Threshold: 65%
Body Ratio: 75%
```
**Standard (5-7 trades/day):**
```
Min Confluence: 4
Volume Ratio: 1.8
Delta Threshold: 62%
Body Ratio: 70%
```
**Aggressive (7-10 trades/day):**
```
Min Confluence: 3
Volume Ratio: 1.5
Delta Threshold: 60%
Body Ratio: 65%
```
---
## ✓ ENTRY CHECKLIST
Before entering any trade:
1. ☐ Signal present (S🎯, A🎯, B🎯, or Z)
2. ☐ Session active (LDN, NY, or PWR)
3. ☐ Score ≥ 4 (preferably 6+)
4. ☐ Vol shows GREEN
5. ☐ Delta colored (not gray)
6. ☐ CVD arrow matches direction
7. ☐ Note stop/target lines
8. ☐ Execute at signal candle close
---
## ⛔ DO NOT TRADE
- Session shows "OFF"
- Score < 4
- Vol shows RED
- Delta gray (no dominance)
- Multiple conflicting signals
- Major news imminent (FOMC, NFP, CPI)
- Overnight session (11:30 PM - 3:00 AM ET)
---
## 🎯 POSITION SIZING
| Tier | Score | Size | Stop |
|------|-------|------|------|
| S (50+ pts) | 7+ | 100% | Below/above candle |
| A (25-49 pts) | 5-6 | 75% | Below/above candle |
| B (12-24 pts) | 4 | 50% | Below/above candle |
| Zone | Any | 50% | Beyond zone |
---
## 🚨 ALERTS
### Priority Alerts (Set These)
| Alert | Action |
|-------|--------|
| 🎯 S-TIER | Drop everything, check immediately |
| 🎯 A-TIER | Evaluate within 15 seconds |
| 🎯 B-TIER | Check if available |
| 🎯 ZONE | Good context entry |
### Info Alerts (Optional)
| Alert | Purpose |
|-------|---------|
| NEW BULL/BEAR FVG | Mark zones on mental map |
| SINGLE PRINT | Note for future S/R |
| SESSION OPEN | Prepare to trade |
---
## 📈 TRADE JOURNAL
```
DATE: ___________
SESSION: ☐ LDN ☐ NY ☐ PWR
TRADE:
├── Time: _______
├── Signal: S🎯 / A🎯 / B🎯 / Z
├── Direction: LONG / SHORT
├── Score: ___/10
├── Entry: _______
├── Stop: _______
├── Target: _______
├── In Zone: ☐ Yes ☐ No
├── Result: +/- ___ pts ($_____)
└── Notes: _______________________
DAILY:
├── Trades: ___
├── Wins: ___ | Losses: ___
├── Net P/L: $_____
└── Best setup: _______________________
```
---
## 🏆 GOLDEN RULES
> **"Wait for the session. Off-hours = noise."**
> **"Score 6+ is your edge. Anything less is gambling."**
> **"Zone + Tier = bread and butter combo."**
> **"One great trade beats five forced trades."**
> **"Leave every trade with money. YM gives you time."**
---
## 🔧 TROUBLESHOOTING
| Issue | Solution |
|-------|----------|
| No signals | Lower min score to 3-4 |
| Too many signals | Raise min score to 6+ |
| Zones cluttering | Reduce max zones to 8 |
| Missing sessions | Check timezone setting |
| Table not updating | Resize chart or refresh |
---
## 📝 TECHNICAL NOTES
- **Pine Script v6**
- **Works on**: YM, MYM, any Dow futures
- **Recommended TF**: 1-5 minute for day trading
- **Min TradingView Plan**: Free (no intrabar data required)
---
*© Alexandro Disla - YM Ultimate SNIPER v5*
*Clean Build | Proven Components Only*
MTF RSI Stacked + AI + Gradient MTF RSI Stacked + AI + Gradient
Quick-start guide & best-practice rules
What the indicator does
Multi-Time-Frame RSI in one pane
• 10 time-frames (1 m → 1 M) are stacked 100 points apart (0, 100, 200 … 900).
• Each RSI is plotted with a smooth red-yellow-green gradient:
– Red = RSI below 30 (oversold)
– Yellow = RSI near 50
– Green = RSI above 70 (overbought)
• Grey 30-70 bands are drawn for every TF so you can see extremities at a glance.
Built-in AI (KNN) signal
• On every close of the chosen AI-time-frame the script:
– Takes the last 14-period RSI + normalised ATR as “features”
– Compares them to the last N bars (default 1 000)
– Votes of the k = 5 closest neighbours → BUY / SELL / NEUTRAL
• Confidence % is shown in the badge (top-right).
• A thick vertical line (green/red) is printed once when the signal flips.
How to read it
• Gradient colour tells you instantly which TFs are overbought/obove sold.
• When all or most gradients are green → broad momentum up; look for shorts only on lower-TF pullbacks.
• When most are red → broad momentum down; favour longs only on lower-TF bounces.
• Use the AI signal as a confluence filter, not a stand-alone entry:
– If AI = BUY and 3+ higher-TF RSIs just crossed > 50 → consider long.
– If AI = SELL and 3+ higher-TF RSIs just crossed < 50 → consider short.
• Divergences: price makes a higher high but 1 h/4 h RSI (gradient) makes a lower high → possible reversal.
Settings you can tweak
AI timeframe – leave empty = same as chart, or pick a higher TF (e.g. “15” or “60”) to slow the signal down.
Training bars – 500-2 000 is the sweet spot; bigger = slower but more stable.
K neighbours – 3-7; lower = more signals, higher = smoother.
RSI length – 14 is standard; 9 gives earlier turns, 21 gives fewer false swings.
Practical trading workflow
Open the symbol on your execution TF (e.g. 5 m).
Set AI timeframe to 3-5× execution TF (e.g. 15 m or 30 m) so the signal survives market noise.
Wait for AI signal to align with gradient extremes on at least one higher TF.
Enter on the first gradient reversal inside the 30-70 band on the execution TF.
Place stop beyond the swing that caused the gradient flip; target next opposing 70/30 level on the same TF or trail with structure.
Colour cheat-sheet
Bright green → RSI ≥ 70 (overbought)
Bright red → RSI ≤ 30 (oversold)
Muted colours → RSI near 50 (neutral, momentum pause)
That’s it—one pane, ten time-frames, colour-coded extremes and an AI confluence layer.
Keep the chart clean, use price action for precise entries, and let the gradient tell you when the wind is at your back.
Kịch bản của tôi//@version=6
indicator(title="Relative Strength Index", shorttitle="Gấu Trọc RSI", format=format.price, precision=2, timeframe="", timeframe_gaps=true)
rsiLengthInput = input.int(14, minval=1, title="RSI Length", group="RSI Settings")
rsiSourceInput = input.source(close, "Source", group="RSI Settings")
calculateDivergence = input.bool(false, title="Calculate Divergence", group="RSI Settings", display = display.data_window, tooltip = "Calculating divergences is needed in order for divergence alerts to fire.")
change = ta.change(rsiSourceInput)
up = ta.rma(math.max(change, 0), rsiLengthInput)
down = ta.rma(-math.min(change, 0), rsiLengthInput)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsiPlot = plot(rsi, "RSI", color=#7E57C2)
rsiUpperBand1 = hline(98, "RSI Upper Band1", color=#787B86)
rsiUpperBand = hline(70, "RSI Upper Band", color=#787B86)
midline = hline(50, "RSI Middle Band", color=color.new(#787B86, 50))
rsiLowerBand = hline(30, "RSI Lower Band", color=#787B86)
rsiLowerBand2 = hline(14, "RSI Lower Band2", color=#787B86)
fill(rsiUpperBand, rsiLowerBand, color=color.rgb(126, 87, 194, 90), title="RSI Background Fill")
midLinePlot = plot(50, color = na, editable = false, display = display.none)
fill(rsiPlot, midLinePlot, 100, 70, top_color = color.new(color.green, 0), bottom_color = color.new(color.green, 100), title = "Overbought Gradient Fill")
fill(rsiPlot, midLinePlot, 30, 0, top_color = color.new(color.red, 100), bottom_color = color.new(color.red, 0), title = "Oversold Gradient Fill")
// 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("SMA", "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(rsi, maLengthInput, maTypeInput) : na
smoothingStDev = isBB ? ta.stdev(rsi, maLengthInput) * bbMultInput : na
plot(smoothingMA, "RSI-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)
// Divergence
lookbackRight = 5
lookbackLeft = 5
rangeUpper = 60
rangeLower = 5
bearColor = color.red
bullColor = color.green
textColor = color.white
noneColor = color.new(color.white, 100)
_inRange(bool cond) =>
bars = ta.barssince(cond)
rangeLower <= bars and bars <= rangeUpper
plFound = false
phFound = false
bullCond = false
bearCond = false
rsiLBR = rsi
if calculateDivergence
//------------------------------------------------------------------------------
// Regular Bullish
// rsi: Higher Low
plFound := not na(ta.pivotlow(rsi, lookbackLeft, lookbackRight))
rsiHL = rsiLBR > ta.valuewhen(plFound, rsiLBR, 1) and _inRange(plFound )
// Price: Lower Low
lowLBR = low
priceLL = lowLBR < ta.valuewhen(plFound, lowLBR, 1)
bullCond := priceLL and rsiHL and plFound
//------------------------------------------------------------------------------
// Regular Bearish
// rsi: Lower High
phFound := not na(ta.pivothigh(rsi, lookbackLeft, lookbackRight))
rsiLH = rsiLBR < ta.valuewhen(phFound, rsiLBR, 1) and _inRange(phFound )
// Price: Higher High
highLBR = high
priceHH = highLBR > ta.valuewhen(phFound, highLBR, 1)
bearCond := priceHH and rsiLH and phFound
plot(
plFound ? rsiLBR : na,
offset = -lookbackRight,
title = "Regular Bullish",
linewidth = 2,
color = (bullCond ? bullColor : noneColor),
display = display.pane,
editable = calculateDivergence)
plotshape(
bullCond ? rsiLBR : na,
offset = -lookbackRight,
title = "Regular Bullish Label",
text = " Bull ",
style = shape.labelup,
location = location.absolute,
color = bullColor,
textcolor = textColor,
display = display.pane,
editable = calculateDivergence)
plot(
phFound ? rsiLBR : na,
offset = -lookbackRight,
title = "Regular Bearish",
linewidth = 2,
color = (bearCond ? bearColor : noneColor),
display = display.pane,
editable = calculateDivergence)
plotshape(
bearCond ? rsiLBR : na,
offset = -lookbackRight,
title = "Regular Bearish Label",
text = " Bear ",
style = shape.labeldown,
location = location.absolute,
color = bearColor,
textcolor = textColor,
display = display.pane,
editable = calculateDivergence)
alertcondition(bullCond, title='Regular Bullish Divergence', message="Found a new Regular Bullish Divergence, `Pivot Lookback Right` number of bars to the left of the current bar.")
alertcondition(bearCond, title='Regular Bearish Divergence', message='Found a new Regular Bearish Divergence, `Pivot Lookback Right` number of bars to the left of the current bar.')
Daily Oversold Swing ScreenerThat script is a **Pine Script Indicator** designed to identify potential **swing trade entry points** on a daily timeframe by looking for stocks that are **oversold** but still in a **healthy long-term uptrend**.
It screens for a high-probability reversal setup by combining four specific technical conditions.
Here is a detailed breakdown of the script's purpose and logic:
---
## 📝 Script Description: Daily Oversold Swing Screener
This Pine Script indicator serves as a **momentum and trend confirmation tool** for active traders seeking short-to-intermediate-term long entries. It uses data calculated on the **Daily** timeframe to generate signals, regardless of the chart resolution you are currently viewing.
The indicator is designed to filter out stocks that are in a strong downtrend ("falling knives") and only signal pullbacks within an established uptrend, which significantly increases the probability of a successful swing trade bounce.
### 🔑 Key Conditions for a Signal:
The indicator generates a buy signal when **all four** of the following conditions are met on the Daily timeframe:
#### 1. Oversold Momentum
* **Condition:** `rsiD < rsiOS` (Daily RSI is below the oversold level, typically **30**).
* **Purpose:** Confirms that the selling pressure has been extreme and the stock is temporarily out of favor, setting up a potential bounce.
#### 2. Momentum Turning Up
* **Condition:** `rsiD > rsiPrev` (Current Daily RSI value is greater than the previous day's Daily RSI value).
* **Purpose:** This is the most crucial filter. It confirms that the momentum has **just started to shift upward**, indicating that the low may be in and the stock is turning away from the oversold region.
#### 3. Established Uptrend (No Falling Knives)
* **Condition:** `sma50 > sma200 and closeD > sma50` (50-day SMA is above the 200-day SMA, AND the current daily close is above the 50-day SMA).
* **Purpose:** This is a **long-term trend filter**. It ensures that the current oversold condition is just a **pullback** within a larger, structurally bullish market (50 > 200), and that the price is still holding above the short-term trend line (Close > 50 SMA). This effectively screens out weak stocks in continuous downtrends.
#### 4. Price at Support (Bollinger Bands)
* **Condition:** `closeD <= lowerBB` (Daily Close is less than or equal to the lower Bollinger Band).
* **Purpose:** Provides a secondary measure of extreme price deviation. When the price touches or breaches the lower band, it suggests a significant move away from the mean (basis), often signaling strong statistical support where price is likely to revert.
### 📌 Summary of Signal
The final signal (`signal`) is triggered only when the market is confirmed to be **in a healthy long-term trend (Condition 3)**, the price is at an **extreme support level (Condition 4)**, the momentum is **oversold (Condition 1)**, and most importantly, the **momentum has begun to reverse (Condition 2)**.
Dynamic SMA Trend System [Multi-Stage Risk Engine]Description:
This script implements a robust Trend Following strategy based on a multiple Simple Moving Average (SMA) crossover logic (25, 50, 100, 200). What sets this strategy apart is its advanced "4-Stage Risk Engine" and a smart "High-Water Mark" Re-Entry system, designed to protect profits during parabolic moves while filtering out chop during sideways markets.
How it works:
The strategy operates on three core pillars: Trend Identification, Dynamic Risk Management, and Momentum Re-Entry.
1. Entry Logic (Trend Identification) The script looks for crossovers at different trend stages to capture early reversals as well as established trends:
Short-Term: SMA 25 crosses over SMA 50.
Mid-Term: SMA 50 crosses over SMA 100.
Macro-Trend: SMA 100 crosses over SMA 200.
2. The 4-Stage Risk Engine (Dynamic Stop Loss) Instead of a static Stop Loss, this strategy uses a progressive system that adapts as the price increases:
Stage 1 (Protection): Starts with a fixed Stop Loss (default -10%) to give the trade room to breathe.
Stage 2 (Break-Even): Once the price rises by 12%, the Stop is moved to trailing mode (10% distance), effectively securing a near break-even state.
Stage 3 (Profit Locking): At 25% profit, the trailing stop tightens to 8% to lock in gains.
Stage 4 (Parabolic Mode): At 40% profit, the trailing stop tightens further to 5% to capture the peak of parabolic moves.
3. Dual Exit Mechanism The strategy exits a position if EITHER of the following happens:
Stop Loss Hit: Price falls below the dynamic red line (Risk Engine).
Dead Cross: The trend structure breaks (e.g., SMA 25 crosses under SMA 50), signaling a momentum loss even if the Stop Loss wasn't hit.
4. "High-Water Mark" Re-Entry To avoid "whipsaws" in choppy markets, the script does not re-enter immediately after a stop-out.
It marks the highest price of the previous trade (Green Dotted Line).
A Re-Entry only occurs if the price breaks above this previous high (showing renewed strength) AND the long-term trend is bullish (Price > SMA 200).
Visuals:
SMAs: 25 (Yellow), 50 (Orange), 100 (Blue), 200 (White).
Red Line: Visualizes the dynamic Stop Loss level.
Green Dots: Visualizes the target price needed for a valid re-entry.
Settings: All parameters (SMA lengths, Stop Loss percentages, Staging triggers) are fully customizable in the settings menu to fit different assets (Crypto, Stocks, Forex) and timeframes.
Every Hour 1st/Last FVG vTDL OVERVIEW - Shoutout to Micheal J. Huddleston aka ICT
This indicator identifies the first Fair Value Gap (FVG) that forms within each trading hour, providing traders with potential entry zones, reversal points, and unmitigated gap targets. Based on the concept that the first presented FVG of each hour represents a significant price delivery array where institutional order flow occurred.
The indicator detects FVGs on a lower timeframe (1-minute default) and displays them as boxes on your chart, tracking which gaps get filled and which remain open as potential draw-on-liquidity targets.
WHAT IS A FAIR VALUE GAP
A Fair Value Gap is a 3-candle price pattern representing an imbalance between buyers and sellers:
Bullish FVG: Forms when candle 3's low is above candle 1's high, leaving a gap
Bearish FVG: Forms when candle 3's high is below candle 1's low, leaving a gap
These gaps often act as magnets for price, which tends to return and "fill" the imbalance before continuing. They function as dynamic support and resistance zones.
KEY FEATURES
Detection Types
FVG: Standard fair value gap detection with volume imbalance expansion
Suspension FVG Blocks: Requires outside prints on both sides for more refined signals
Hourly Display Modes
First Only: Shows whichever FVG appears first each hour (bullish or bearish)
Show Both: Shows first bullish AND first bearish FVG independently each hour
Last FVG Tracking
Optionally display the last FVG of each hour
Useful for comparing how the hour developed
Can extend into the next hour for continued tracking
Breakaway Gap Detection
Gaps not traded into during their formation hour extend forward
Extended gaps display labels showing formation time and date
These unmitigated gaps become price targets and reversal zones
Gap Fill Modes
Touch Box: Marks filled when price enters the gap
Touch Midpoint: Marks filled when price reaches the 50 percent level
Fill Completely: Marks filled when price fills the entire gap with visual progress
HOW TO USE
Entry Points
The first FVG of each hour provides potential entry zones based on price reaction:
When price returns to an FVG and shows rejection, enter in the direction of rejection
The gap zone represents where institutional orders likely reside
Use the boundaries of the gap for stop loss placement
A clean rejection of the zone confirms it as valid support or resistance
Reversal Points
Unmitigated gaps that extend beyond their formation hour are high-probability reaction zones:
Extended boxes with labels indicate unfilled gaps
When price finally reaches these zones, expect a reaction
The longer a gap remains unfilled, the stronger the expected response
These zones act as magnets drawing price back to them
Price Targets
Use unmitigated gaps as draw-on-liquidity targets:
Look for extended boxes above or below current price
Price tends to seek out and fill imbalances
The midpoint line often serves as a minimum target
Multiple unfilled gaps in one direction suggest strong momentum potential
FRAMING DIRECTIONAL BIAS
The first presented FVG of each hour acts as a support or resistance zone. The direction of the FVG itself does not determine bias - it is how price reacts to that FVG that reveals the true market intention.
Reading Price Reaction
Price respects a bullish FVG as support and bounces higher = bullish bias confirmed
Price respects a bearish FVG as resistance and rejects lower = bearish bias confirmed
Price fails to hold a bullish FVG and breaks through = potential inversion, look for shorts
Price fails to hold a bearish FVG and breaks through = potential inversion, look for longs
Inversion Fair Value Gaps (IFVG)
When price trades through an FVG and closes beyond it, that gap can invert its role:
A bullish FVG that fails becomes resistance - use it as a short entry zone
A bearish FVG that fails becomes support - use it as a long entry zone
The inversion signals a shift in control from one side to the other
Watch for price to retest the inverted gap before continuing
Support and Resistance Framework
Think of each hourly first FVG as a key level:
Price above the FVG: the gap acts as potential support
Price below the FVG: the gap acts as potential resistance
Watch how price behaves when it returns to the gap zone
A clean rejection confirms the level; a break through signals inversion
SHORT-TERM SCALPING APPLICATION
These FVGs provide scalping opportunities each hour:
Identify the first FVG of the hour as your key level
Wait for price to trade away from it and return
Observe the reaction at the gap zone
Enter in the direction of the reaction with tight risk
Target the next FVG, midpoint, or nearby liquidity
Trade Management
Use the opposite side of the FVG box as your stop loss zone
The midpoint of the gap often provides first target or decision point
Scale out at nearby unmitigated gaps or key levels
If the gap inverts, flip your bias and look for entries in the new direction
MULTI-HOUR CONTEXT
If price consistently respects FVGs as support across hours = uptrend context
If price consistently respects FVGs as resistance across hours = downtrend context
If FVGs keep inverting = choppy or transitional market
Use higher timeframe direction to filter which reactions to trade
Compare first and last FVG of each hour to see how momentum developed
SESSION FILTERING
The indicator automatically excludes unreliable periods:
4 PM to 5 PM New York time (market close hours 16-17)
Weekend closed periods (Saturday and Sunday before 6 PM)
All timestamps use New York timezone for consistency with futures market hours.
SETTINGS GUIDE
Detection Settings
Detection Type: Choose between standard FVG or Suspension FVG Blocks
Lower Timeframe: 15 seconds, 1 minute, or 5 minutes for gap detection
Min FVG Size: Minimum gap size in ticks to filter noise
Display Settings
Hourly Display Mode: First Only shows one gap per hour; Show Both shows first bull and bear
Show First FVG: Toggle visibility of first FVG boxes
Show Last FVG: Toggle visibility of last FVG boxes
Show Midpoint Lines: Display the 50 percent level of each gap
Show Unfilled Breakaway Gaps: Extend boxes until price fills them
Show Only Today: Reduce clutter by hiding older hourly boxes
Gap Fill Detection Mode
Touch Box: Gap marked filled when price enters the zone
Touch Midpoint: Gap marked filled when price reaches 50 percent level
Fill Completely: Gap marked filled only when fully closed, shows visual fill progress
Recommended Settings by Style
Scalping: 1 minute LTF, 4 tick minimum, Show Both mode, Touch Box fill
Day Trading: 1 minute LTF, 4-8 tick minimum, First Only mode, Touch Midpoint fill
Swing Context: 5 minute LTF, Show Unfilled Gaps enabled, Fill Completely mode
COLOR CODING
Blue boxes: First bullish FVG of the hour
Red boxes: First bearish FVG of the hour
Green boxes: Last bullish FVG of the hour
Orange boxes: Last bearish FVG of the hour
Black midpoint lines: 50 percent level of each gap
Filled portion overlay: Shows visual progress in Fill Completely mode
All colors are fully customizable in the settings menu.
PRACTICAL TIPS
The first FVG of each hour is a hidden PD array - treat it as a significant level
Not every gap produces a tradeable reaction - wait for confirmation
Gaps that remain unfilled for multiple hours carry more weight
Use the Show Both mode to see both bullish and bearish opportunities each hour
When multiple gaps cluster in one zone, that area becomes even more significant
Inversions are powerful signals - a failed level often leads to acceleration
NOTES
Works on any instrument and timeframe
Best used on intraday charts (1 minute to 15 minute) viewing 1 minute LTF gaps
Combine with higher timeframe analysis for confluence
These are probability zones, not guarantees - always use proper risk management
The indicator handles HTF to LTF data fetching automatically
Gap-Up Momentum Screener (S.S)
ENGLISH-VERSION
1) TradingView Gap Screener (for US stocks)
➤ Conditions
Gap-Up ≥ +3% (large gaps indicate institutional pressure)
Pre-market volume ≥ 150% of the 20-day average
RS line > 50
Price > 50 SMA
Market cap ≥ 1 billion USD
No penny stocks
2) Minervini Gap-Entry Strategy (Swing Trading)
This is a variant specifically optimized for gaps + momentum.
A) Setup Criteria
The stock must meet the following conditions:
Gap-Up ≥ +3%
First retracement ≤ 30% of the gap
High relative strength (RS line rising)
Volume on the gap day > 2× average
Price above 20 EMA, 50 SMA, 150 SMA, 200 SMA
No immediate resistance within 2–5%
B) Entry Setups
Entry 1: First Pullback Entry (FPE)
Wait for the first 1–3 day consolidation.
Entry → Breakout of the small range.
Stop → Below the low of the pullback.
Rule: No entry on the gap day itself.
Entry 2: High Tight Flag above the Gap
Stock rises > 10% after the gap
Then forms a 3–8 day sideways phase
Entry → Break above the flag’s high
Stop → Below the flag base
Entry 3: ORB Entry (Opening Range Breakout, 30 minutes)
Very effective for strong gaps.
Wait 30 minutes after the market opens
Entry → Break above the high of these first 30 minutes
Stop → Below the 30-minute low
C) Stop Levels
For FPE: 4–8%
For ORB: 1–2 × ATR(14)
For flags: 3–5%
D) Add Rules
Only if the stock continues showing strong volume:
Add on every new 3–5 day high
Add only above half-range levels
Maximum 3 adds
3) Early-Warning Module (Setup forming but not ready for entry)
This module marks stocks that are forming a setup but are not yet buyable.
➤ Criteria
Gap-Up ≥ 3%
Strong volume
Stock pulls back and consolidates (1–5 bars)
BUT no breakout yet
4) Exact Entry Checklist (Minervini-style, optimized for gaps)
Checklist before entry:
Gap ≥ +3%
20 EMA rising
Volume > 2× average
RS line rising
Price > 50 SMA
Pullback not deeper than 30% of the gap
3+ green signals from the Early-Warning diamonds
If all 7 are fulfilled → green light.
5) How to apply the strategy in daily practice
Morning (08:00–09:00)
Check the screener
Build your watchlist
Identify gaps
US Market Open (15:30)
Monitor the Early-Warning module
Sort gap momentum opportunities
16:00–17:00
Enter: First Pullback / ORB / Flag
Set stops
Determine position size based on risk
After 20:00
Check volume strength
If momentum fades → no more adds
Extended SOPR Indicator — SSOPR Tops (A/B toggle)Extended SOPR Indicator — SSOPR Tops and Lows (A/B toggle)
Observation-only. Data: Glassnode SOPR.
Overview
This indicator extends the classical SOPR (Spent Output Profit Ratio) to improve readability and reduce noise on charts. SOPR measures whether coins moved on-chain were spent at a profit or at a loss. In brief: SOPR > 1 → spending at profit; SOPR < 1 → spending at loss. SSOPR (from "Smoothed SOPR") applies optional log transform (centers baseline at 0), smoothing (standard or adaptive), and adds structured signals: Z‑score lows (capitulation), buy zones , and top detection after prolonged elevation.
Why extend SOPR? (SSOPR vs classical SOPR)
• Noise reduction: Raw daily SOPR can whipsaw around its baseline. SSOPR uses smoothing and (optionally) adaptive smoothing so regimes are visible without overfitting.
• Better readability: The log transform shifts the break-even line to 0, making “profit territory” (above 0) and “loss territory” (below 0) visually intuitive on oscillators.
• Actionable context: Z‑score highlights extreme lows (capitulation risk), a simple buy-zone threshold marks potential accumulation, and a structured top pattern (with a time factor) helps frame distribution phases after sustained elevation.
What the script plots
• Smoothed SOPR (SSOPR): An orange line representing the smoothed SOPR (with optional log transform and optional adaptive smoothing).
• Top markers: A red triangle appears once at the onset of a confirmed top pattern.
• Background shading:
– Soft green: Buy zone when SSOPR falls below the “Buy Threshold.” (+ Z‑score capitulation zones (extreme lows)).
– Soft red: Top‑zone shading when the top criteria are met but before the single triangle fires.
Inputs & parameters
• Smoothing Length (default 14): Base window for smoothing SSOPR. Higher values = smoother, slower response.
• Apply Log Transform (default ON): Uses log(SOPR) so the baseline is 0 (log(1)=0). Above 0 → net profit regime; below 0 → net loss regime.
• Adaptive Smoothing (default OFF): Expands smoothing length as volatility rises using a standard deviation proxy; reduces whipsaws while preserving structure.
• Z‑score Threshold for Lows (default −2.5): Highlights capitulation zones when SSOPR deviates far below its rolling mean.
• SSOPR Buy Threshold (default −0.02): Simple rule-of-thumb level for potential accumulation context when below (log scale).
• SSOPR Top Threshold (default +0.005): Minimum elevation required for “profit territory” when assessing tops (log scale).
• Min Bars Above Threshold Before Top (default 50): Ensures prolonged elevation before calling a top.
• Lookback for Peak Detection (default 50): Window used to locate the recent high.
• Drop % from Peak to Confirm Top (default 5%): Confirms the start of distribution from a local high.
• Highlight Background : Toggles shaded zones.
Top detection (indicator-only)
A top fires when ALL of the following are true:
SSOPR spent at least Min Bars Above Threshold above the Top Threshold (sustained elevation).
The rising phase test passes (Option A or B; see below).
A drop from the local peak exceeds Drop % within the Lookback window.
The peak occurred in profit territory (SSOPR > Top Threshold).
To avoid repeated signals during the decline, the script emits the triangle once, at onset.
Rising‑phase switch: Option A vs Option B
• Option A — Up‑step ratio : Over the last A: Bars for Rising Check (default 50), it requires that at least A: Required Up‑Step Ratio (default 60%) of bars were rising (each bar compared to the previous). This favors gradual, persistent advances and filters out “choppy” lifts.
• Option B — Net slope : Compares current SSOPR to its value B: Bars Back for Net Slope ago (default 50). If higher, the series is considered rising. This is simpler and reacts faster in volatile phases but can admit brief pseudo‑trends.
Guidance : Prefer A for conservative confirmation in slow, persistent cycles; use B when trend moves are strong and you need timely detection.
Interpretation guide
• Regimes (log view): Above 0 → spending at profit; below 0 → spending at loss.
• Capitulation lows: When Z‑score < threshold, conditions often reflect forced/liquidity‑driven spending. Treat as context, not signals.
• Buy zone: SSOPR < Buy Threshold flags potential accumulation conditions (combine with price structure).
• Tops: After prolonged elevation, a confirmed top often coincides with profit‑taking/distribution phases.
Recommended timeframes
• Daily : Code optimized for daily timeframe.
Method summary
• SSOPR source: GLASSNODE:BTC_SOPR (via request.security ).
• Optional log transform: sopr → log(sopr) to normalize around 0.
• Smoothing: SMA over Smoothing Length , optionally adaptive using local volatility (std dev).
• Z‑score: (SSOPR − mean) / std dev, highlighting extreme lows.
• Top: Requires long elevation above Top Threshold , rising‑phase (A/B), and a subsequent drop > Drop % from recent high.
Limitations & notes
• SOPR reflects on‑chain movements; some activity occurs off‑chain (exchanges, internal transfers). Not all moves imply sale; aggregation makes it a usable proxy for profit/loss realization.
• Higher smoothing reduces noise but delays signals; adaptive smoothing can help but is still a trade‑off.
• Treat thresholds as context markers. They are not entry/exit signals by themselves.
• Use with price structure, volume, and other on‑chain indicators (e.g., realized price bands, dormancy/CDD) for confluence.
How to use (examples)
• Advance holding above 0 (log view): Retests of 0 from above that hold—while SSOPR remains elevated—often mark absorption; look for Top conditions only after sustained elevation and a confirmed drop from peak.
• Downtrend below 0: Rejections near 0 can align with continued loss realization; extreme Z‑score lows suggest capitulation risk—context for accumulation, not a blind buy.
Recommended settings
• Weekly: Log ON, Smoothing Length 14–30, Adaptive ON, Buy Threshold −0.02, Top Threshold +0.005, Rising Method A, Min Bars 50.
• Daily: Log ON, Smoothing Length 14–20, Adaptive OFF or ON (depending on noise), Rising Method B for timely slope checks.
Credits & references
• SOPR metric: Renato Shirakashi; documentation: Glassnode , CryptoQuant , overview: Bitbo .
Disclaimer
This script is for research/education on market behavior. It is not financial advice. Indicators provide context; decisions remain your responsibility.
Tags
bitcoin, btc, on‑chain, sopr, ssopr, glassnode, oscillator, regime, distribution, capitulation






















