Multiple Screeners with AlertsI already published few version of my custom screeners. Unfortunately, because of TradingView's security function call limit you can't use more than 40 stocks in 1 screener.
Fortunately, you can compute multiple values in your function and screen few indicators at once.
In this script I show how you can compute 5 indicators at the same time for 40 instruments. I display then in different labels.
Every label consist of list of instruments satisfying current indicator conditions and a value for it. It can be absolute value as for RSI or -1/1 representing Bullish/Bearish event.
Also you can create 1 alert with result of all screeners inside.
In this example I took 5 indicators with following conditions:
RSI - "RSI < 30" or "RSI > 70"
TSI - "TSI < -30" or "RSI >30"
ADX - "ADX > 40"
MACD - "MACD Bullish Cross" or "MACD Bearish Cross" (1 and -1 in screener)
AO - "AO Crosses 0 UP" or "AO Crosses 0 DOWN" (1 and -1 in screener)
Params
- bars_apart - this parameter define how may bars apart you labels are on your chart. If you see labels overlapping, increase this number.
- Parameters for all used indicators
- 40 symbol inputs for instruments you want to use in this screener
Alerts
You can create an alert from it easily by selecting screener name from the list and then selecting "Any alert() function call".
No additional configuration is required, message and alert on close is generated in the code.
You should better change default name for your alert. Sometimes because of big amount of inputs you might receive an error.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as good as in historical backtesting.
This post and the script don’t provide any financial advice.
In den Scripts nach "价格在30元内股票" suchen
RSI Classic Strategy (by Coinrule)One of the questions hobbyist traders more often ask is: what is the perfect trading indicator?
Every indicator is just a tool, so its efficiency is proportional to your ability to read its signals and translate them into an actionable trading strategy. The RSI is likely the most flexible and easy to use among the technical indicators.
This trading strategy tries to catch short-term swings on the coins of your choice with a simple yet profitable setup.
Buy when the RSI is lower than 30 (you can adjust it to 35 in times of steep uptrend).
Sell when the RSI is greater than 65 (the target may range between 60 and 75 depending on the volatility of the coin).
Note that the buy signal comes when the indicator crosses below 30 and not when it crosses above 30 as it happens on the built-in RSI strategy on Tradingview.
The present script overperforms the built-in strategy, even adding trading fees and using a lower amount of capital for each trade (30%). That means that the system can deliver higher net-profits with lower risk levels.
A typical example of market conditions where this strategy works perfectly is as follows.
The first initial breakout indicates that a new leg up in the trend may start. Bitcoin starts to trade within a range which you can identify when it reaches the point 3. That is the perfect time to start the rule because
- trading within a channel anticipates possible swings up and down
- the trend is on the upside, providing low downside risk in buying the dips.
This strategy works well with selected coins of your choice, and it's a great fit on leverage exchanges like Binance Futures.
If you prefer to run it across all available coins on the market, instead, you may choose an optimized version.
Multi Time Frame Buy the Dips (by Coinrule)Buying the dips is a relatively easy automated trading strategy that can return impressive profits, especially during uptrend times. Not all price drops are for buying, though. This trading system is based on a multi time frame buy-the-dip approach to optimize each trade.
The strategy catches sudden price drops on a 1-hr time frame when the price increases significantly in the last 12 hours. During steep uptrends, profit-taking price actions result in flash crashes that provide great opportunity to enter at convenient prices.
Buy Condition
The setup of the script is optimized on a 30 min time frame. You can adjust the parameters to fit different time frames.
The system gets a buy signal when
- the price drops 1% from the two previous candles (1 hour time frame = two 30-min candles)
- the price is up 3% from the last 12 hours (twenty-four 30-min candles equal the desired time frame)
Sell Condition
Each trade comes with a stop loss of 3% and a take profit of 4%.
This setup has been optimized, running over 150 backtests on more than 20 different crypto trading pairs.
The strategy assumes each order to trade 30% of the available capital. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange.
Easy Loot Golden CrossGolden/Death Cross Moving Average Indicator
30, 100 & 200 period Simple Moving Average (SMA).
30 = Yellow
100 = Green
200 = Black
Black crosses mark the 'golden crosses' as well as the 'death crosses'. These black crosses appear when the 30 crosses the 100 & when the 100 crosses the 200. These black crosses don't tell you when to buy/sell, but simply indicate interest in the market.
This code is open-source so feel free to add this indicator to your chart and play around with the different moving average timeframes & color schemes.
Golden Cross
The golden cross occurs when a short-term moving average crosses over a major long-term moving average to the upside and is interpreted by analysts and traders as signaling a definitive upward turn in a market. Basically, the short-term average trends up faster than the long-term average, until they cross.
There are three stages to a golden cross:
A downtrend that eventually ends as selling is depleted
A second stage where the shorter moving average crosses up through the longer moving average
Finally, the continuing uptrend, hopefully leading to higher prices
Death Cross
Conversely, a similar downside moving average crossover constitutes the death cross and is understood to signal a decisive downturn in a market. The death cross occurs when the short term average trends down and crosses the long-term average, basically going in the opposite direction of the golden cross.
The death cross preceded the economic downturns in 1929, 1938, 1974, and 2008.
Traders Dynamic Index(RSI) w/ Bull&Bear Control ZonesMomentum (RSI) is one of the most commonly used indicators for trading, but the vast majority of traders who use it, simply apply it as an oscillator to measure overbought and oversold conditions. However, momentum is much more complex than that and using a basic RSI fails to highlight these complexities.
What this highlights are some of the areas/zones that many people may not even know about or are unaware what the RSI can actually reveal about a particular trend.
What this indicator is showing:
Fast moving RSI (Green) - 1 period
Slow moving RSI (Red) - 9 period
Bollinger Bands
Relative Strength: 1 - 100
Bearish Control Zone: 30(Below) - 45
Bullish Control Zone: 60 - 70 (Above)
How this identifies trends:
Bear Market(Bearish Control Zone):
-Support: 20(Below) - 30
-Resistance: 55 - 65
-Momentum will test resistance but will fail to hold support at 50
Bull Market(Bullish Control Zone):
-Support: 45 - 50
-Resistance: 80 - 90(Above)
-Momentum will test support but will not continue past the 45 support
How this identifies reversals:
If a market is bullish, but loses support at 45 and tests 30, it has begun reversal. If a market is bearish, but breaks 60 and tests 70, it has begun reversal.
-A bull market reversal is confirmed if it finds resistance at 60 after testing bearish support
-A bear market reversal is confirmed if it finds support at 50 after testing bullish resistance
Slow & Fast RSI w/ Boll Bands:
-The Slow and Fast RSI crossovers will act as Intermediate trends within the Macro trend - Fast crosses slow, bullish. Slow cross fast, bearish.
-Use in confluence with the Macro trend.
-While under Bearish Control, the Slow RSI will act as resistance for the Fast RSI.
-While under Bullish Control, the Slow RSI will act as support for the Fast RSI.
-The two will have an impulsive crossover when the Macro trend reverses.
-The Bollinger Bands will act as a volatility gauge for potential approaching tests of Support & Resistances. (Expansions & Contractions)
This is an analog of TDIGM (GoldMinds)
-Added Bullish/Bearish Control Zones.
-Changed Fast RSI to Green and Slow RSI to Red.
50ema + 105emaIf price action is above the 50ema + 105ema on the 30-minute chart, be bullish.
If price action is below the 50ema + 105ema on the 30-minute chart, be bearish.
If price action is in-between buy off the lower when it acts like support and sell near the top ema which will act like resistance.
The purpose of this indicator is to show these 30-minute moving averages -- regardless of timeframe. This will only appear if you are using an intraday timeframe.
Fibonacci + RSI - StrategyStrategy: Fibonacci + RSI:
- Intraday trading strategy (Scalping).
Time Frames Tested with best Results:
30 Minutes.
5 Minutes.
15 Minutes.
1 Minute
Indicators Used:
RSI (30 / 70)
Fibonacci (1 - 0.784)
How it Works:
Once the Price Hits the 1 or -1 Fibonacci Level and bounces a little bit, It checks the RSI if Over Bought or Over Sold According to 30 - 70.
If both conditions are satisfied, it triggers a Long or Short Positions.
Further Notes:
- I have put a Stop-loss with a 2% just for further upgrades.
- Not advised to use in High Volatility Markets.
- No Repaint was observed during a 2-Weeks Tests.
If you have any suggestions or modifications please contact to add.
If you have observed any bad behavior please contact to fix.
Trade wisely.
[LunaOwl] 智慧型RSI (Smart RSI - a handy tool with less noise)Relative Strength Index is a common technical analysis tool, it is classified as a momentum oscillator, measuring the velocity and magnitude of directional price movements. it is most typically used on a 14-period timeframe, measured on a scale from 0 to 100, with high and low levels marked at 70 and 30.
相對強弱指標是常見的技術分析工具,它被歸類為動量振盪器,用於測量定向價格運動的速度和幅度,通常會使用14期數,擺盪範圍在0到100間,超買超賣分別標記成70、30。
after simple improvement and addition of logical judgment, it becomes a passive judge from subjective judgments, avoid the shortcomings of peoples in watching passivation, and the trade can be more consistent.
經過簡單的改良與添加邏輯判斷,能夠使RSI指標的使用,從主觀的判斷成為被動的確認指標,有效避免人們判斷指標鈍化的主觀缺失,並能夠使得交易更加一致。
--------------------------*
1) parameter
RSI period 1 - default is 14, same as general RSI.
RSI period 2 - default is 5, due to its own formula, the amplitude of the oscillator will become larger and more agile or fast. When the parameter is small.
exponential moving avg of RSI - using the result of RSI period 1 as the source of Ema's formula, the default length is 14, which can filter the excessive agility of RSI period 2 to reduce noise, and compared to using the baseline as the criterion for long and short judgments, The characteristics of exponential moving avg are more suitable to become flexible filtering standards.
Overbought - default is 70, you can set your overbought level.
Oversold - same as above, the default is 30.
2) Options
Open Candle color(開啟蠟燭線趨勢) - choose whether to start the color of the candle.
Open background color(開啟指標背景色) - the default is false, you can turn on.
--------------------------*
1. 設置參數
RSI期數1:預設值是14,是普通的RSI指標。
RSI期數2:預設值是5,由於RSI公式的算法,造成參數愈小擺盪幅度就會變大,反應比較快。
指數平均化的RSI期數1:將RSI期數1的結果帶入指數移動平均公式,預設值14,它能過濾RSI期數2過度敏捷的缺點,減少雜訊,相較於單純使用基準線作為多空判斷標準,用EMA的判斷標準更加因時制宜。
超買線:預設值是70,可以隨意調。
超賣線:預設值是30,一樣的。
2. 設定選項
開啟蠟燭線趨勢:顧名思義。已經幫您開好了。
開啟指標背景色:顏色太淺的話可以調深一點。
--------------------------*
ver.2- adjust new style design and create two options.
修改2: 調整新的樣式設計與建立兩個選項。
--------------------------*
ver.3- Create alert condition. maybe I should refer to the Alert Creation Framework,
there is also room for improvement.
修改3: 建立快訊選項。我應該參考警報創建框架,還有進步空間。
--------------------------*
Indicator Style - 指標樣式
The design uses casual light color style, light gray between overbought and oversold.
--------------------------*
Market Example - 市場範例
1. Bitcoin/Tether, Binance, 1 day
2. Bitcoin/USD, Coinbase, 4 hour
3. EUR/USD, Forex Market, 4 hour
4. GBP/USD, Forex Market, 30 min
5. TAIEX, Taiwan SE Weighted Index, 1 week
--------------------------*
postscript - 後記感想
The purpose of publishing Chinese Scripts is to make Pine close to more Chinese user.
I hope English skills enhancement...staggered writing makes me feel hard.
發布中文腳本的目的,是希望可以讓 Pine 親近更多中文圈的使用者。希望我的英語進步,中英文交錯撰寫有一些困難。
--------------------------*
If you find my works useful, you can give me encouragement. I can buy more books to sophisticated themselves.
如果您發現我的作品有用,可以給我鼓勵。讓我可以買更多書籍來精進自己。
MacD (Future Known or Unknown) StrategyThis indicator/strategy is to be used as a way to baseline the top potential any strategy could have with other strategies and indicators.
What I have created literally shows the BEST moves possible you could have made in my opinion for SHORTING or LONGING using only the MacD values of the 4 hour while on the 30 minute chart.
To use this, try checking out XBTUSD on the 30 minute chart . It will work under different time frames but works best on the 30 minute chart in my opinion. It WILL NOT WORK Above 2 hours time frame.
DO NOT TRADE WITH THIS indicator . I can't emphasize this enough. These results only work because of the lookahead_on parameter. A lot of scam indicators and strategies use this to trick people on tradingView into buying their scripts.
This code is OPEN SOURCE and as such there is nothing to hide and no scam!
I like to use this as a comparison tool for how good I 'could' have traded and at what points those were. By knowing where the perfect trading positions are, you can create real indicators and scripts that try to find patterns in those positions.
This also shows that IF you could know the direction the MacD was going what amazing results you could get ^_~.
This is meant purely for entertainment purposes and for comparing against your own scripts.
I've included the options in the settings to allow ONLY LONG or ONLY SHORTS. By default it attempts both buy attempts. You can also change your starting ($) amount and commission percentage that is taken per trade as well.
Also included in the options is the ability to set the back testing time frame to see how it performs during just certain time periods.
Finally a color explanation
Red - MacD 4 hour going down
Green - MacD 4 hour going up
Purple - MacD 4 hour going down (from an up position)
Yellow - MacD 4 hour going up (from a down position)
Notice the program will always buy right before it turns into a yellow color since it knows the future.
In the options you can turn off 'use the future' to see the horrible results if you trade the moment you know which direction the MacD 4 hour is actually going. I will revise this script in the future with attempts to work without knowing the future as play options to get better results.
If you have any questions or comments, please do not hesitate to ask!
(JS)DMI BarsAlright - so this is my own version of John Carter's "10x Bars"... I have done multiple things that are different from his version so they are slightly different..
So first of all the main indicator is based off of the ADX and the DMI;
For those who aren't familiar with it, Directional Movement is what you'd pull up under "built-in's" from the indicators tab (if you want to check it out).
The standard interpretation of this however, is when the ADX is above 20 that suggests the trend is strong, whereas under 20 suggests it is weak.
Also, when the D+ is above the D- that suggests a bullish trend, and D- above D+ suggests a bearish trend.
These bars take away the need to have it at the bottom of your screen, and places the data on the bars on your chart instead.
=========================================================================================================================================
So here's what the colors stand for -
Yellow - The ADX is under 20, no strength in trend
Shades of green occur when the ADX is above 20 and there's a bullish trend (D+ higher than D-)
Bright Green (Lime) - Bullish trend, D+ above 30
Green - Bullish Trend
Yellow Green - Bullish trend, D+ below 15
Shades of red occur when the ADX is above 20 and there's a bearish trend (D- higher than D+)
Bright Red - Bearish trend, D- above 30
Red - Bearish Trend
Orange - Bearish trend, D- below 15
=========================================================================================================================================
I have also added multiple time frame labels (label script used is the one created by Ricardo Santos)
These labels are color coded the same as the bars/candles, and they appear off to the right of your screen using every built in time increment from TradingView.
The purpose is to show you in real time, and on any chart resolution, what the current trend is on every individual time frame.
So using just one single chart you'll see your current resolutions candles, but also on the labels you'll see:
1 Minute
3 Minute
5 Minute
15 Minute
30 Minute
45 Minute
1 Hour
2 Hour
3 Hour
4 Hour
Daily
Weekly
Monthly
There is an input I added that allows you to adjust where your labels appear on the side of your screen as well!
=========================================================================================================================================
Now onto the volume spike portion of the indicator. This will plot a blue dot under each bar that has a spike in volume which meets your specified criteria.
I have 500% as the default setting.
What that means is that this indicator looks back and gets the 50 bar volume average and then applies dots where volume is 500% above average.
=========================================================================================================================================
Now finally, the reversal arrows. This is another simple to understand concept that I first read in John Carter's book "Mastering the Trade" that he calls "HOLP/LOHP".
I have added the ability to change the look back period you'd like the indicator to watch for highs and lows on.
What that stands for is 'High of Low Period' and 'Low of High Period', and it is used like this-
Whenever a bar makes a new high the indicator watches the low on that highest bar. Then when a bar afterwards makes a lower low then the one on the high bar,
a reversal arrow is given. Apply this same concept in the other direction in for the highs on the lowest bars.
=========================================================================================================================================
Now, I didn't want to make a "set" or have a bunch of different indicators out there that are all intended for the same package, so I took the time to put them together,
and if there's a part of it you don't care for they can easily be turned off in the settings.
Enjoy!
ADX +- DiThis Adx +-Di is just a complete version of what the ADX is supposed to signal.
So you have:
15 (contraction), 20 (threshold), 30 (expansion), 40 (resistance) levels.
Below 20 the price is not trending
Above 30 the price is trending
Below 15 price has been in contraction for too long
Between 20 and 30 price is in a "transition zone".
I finally added a "Resistance" level (40), which has to be adapted to best represent the historical levels where price usually encounters resistance, and where the price can be declared "overtrending", which means a return to lower levels is likely to happen.
I've chosen mild colors, and set the Adx Color to White, because I use black background, you can easily change that.
Enjoy
-Maurice
ICHIMOKU MTFMultiple Time Frame Version of Ichimoku Kinko Hyo Indicator.
Created in 1940's by Goichi Hosoda withe the help of University students in Japan.
Ichimoku is one of the best trend following indicators that works nearly perfect in all markets and time frames.
Ichimoku is originally an built in indicator in Tradingview but there are some problems like:
the indicator hast 5 lines but you can change only 4 parameters in the settings menu of Tradingview Charts which you could only control 3 of the lines effectively. A second problem is that Tradingview preferred to use English titles for the ICHIMOKU lines instead of giving them the most common original Japanese ones. (So I rewrite the indicator)
Kijun Sen (blue line): Also called standard line or base line, this is calculated by averaging the highest high and the lowest low for the past 26 periods.
Tenkan Sen (red line): This is also known as the turning line and is derived by averaging the highest high and the lowest low for the past nine periods.
Chikou Span (Plum line): This is called the lagging line. It is today’s closing price plotted 26 periods behind.
Senkou SpanA (green line): The first Senkou line is calculated by averaging the Tenkan Sen and the Kijun Sen and plotted 26 periods ahead.
Senkou SpanB (purple line):
The second Senkou line is determined by averaging the highest high and the lowest low for the past 52 periods and plotted 26 periods ahead.
PERSONALLY I ADVISE YOU TO USE ICHIMOKU WITH DEAFULT LENGTHS (9,26,26,52,26) IN ORDER FOR STOCK MARKETS AND FOREX MARKETS
FOR CRYPTO YOU'D BETTER USE:
10,30,30,60,30 OR 20,60,60,120,60
THE TRICKY THING IS THAT KEEPING THE 1-3-3-6-3 RATIO CONSTANT IS NECESSARY
Here's a link of my Youtube video explaining ICHIMOKU but unfortunately only in TURKISH:
www.youtube.com
Developed by: Goichi Hosoda
Here's the link to a complete list of all my indicators:
tr.tradingview.com
Ichimoku kullanımı anlattığım detaylı video serisini linkten izleyebilirsiniz:
www.youtube.com
İndikatörü geliştiren: Goichi Hosoda
ICHIMOKU Kinko Hyo by KIVANC fr3762Created in 1940's by Goichi Hosoda withe the help of University students in Japan.
Ichimoku is one of the best trend following indicators that works nearly perfect in all markets and time frames.
Ichimoku is originally an built in indicator in Tradingview but there are some problems like:
the indicator hast 5 lines but you can change only 4 parameters in the settings menu of Tradingview Charts which you could only control 3 of the lines effectively. A second problem is that Tradingview preferred to use English titles for the ICHIMOKU lines instead of giving them the most common original Japanese ones. (So I rewrite the indicator)
Kijun Sen (blue line): Also called standard line or base line, this is calculated by averaging the highest high and the lowest low for the past 26 periods.
Tenkan Sen (red line): This is also known as the turning line and is derived by averaging the highest high and the lowest low for the past nine periods.
Chikou Span (Plum line): This is called the lagging line. It is today’s closing price plotted 26 periods behind.
Senkou SpanA (green line): The first Senkou line is calculated by averaging the Tenkan Sen and the Kijun Sen and plotted 26 periods ahead.
Senkou SpanB (purple line):
The second Senkou line is determined by averaging the highest high and the lowest low for the past 52 periods and plotted 26 periods ahead.
PERSONALLY I ADVISE YOU TO USE ICHIMOKU WITH DEAFULT LENGTHS (9,26,26,52,26) IN ORDER FOR STOCK MARKETS AND FOREX MARKETS
FOR CRYPTO YOU'D BETTER USE:
10,30,30,60,30 OR 20,60,60,120,60
THE TRICKY THING IS THAT KEEPING THE 1-3-3-6-3 RATIO CONSTANT IS NECESSARY
Here's a link of my Youtube video explaining ICHIMOKU but unfortunately only in TURKISH:
www.youtube.com
Developed by: Goichi Hosoda
RSI Multi-TimeframeThe Relative Strength Index (RSI) is an extremely useful oscillating momentum indicator that was developed by J. Welles Wilder and is one of the most widely used indicators in technical analysis.
HOW IS IT USED ?
In the classic view, a security is thought to be overbought when its RSI reading is above 70 and oversold when its RSI reading falls below 30. This makes it a good indicator for mean-reversion systems. Wilder recommended using the 70 and 30 levels as overbought and oversold levels respectively. When the RSI moves up over the 30 line it is considered a possible bullish reversal while a move down below the 70 line is considered a possible bearish reversal.
When the RSI is above 70 it is a potential exit signal if you are in a long position and when it is below 30 it is a potential exit signal if you are in a short position. Some traders use extreme readings for entry points in the direction of the long-term trend. Thus, if the long-term trend is bullish, then you'd wait for the RSI to reach oversold territory, which would be a potential entry point for a long position. Conversely, if the long-term trend is bearish, then overbought conditions could be a potential point to short the security.
I added the possibility to add on the chart a 2nd timeframe for confirmation.
If you found this script useful, a tip is always welcome... :)
Ichimoku Cloud w/SelIchimoku Cloud with selection for:
Regular:
conversionPeriods = 9,
basePeriods = 26
laggingSpan2Periods = 52,
displacement = 26
Crypto:
conversionPeriods = 10,
basePeriods = 30,
laggingSpan2Periods = 60,
displacement = 30
Crypto Doubled:
conversionPeriods = 20,
basePeriods = 60,
laggingSpan2Periods = 120,
displacement = 30
CM_Ultimate RSI Multi Time FrameAvailable Options on Inputs Tab!!!
RSI with ability to change first RSI to a different Time Frame.(Defaults To Current Chart Time Frame).
Ability To Turn On/Off Background Highlighting if First RSI is Above/Below 70 or 30 Lines.
Ability To Turn On/Off Background Highlighting When First RSI Crosses Above 30 Or Below 70.
Ability To Turn On/Off "B" Or "S" When First RSI Crosses Above 30 Or Below 70.
Ability To Turn On/Off Mid -Line Plot.
Option To Plot 2nd RSI to show different Time Frames on same chart!!!
Ability To Use Different Look Back Period If You Plot 2nd RSI.
Opening Range Breakout with 2 Profit Targets.Opening Range Breakout with 2 Profit Targets.
Updated Indicator now works on all Symbols with Many Different Session Options.
***Known PineScript Issue…While the Opening Range is being Formed the lines only adjust for that individual bar. Just reset Indicator after Opening Range Completes.
***All Times are Based on New York Time
Session Options Forex U.S. Banks Open (8:00), Gold U.S. Open (8:20), Oil U.S. Open (9:00), U.S. Cash Session - Stocks (9:30), NY Forex Open (17:00) , Europe Open (02:00), or if you choose Setting 0 the Session Runs from 00:00 to 00:00 (Midnight to Midnight).
***Ability to use 60 minute Opening Range, 30 minute, 15 minute, and many other options.
***However you can manually change the times in the Inputs Tab to adjust for any session you prefer. This is useful for Day Light Savings Adjustments. Also the default times work if your charts are set to EST Time. If you use A different time zone in your settings you need to Adjust the times in the inputs tab.
Initially Opening Range High and Low plot as Yellow Lines. If Price Goes Above Opening Range then Line Turns Green. If Price Goes Below Opening Range Line Turns Red.
By default the First Profit Target is 1/2 the Width of the Opening Range and the 2nd Profit Target is 1 Times the Opening Range. However these are Adjustable in the Inputs Tab.
By Default the Opening Range Length is 1 Hour. However, you can Change the Opening Range Length to 15 min, 30 min, 2 hours etc. in the Inputs Tab.
Plots a 1 Above or Below Candle when 1st Profit Target is Achieved, and a 2 when 2nd Profit Target is Achieved.
ULTIMATE ORDER FLOW SYSTEM🔥 ULTIMATE ORDER FLOW SYSTEM
Overview
This comprehensive order flow analysis tool combines **Volume Profile**, **Cumulative Delta**, and **Large Order Detection** to identify high-probability trading setups. The script analyzes institutional order flow patterns and volume distribution to pinpoint key levels where price is likely to react.
📊 Core Components & Methodology
🔥 ULTIMATE ORDER FLOW SYSTEM
Overview
This comprehensive order flow analysis tool combines Volume Profile, Cumulative Delta, and Large Order Detection to identify high-probability trading setups. The script analyzes institutional order flow patterns and volume distribution to pinpoint key levels where price is likely to react.
________________________________________
📊 Core Components & Methodology
1. Volume Profile Analysis
The script constructs a horizontal volume profile by:
• Dividing the price range into configurable rows (default: 20)
• Accumulating volume at each price level over a lookback period (default: 50 bars)
• Separating buy volume (green bars close > open) from sell volume (red bars)
• Identifying three critical levels:
o POC (Point of Control): Price level with highest traded volume - acts as a strong magnet
o VAH/VAL (Value Area High/Low): Contains 70% of total volume - defines fair value zone
o HVN (High Volume Nodes): Resistance zones where institutions accumulated positions
o LVN (Low Volume Nodes): Thin zones that price moves through quickly - ideal targets
Why This Matters: Institutional traders leave footprints through volume. HVN zones show where large players defended levels, making them reliable support/resistance.
________________________________________
2. Cumulative Delta (Order Flow)
Tracks the running total of buying vs selling pressure:
• Bar Delta: Difference between buy and sell volume per candle
• Cumulative Delta: Sum of all bar deltas - shows net directional pressure
• Delta Moving Average: Smoothed delta (20-period) to identify trend
• Delta Divergences:
o Bullish: Price makes lower low, but delta makes higher low (absorption at bottom)
o Bearish: Price makes higher high, but delta makes lower high (exhaustion at top)
How It Works: When cumulative delta trends up while price consolidates, it signals accumulation. Delta divergences reveal when smart money is positioned opposite to retail expectations.
________________________________________
3. Large Order Detection
Identifies institutional-sized orders in real-time:
• Compares current bar volume to 20-period moving average
• Flags orders exceeding 2.5x average volume (configurable multiplier)
• Distinguishes bullish (green circles below) vs bearish (red circles above) large orders
Rationale: Sudden volume spikes at key levels indicate institutional participation - the "fuel" needed for breakouts or reversals.
________________________________________
🎯 Trading Signal Logic
Combined Setup Criteria
The script generates SHORT and LONG signals when multiple conditions align:
SHORT Signal Requirements:
1. Price reaches an HVN resistance zone (within 0.2%)
2. Large sell order detected (volume spike + red candle)
3. Cumulative delta is bearish OR bearish divergence present
4. 10-bar cooldown between signals (prevents overtrading)
LONG Signal Requirements:
1. Price reaches an HVN support zone
2. Large buy order detected (volume spike + green candle)
3. Cumulative delta is bullish OR bullish divergence present
4. 10-bar cooldown enforced
________________________________________
🔧 Customization Options
Setting - Purpose - Recommendation
Volume Profile Rows - Granularity of level detection - 20 (balanced)
Lookback Period - Historical data analyzed - 50 bars (intraday), 200 (swing)
Large Order Multiplier - Sensitivity to volume spikes - 2.5x (standard), 3.5x (conservative)
HVN Threshold - Resistance zone detection - 1.3 (default)
LVN Threshold - Target zone identification - 0.6 (default)
Divergence Lookback - Pivot detection period - 5 bars (responsive)
________________________________________
📈 Dashboard Indicators
The real-time panel displays:
• POC: Current Point of Control price
• Location: Whether price is at HVN resistance
• Orders: Current large buy/sell activity
• Cumulative Δ: Net order flow value + trend direction
• Divergence: Active bullish/bearish divergences
• Bar Strength: % of candle volume that's directional (>65% = strong)
• SETUP: Current trade signal (LONG/SHORT/WAIT)
________________________________________
🎨 Visual System
• Yellow POC Line: Highest volume level - primary pivot
• Blue Value Area Box: Fair value zone (VAH to VAL)
• Red HVN Zones: Resistance/support from institutional accumulation
• Green LVN Zones: Low-liquidity targets for quick moves
• Volume Bars: Green (buy pressure) vs Red (sell pressure) distribution
• Triangles: LONG (green up) and SHORT (red down) entry signals
• Diamonds: Divergence warnings (cyan=bullish, fuchsia=bearish)
________________________________________
💡 How This Script Is Unique
Unlike standalone volume profile or delta indicators, this script:
1. Synthesizes three complementary methods - volume structure, order flow momentum, and liquidity detection
2. Requires multi-factor confirmation - signals only trigger when price, volume, and delta align at key zones
3. Adapts to market regime - delta filters ensure you're trading with the dominant order flow direction
4. Provides context, not just signals - the dashboard helps you understand why a setup is forming
________________________________________
⚙️ Best Practices
Timeframes:
• 5-15 min: Scalping (use 30-50 bar lookback)
• 1-4 hour: Swing trading (use 100-200 bar lookback)
Risk Management:
• Enter on signal candle close
• Stop loss: Beyond nearest HVN/LVN zone
• Target 1: Next LVN level
• Target 2: Opposite value area boundary
Filters:
• Avoid signals during major news events
• Require bar delta strength >65% for aggressive entries
• Wait for delta MA cross confirmation in ranging markets
________________________________________
🚨 Alerts Available
• Long Setup Trigger
• Short Setup Trigger
• Bullish/Bearish Divergence Detection
• Large Buy/Sell Order Execution
________________________________________
📚 Educational Context
This methodology is based on principles used by professional order flow traders:
• Market Profile Theory: Volume distribution reveals fair value
• Tape Reading: Large orders show institutional intent
• Auction Theory: Price seeks areas of liquidity imbalance (LVN zones)
The script automates pattern recognition that discretionary traders spend years learning to identify manually.
________________________________________
⚠️ Disclaimer
This indicator is a trading tool, not a trading system. It identifies high-probability setups based on order flow analysis but requires proper risk management, market context, and trader discretion. Past performance does not guarantee future results.
________________________________________
Version: 6 (Pine Script)
Type: Overlay + Separate Pane (Delta Panel)
Resource Usage: Moderate (500 bars history, 500 lines/boxes)
________________________________________
For questions or support, please comment below. If you find this script valuable, please boost and favorite! 🚀
1. Volume Profile Analysis
The script constructs a horizontal volume profile by:
- Dividing the price range into configurable rows (default: 20)
- Accumulating volume at each price level over a lookback period (default: 50 bars)
- Separating buy volume (green bars close > open) from sell volume (red bars)
- Identifying three critical levels:
- POC (Point of Control): Price level with highest traded volume - acts as a strong magnet
- VAH/VAL (Value Area High/Low): Contains 70% of total volume - defines fair value zone
- HVN (High Volume Nodes): Resistance zones where institutions accumulated positions
- LVN (Low Volume Nodes): Thin zones that price moves through quickly - ideal targets
Why This Matters: Institutional traders leave footprints through volume. HVN zones show where large players defended levels, making them reliable support/resistance.
---
2. Cumulative Delta (Order Flow)
Tracks the running total of buying vs selling pressure:
- **Bar Delta**: Difference between buy and sell volume per candle
- **Cumulative Delta**: Sum of all bar deltas - shows net directional pressure
- **Delta Moving Average**: Smoothed delta (20-period) to identify trend
- **Delta Divergences**:
- **Bullish**: Price makes lower low, but delta makes higher low (absorption at bottom)
- **Bearish**: Price makes higher high, but delta makes lower high (exhaustion at top)
**How It Works**: When cumulative delta trends up while price consolidates, it signals accumulation. Delta divergences reveal when smart money is positioned opposite to retail expectations.
---
### 3. **Large Order Detection**
Identifies **institutional-sized orders** in real-time:
- Compares current bar volume to 20-period moving average
- Flags orders exceeding 2.5x average volume (configurable multiplier)
- Distinguishes bullish (green circles below) vs bearish (red circles above) large orders
**Rationale**: Sudden volume spikes at key levels indicate institutional participation - the "fuel" needed for breakouts or reversals.
---
## 🎯 Trading Signal Logic
### Combined Setup Criteria
The script generates **SHORT** and **LONG** signals when multiple conditions align:
**SHORT Signal Requirements:**
1. Price reaches an HVN resistance zone (within 0.2%)
2. Large sell order detected (volume spike + red candle)
3. Cumulative delta is bearish OR bearish divergence present
4. 10-bar cooldown between signals (prevents overtrading)
**LONG Signal Requirements:**
1. Price reaches an HVN support zone
2. Large buy order detected (volume spike + green candle)
3. Cumulative delta is bullish OR bullish divergence present
4. 10-bar cooldown enforced
---
## 🔧 Customization Options
| Setting | Purpose | Recommendation |
|---------|---------|----------------|
| **Volume Profile Rows** | Granularity of level detection | 20 (balanced) |
| **Lookback Period** | Historical data analyzed | 50 bars (intraday), 200 (swing) |
| **Large Order Multiplier** | Sensitivity to volume spikes | 2.5x (standard), 3.5x (conservative) |
| **HVN Threshold** | Resistance zone detection | 1.3 (default) |
| **LVN Threshold** | Target zone identification | 0.6 (default) |
| **Divergence Lookback** | Pivot detection period | 5 bars (responsive) |
---
## 📈 Dashboard Indicators
The real-time panel displays:
- **POC**: Current Point of Control price
- **Location**: Whether price is at HVN resistance
- **Orders**: Current large buy/sell activity
- **Cumulative Δ**: Net order flow value + trend direction
- **Divergence**: Active bullish/bearish divergences
- **Bar Strength**: % of candle volume that's directional (>65% = strong)
- **SETUP**: Current trade signal (LONG/SHORT/WAIT)
---
## 🎨 Visual System
- **Yellow POC Line**: Highest volume level - primary pivot
- **Blue Value Area Box**: Fair value zone (VAH to VAL)
- **Red HVN Zones**: Resistance/support from institutional accumulation
- **Green LVN Zones**: Low-liquidity targets for quick moves
- **Volume Bars**: Green (buy pressure) vs Red (sell pressure) distribution
- **Triangles**: LONG (green up) and SHORT (red down) entry signals
- **Diamonds**: Divergence warnings (cyan=bullish, fuchsia=bearish)
---
## 💡 How This Script Is Unique
Unlike standalone volume profile or delta indicators, this script:
1. **Synthesizes three complementary methods** - volume structure, order flow momentum, and liquidity detection
2. **Requires multi-factor confirmation** - signals only trigger when price, volume, and delta align at key zones
3. **Adapts to market regime** - delta filters ensure you're trading with the dominant order flow direction
4. **Provides context, not just signals** - the dashboard helps you understand *why* a setup is forming
---
## ⚙️ Best Practices
**Timeframes:**
- 5-15 min: Scalping (use 30-50 bar lookback)
- 1-4 hour: Swing trading (use 100-200 bar lookback)
**Risk Management:**
- Enter on signal candle close
- Stop loss: Beyond nearest HVN/LVN zone
- Target 1: Next LVN level
- Target 2: Opposite value area boundary
**Filters:**
- Avoid signals during major news events
- Require bar delta strength >65% for aggressive entries
- Wait for delta MA cross confirmation in ranging markets
---
## 🚨 Alerts Available
- Long Setup Trigger
- Short Setup Trigger
- Bullish/Bearish Divergence Detection
- Large Buy/Sell Order Execution
---
## 📚 Educational Context
This methodology is based on principles used by professional order flow traders:
- **Market Profile Theory**: Volume distribution reveals fair value
- **Tape Reading**: Large orders show institutional intent
- **Auction Theory**: Price seeks areas of liquidity imbalance (LVN zones)
The script automates pattern recognition that discretionary traders spend years learning to identify manually.
---
## ⚠️ Disclaimer
This indicator is a **trading tool, not a trading system**. It identifies high-probability setups based on order flow analysis but requires proper risk management, market context, and trader discretion. Past performance does not guarantee future results.
---
**Version**: 6 (Pine Script)
**Type**: Overlay + Separate Pane (Delta Panel)
**Resource Usage**: Moderate (500 bars history, 500 lines/boxes)
---
*For questions or support, please comment below. If you find this script valuable, please boost and favorite!* 🚀
Stochastic Average (2 TFs)“Stoch (2 TFs)” plots two separate Stochastic oscillators from two different timeframes in a single pane and adds an average line of all four values (%K and %D from each timeframe). It is designed to quickly compare short-term vs higher-timeframe momentum and see whether they are aligned or diverging.
The script is an overlay-off oscillator, so it appears in its own window under the price chart.
How it works
The indicator calculates a classic Stochastic (%K and %D) on two user-selectable timeframes:
tf1 (default 30 minutes)
tf2 (default 60 minutes)
For each timeframe it:
Requests the high, low and close series from that timeframe using request.security.
Computes %K as the smoothed position of the close within the lookback high/low range.
Computes %D as a moving average of %K.
So you get four lines in total:
K1 and D1 from timeframe 1
K2 and D2 from timeframe 2
A small table in the top-right of the pane shows which timeframes are currently selected for TF1 and TF2, so you always know what you are looking at even if you change the chart timeframe.
Inputs
%K Length – lookback period used to find highest high and lowest low.
%K Smoothing – smoothing length for the %K line.
%D Smoothing – smoothing length for the %D line.
30 (tf1) – first Stochastic timeframe (default 30m).
%K Color (1) / %D Color (1) – colors for K1 and D1.
60 (tf2) – second Stochastic timeframe (default 60m).
%K Color (2) / %D Color (2) – colors for K2 and D2.
Average Color – color for the current bar average line.
Average Prev Color – color for the previous-bar average line.
You can put this indicator on any chart timeframe; the internals always use the two selected timeframes via request.security.
Visual elements
The pane shows:
Four Stochastic lines:
K1 and D1 (for tf1), K2 and D2 (for tf2), using the input colors.
Three horizontal reference levels:
80 (upper band), 50 (middle), 20 (lower band).
A light blue background band between 80 and 20 to make the overbought/oversold zone easier to see visually.
A 2-cell table in the top-right with the current values of tf1 and tf2.
These elements make it easy to see when each timeframe is overbought, oversold, or in the middle zone, and whether the two timeframes are synchronized or showing divergence.
Average and previous-average lines
At the bottom of the script there is a simple composite measure:
Sum KD adds K1 + D1 + K2 + D2 and divides by 4.
Prev Sum KD does the same for the previous bar ( ).
Both are plotted as separate lines:
Sum KD – current bar average of all four Stochastic values (main composite).
Prev Sum KD – previous bar average (for comparison).
This makes it easy to see whether overall multi-timeframe Stochastic momentum is increasing or decreasing from bar to bar without having to visually average four separate curves.
How to use
Typical uses:
See short- vs higher-timeframe Stochastic at a glance and trade only when they agree.
Look for divergence between TF1 and TF2 (e.g., lower timeframe overbought while higher timeframe still neutral).
Use the average lines (Sum KD and Prev Sum KD) as a simple “multi-TF momentum gauge” for confirmations or filters.
SMI 30m With Built-in Divergence AlertsStochastic Momentum Index SMI 30m is a simplified, single-timeframe Stochastic Momentum Index (SMI) designed for traders who want a clean momentum oscillator with clear crossover signals and automatic higher-timeframe filtering.
This version is locked to a 30-minute timeframe, making it consistent across any chart you place it on.
The script plots:
SMI Blue Line – the main momentum line
SMI Orange Line – the signal line (EMA-smoothed)
Overbought / Oversold regions
Optional colored background zones that highlight strong momentum extremes
Both the Blue and Orange plots are fully exposed, allowing users to manually create TradingView alerts for crossovers.
Additionally, the script includes two built-in alert conditions for traders who prefer automatic signals.
How the SMI is calculated
This script uses a double-EMA smoothing method to stabilize momentum:
Highest and lowest price ranges are calculated over the selected %K period.
Relative position of price inside that range is computed.
A double EMA is applied to both the range and the midpoint offset.
The SMI result is scaled to ±200 for clarity.
The Signal Line is a single-EMA applied to the SMI.
These parameters can be adjusted:
%K Length
%D Length
EMA Length
The default values match traditional 13-3-3 SMI settings.
Visual Components
1. SMI Blue Line
Represents the primary momentum movement.
Values above 40 indicate positive momentum; values below −40 indicate negative momentum.
2. SMI Orange Line
Acts as a smoothing signal line.
Crossovers between Blue and Orange often indicate momentum shifts.
3. Overbought / Oversold Zones
+40 = overbought boundary
−40 = oversold boundary
These levels help identify exhaustion points.
4. Gradient High/Low Zones
The script includes colored fill zones above +40 and below −40 to visually highlight extreme momentum regions.
Built-In Alerts
The indicator includes two pre-configured alert conditions:
1. Bearish Cross (Overbought)
Triggers when:
The Blue SMI crosses below the Orange SMI
AND the Blue SMI value is above 80
This represents a potential bearish divergence or momentum reversal from extreme highs.
Alert title:
SMI Bearish Cross
2. Bullish Cross (Oversold)
Triggers when:
The Blue SMI crosses above the Orange SMI
AND the Blue SMI value is below −80
This represents a potential bullish divergence or reversal from extreme lows.
Alert title:
SMI Bullish Cross
How to Use Alerts
After adding the indicator to your chart:
Open the Alerts panel
Select Condition → SMI (1 TF) 30m
Choose either:
SMI Bearish Cross
SMI Bullish Cross
Set your preferred trigger method:
Once per bar close
Once per bar
Once per minute
Create the alert
Traders can also manually create alerts for:
Blue crossing above Orange
Blue crossing below Orange
Because both plots are fully exposed.
Purpose
This indicator is intended for traders who want a stable, single-timeframe SMI with:
Clear structure
Extreme-zone highlighting
Exposed plots for custom alerts
Built-in reversal alerts
Consistent 30-minute TF regardless of chart
It can be used for:
Identifying trend reversals
Detecting momentum exhaustion
Confirming entries/exits
Spotting early divergence signals
Stochastic Hash Strat [Hash Capital Research]# Stochastic Hash Strategy by Hash Capital Research
## 🎯 What Is This Strategy?
The **Stochastic Slow Strategy** is a momentum-based trading system that identifies oversold and overbought market conditions to capture mean-reversion opportunities. Think of it as a "buy low, sell high" approach with smart mathematical filters that remove emotion from your trading decisions.
Unlike fast-moving indicators that generate excessive noise, this strategy uses **smoothed stochastic oscillators** to identify only the highest-probability setups when momentum truly shifts.
---
## 💡 Why This Strategy Works
Most traders fail because they:
- **Chase prices** after big moves (buying high, selling low)
- **Overtrade** in choppy, directionless markets
- **Exit too early** or hold losses too long
This strategy solves all three problems:
1. **Entry Discipline**: Only trades when the stochastic oscillator crosses in extreme zones (oversold for longs, overbought for shorts)
2. **Cooldown Filter**: Prevents revenge trading by forcing a waiting period after each trade
3. **Fixed Risk/Reward**: Pre-defined stop-loss and take-profit levels ensure consistent risk management
**The Math Behind It**: The stochastic oscillator measures where the current price sits relative to its recent high-low range. When it's below 25, the market is oversold (time to buy). When above 70, it's overbought (time to sell). The crossover with its moving average confirms momentum is shifting.
---
## 📊 Best Markets & Timeframes
### ⭐ OPTIMAL PERFORMANCE:
**Crude Oil (WTI) - 12H Timeframe**
- **Why it works**: Oil markets have predictable volatility patterns and respect technical levels
**AAVE/USD - 4H to 12H Timeframe**
- **Why it works**: DeFi tokens exhibit strong momentum cycles with clear extremes
### ✅ Also Works Well On:
- **BTC/USD** (12H, Daily) - Lower frequency but high win rate
- **ETH/USD** (8H, 12H) - Balanced volatility and liquidity
- **Gold (XAU/USD)** (Daily) - Classic mean-reversion asset
- **EUR/USD** (4H, 8H) - Lower volatility, requires patience
### ❌ Avoid Using On:
- Timeframes below 4H (too much noise)
- Low-liquidity altcoins (wide spreads kill performance)
- Strongly trending markets without pullbacks (Bitcoin in 2021)
- News-driven instruments during major events
---
## 🎛️ Understanding The Settings
### Core Stochastic Parameters
**Stochastic Length (Default: 16)**
- Controls the lookback period for price comparison
- Lower = faster reactions, more signals (10-14 for volatile markets)
- Higher = smoother signals, fewer trades (16-21 for stable markets)
- **Pro tip**: Use 10 for crypto 4H, 16 for commodities 12H
**Overbought Level (Default: 70)**
- Threshold for short entries
- Lower values (65-70) = more trades, earlier entries
- Higher values (75-80) = fewer but higher-conviction trades
- **Sweet spot**: 70 works for most assets
**Oversold Level (Default: 25)**
- Threshold for long entries
- Higher values (25-30) = more trades, earlier entries
- Lower values (15-20) = fewer but stronger bounce setups
- **Sweet spot**: 20-25 depending on market conditions
**Smooth K & Smooth D (Default: 7 & 3)**
- Additional smoothing to filter out whipsaws
- K=7 makes the indicator slower and more reliable
- D=3 is the signal line that confirms the trend
- **Don't change these unless you know what you're doing**
---
### Risk Management
**Stop Loss % (Default: 2.2%)**
- Automatically exits losing trades
- Should be 1.5x to 2x your average market volatility
- Too tight = death by a thousand cuts
- Too wide = uncontrolled losses
- **Calibration**: Check ATR indicator and set SL slightly above it
**Take Profit % (Default: 7%)**
- Automatically exits winning trades
- Should be 2.5x to 3x your stop loss (reward-to-risk ratio)
- This default gives 7% / 2.2% = 3.18:1 R:R
- **The golden rule**: Never have R:R below 2:1
---
### Trade Filters
**Bar Cooldown Filter (Default: ON, 3 bars)**
- **What it does**: Forces you to wait X bars after closing a trade before entering a new one
- **Why it matters**: Prevents emotional revenge trading and overtrading in choppy markets
- **Settings guide**:
- 3 bars = Standard (good for most cases)
- 5-7 bars = Conservative (oil, slow-moving assets)
- 1-2 bars = Aggressive (only for experienced traders)
**Exit on Opposite Extreme (Default: ON)**
- Closes your long when stochastic hits overbought (and vice versa)
- Acts as an early profit-taking mechanism
- **Leave this ON** unless you're testing other exit strategies
**Divergence Filter (Default: OFF)**
- Looks for price/momentum divergences for additional confirmation
- **When to enable**: Trending markets where you want fewer but higher-quality trades
- **Keep OFF for**: Mean-reverting markets (oil, forex, most of the time)
---
## 🚀 Quick Start Guide
### Step 1: Set Up in TradingView
1. Open TradingView and navigate to your chart
2. Click "Pine Editor" at the bottom
3. Copy and paste the strategy code
4. Click "Add to Chart"
5. The strategy will appear in a separate pane below your price chart
### Step 2: Choose Your Market
**If you're trading Crude Oil:**
- Timeframe: 12H
- Keep all default settings
- Watch for signals during London/NY overlap (8am-11am EST)
**If you're trading AAVE or crypto:**
- Timeframe: 4H or 12H
- Consider these adjustments:
- Stochastic Length: 10-14 (faster)
- Oversold: 20 (more aggressive)
- Take Profit: 8-10% (higher targets)
### Step 3: Wait for Your First Signal
**LONG Entry** (Green circle appears):
- Stochastic crosses up below oversold level (25)
- Price likely near recent lows
- System places limit order at take profit and stop loss
**SHORT Entry** (Red circle appears):
- Stochastic crosses down above overbought level (70)
- Price likely near recent highs
- System places limit order at take profit and stop loss
**EXIT** (Orange circle):
- Position closes either at stop, target, or opposite extreme
- Cooldown period begins
### Step 4: Let It Run
The biggest mistake? **Interfering with the system.**
- Don't close trades early because you're scared
- Don't skip signals because you "have a feeling"
- Don't increase position size after a big win
- Don't revenge trade after a loss
**Follow the system or don't use it at all.**
---
### Important Risks:
1. **Drawdown Pain**: You WILL experience losing streaks of 5-7 trades. This is mathematically normal.
2. **Whipsaw Markets**: Choppy, range-bound conditions can trigger multiple small losses.
3. **Gap Risk**: Overnight gaps can cause your actual fill to be worse than the stop loss.
4. **Slippage**: Real execution prices differ from backtested prices (factor in 0.1-0.2% slippage).
---
## 🔧 Optimization Guide
### When to Adjust Settings:
**Market Volatility Increased?**
- Widen stop loss by 0.5-1%
- Increase take profit proportionally
- Consider increasing cooldown to 5-7 bars
**Getting Too Few Signals?**
- Decrease stochastic length to 10-12
- Increase oversold to 30, decrease overbought to 65
- Reduce cooldown to 2 bars
**Getting Too Many Losses?**
- Increase stochastic length to 18-21 (slower, smoother)
- Enable divergence filter
- Increase cooldown to 5+ bars
- Verify you're on the right timeframe
### A/B Testing Method:
1. **Run default settings for 50 trades** on your chosen market
2. Document: Win rate, profit factor, max drawdown, emotional tolerance
3. **Change ONE variable** (e.g., oversold from 25 to 20)
4. Run another 50 trades
5. Compare results
6. Keep the better version
**Never change multiple settings at once** or you won't know what worked.
---
## 📚 Educational Resources
### Key Concepts to Learn:
**Stochastic Oscillator**
- Developed by George Lane in the 1950s
- Measures momentum by comparing closing price to price range
- Formula: %K = (Close - Low) / (High - Low) × 100
- Similar to RSI but more sensitive to price movements
**Mean Reversion vs. Trend Following**
- This is a **mean reversion** strategy (price returns to average)
- Works best in ranging markets with defined support/resistance
- Fails in strong trending markets (2017 Bitcoin, 2020 Tech stocks)
- Complement with trend filters for better results
**Risk:Reward Ratio**
- The cornerstone of profitable trading
- Winning 40% of trades with 3:1 R:R = profitable
- Winning 60% of trades with 1:1 R:R = breakeven (after fees)
- **This strategy aims for 45% win rate with 2.5-3:1 R:R**
### Recommended Reading:
- *"Trading Systems and Methods"* by Perry Kaufman (Chapter on Oscillators)
- *"Mean Reversion Trading Systems"* by Howard Bandy
- *"The New Trading for a Living"* by Dr. Alexander Elder
---
## 🛠️ Troubleshooting
### "I'm not seeing any signals!"
**Check:**
- Is your timeframe 4H or higher?
- Is the stochastic actually reaching extreme levels (check if your asset is stuck in middle range)?
- Is cooldown still active from a previous trade?
- Are you on a low-liquidity pair?
**Solution**: Switch to a more volatile asset or lower the overbought/oversold thresholds.
---
### "The strategy keeps losing money!"
**Check:**
- What's your win rate? (Below 35% is concerning)
- What's your profit factor? (Below 0.8 means serious issues)
- Are you trading during major news events?
- Is the market in a strong trend?
**Solution**:
1. Verify you're using recommended markets/timeframes
2. Increase cooldown period to avoid choppy markets
3. Reduce position size to 5% while you diagnose
4. Consider switching to daily timeframe for less noise
---
### "My stop losses keep getting hit!"
**Check:**
- Is your stop loss tighter than the average ATR?
- Are you trading during high-volatility sessions?
- Is slippage eating into your buffer?
**Solution**:
1. Calculate the 14-period ATR
2. Set stop loss to 1.5x the ATR value
3. Avoid trading right after market open or major news
4. Factor in 0.2% slippage for crypto, 0.1% for oil
---
## 💪 Pro Tips from the Trenches
### Psychological Discipline
**The Three Deadly Sins:**
1. **Skipping signals** - "This one doesn't feel right"
2. **Early exits** - "I'll just take profit here to be safe"
3. **Revenge trading** - "I need to make back that loss NOW"
**The Solution:** Treat your strategy like a business system. Would McDonald's skip making fries because the cashier "doesn't feel like it today"? No. Systems work because of consistency.
---
### Position Management
**Scaling In/Out** (Advanced)
- Enter 50% position at signal
- Add 50% if stochastic reaches 10 (oversold) or 90 (overbought)
- Exit 50% at 1.5x take profit, let the rest run
**This is NOT for beginners.** Master the basic system first.
---
### Market Awareness
**Oil Traders:**
- OPEC meetings = volatility spikes (avoid or widen stops)
- US inventory reports (Wed 10:30am EST) = avoid trading 2 hours before/after
- Summer driving season = different patterns than winter
**Crypto Traders:**
- Monday-Tuesday = typically lower volatility (fewer signals)
- Thursday-Sunday = higher volatility (more signals)
- Avoid trading during exchange maintenance windows
---
## ⚖️ Legal Disclaimer
This trading strategy is provided for **educational purposes only**.
- Past performance does not guarantee future results
- Trading involves substantial risk of loss
- Only trade with capital you can afford to lose
- No one associated with this strategy is a licensed financial advisor
- You are solely responsible for your trading decisions
**By using this strategy, you acknowledge that you understand and accept these risks.**
---
## 🙏 Acknowledgments
Strategy development inspired by:
- George Lane's original Stochastic Oscillator work
- Modern quantitative trading research
- Community feedback from hundreds of backtests
Built with ❤️ for retail traders who want systematic, disciplined approaches to the markets.
---
**Good luck, stay disciplined, and trade the system, not your emotions.**
ICT FVG & Swing Detector Basic by Trader Riaz//@version=6
indicator("ICT FVG & Swing Detector Basic by Trader Riaz", overlay=true)
// Display toggles for Bullish FVGs
show_bull_fvg = input.bool(true, "Show Bullish FVGs?")
// Input settings for Bullish FVGs
fvg_bull_count = input.int(1, "Number of Bullish FVGs to show", minval=1)
// Color settings for Bullish FVGs
bullish_fvg_color = input.color(color.green, "Bullish FVG Color")
// Bullish FVG Extend Options
bull_fvg_extendGroup = "Bullish FVG Extend Options"
bull_fvg_extendOption = input.string("Default", "Bullish FVG Extend Option", options= , group=bull_fvg_extendGroup)
bull_fvg_extendCandles = input.int(8, "Bullish FVG Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=bull_fvg_extendGroup)
// Display toggles for Bearish FVGs
show_bear_fvg = input.bool(true, "Show Bearish FVGs?")
// Input settings for Bearish FVGs
fvg_bear_count = input.int(1, "Number of Bearish FVGs to show", minval=1)
// Color settings for Bearish FVGs
bearish_fvg_color = input.color(color.red, "Bearish FVG Color")
// Bearish FVG Extend Options
bear_fvg_extendGroup = "Bearish FVG Extend Options"
bear_fvg_extendOption = input.string("Default", "Bearish FVG Extend Option", options= , group=bear_fvg_extendGroup)
bear_fvg_extendCandles = input.int(8, "Bearish FVG Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=bear_fvg_extendGroup)
// Display toggles for Swing Highs
show_swing_high = input.bool(true, "Show Swing Highs?")
// Input settings for Swing Highs
swing_high_count = input.int(2, "Number of Swing Highs to show", minval=1)
// Color settings for Swing Highs
swing_high_color = input.color(color.green, "Swing High Line & Label Color")
// Swing High Extend Options
swing_high_extendGroup = "Swing High Extend Options"
swing_high_extendOption = input.string("Default", "Swing High Extend Option", options= , group=swing_high_extendGroup)
swing_high_extendCandles = input.int(8, "Swing High Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=swing_high_extendGroup)
// Display toggles for Swing Lows
show_swing_low = input.bool(true, "Show Swing Lows?")
// Input settings for Swing Lows
swing_low_count = input.int(2, "Number of Swing Lows to show", minval=1)
// Color settings for Swing Lows
swing_low_color = input.color(color.red, "Swing Low Line & Label Color")
// Swing Low Extend Options
swing_low_extendGroup = "Swing Low Extend Options"
swing_low_extendOption = input.string("Default", "Swing Low Extend Option", options= , group=swing_low_extendGroup)
swing_low_extendCandles = input.int(8, "Swing Low Extend Candles (Limited Only)", minval=1, maxval=100, step=1, group=swing_low_extendGroup)
// Target Settings
showNextTarget = input.bool(true, "Show Next Target")
nextTargetHighColor = input.color(color.red, "Next Target High Color")
nextTargetLowColor = input.color(color.red, "Next Target Low Color")
// === Time Calculation ===
// Calculate one bar duration in milliseconds
barDuration = time - time
// Define reasonable extension period (4 bars into future)
extensionPeriod = barDuration * 4
// Arrays to store values with timestamps
var bull_fvg_data = array.new(0)
var bear_fvg_data = array.new(0)
var swing_high_data = array.new(0)
var swing_low_data = array.new(0)
var bull_fvg_labels = array.new(0)
var bear_fvg_labels = array.new(0)
var swing_high_labels = array.new(0)
var swing_low_labels = array.new(0)
var bull_fvg_midlines = array.new(0)
var bear_fvg_midlines = array.new(0)
var bull_fvg_tops = array.new(0)
var bull_fvg_bottoms = array.new(0)
var bear_fvg_tops = array.new(0)
var bear_fvg_bottoms = array.new(0)
// Get the last bar index
last_bar = last_bar_index + 3
// Function to determine right boundary based on extend option
get_right_boundary(option, extend_candles, default_right) =>
if option == "None"
bar_index - 2
else if option == "Limited"
bar_index - 2 + extend_candles
else
default_right
// Bullish FVG Detection
if high < low and show_bull_fvg
right_bar = get_right_boundary(bull_fvg_extendOption, bull_fvg_extendCandles, last_bar)
new_box = box.new(left=bar_index-2,
top=low,
right=right_bar,
bottom=high ,
bgcolor=color.new(bullish_fvg_color, 90),
border_color=bullish_fvg_color)
bull_mid = (low + high ) / 2
new_midline = line.new(bar_index-2, bull_mid, right_bar, bull_mid,
color=color.new(bullish_fvg_color, 50),
style=line.style_dashed)
new_label = label.new(right_bar-1, bull_mid, "Bullish FVG",
color=color.new(bullish_fvg_color, 100),
textcolor=bullish_fvg_color,
style=label.style_none,
textalign=text.align_right,
size=size.small)
array.unshift(bull_fvg_data, new_box)
array.unshift(bull_fvg_midlines, new_midline)
array.unshift(bull_fvg_labels, new_label)
array.unshift(bull_fvg_tops, low)
array.unshift(bull_fvg_bottoms, high )
if array.size(bull_fvg_data) > fvg_bull_count
box.delete(array.pop(bull_fvg_data))
line.delete(array.pop(bull_fvg_midlines))
label.delete(array.pop(bull_fvg_labels))
array.pop(bull_fvg_tops)
array.pop(bull_fvg_bottoms)
// Bearish FVG Detection
if low > high and show_bear_fvg
right_bar = get_right_boundary(bear_fvg_extendOption, bear_fvg_extendCandles, last_bar)
new_box = box.new(left=bar_index-2,
top=low ,
right=right_bar,
bottom=high,
bgcolor=color.new(bearish_fvg_color, 90),
border_color=bearish_fvg_color)
bear_mid = (low + high) / 2
new_midline = line.new(bar_index-2, bear_mid, right_bar, bear_mid,
color=color.new(bearish_fvg_color, 50),
style=line.style_dashed)
new_label = label.new(right_bar-1, bear_mid, "Bearish FVG",
color=color.new(bearish_fvg_color, 100),
textcolor=bearish_fvg_color,
style=label.style_none,
textalign=text.align_right,
size=size.small)
array.unshift(bear_fvg_data, new_box)
array.unshift(bear_fvg_midlines, new_midline)
array.unshift(bear_fvg_labels, new_label)
array.unshift(bear_fvg_tops, low )
array.unshift(bear_fvg_bottoms, high)
if array.size(bear_fvg_data) > fvg_bear_count
box.delete(array.pop(bear_fvg_data))
line.delete(array.pop(bear_fvg_midlines))
label.delete(array.pop(bear_fvg_labels))
array.pop(bear_fvg_tops)
array.pop(bear_fvg_bottoms)
// Swing High Detection
is_swing_high = high < high and high > high
if is_swing_high and show_swing_high
right_bar = get_right_boundary(swing_high_extendOption, swing_high_extendCandles, last_bar + 3)
new_line = line.new(bar_index - 1, high , right_bar, high ,
color=swing_high_color)
new_label = label.new(right_bar, high , "Swing High",
color=color.new(color.white, 30),
style=label.style_label_left,
textcolor=swing_high_color,
size=size.tiny)
array.unshift(swing_high_data, new_line)
array.unshift(swing_high_labels, new_label)
if array.size(swing_high_data) > swing_high_count
line.delete(array.pop(swing_high_data))
label.delete(array.pop(swing_high_labels))
// Swing Low Detection
is_swing_low = low > low and low < low
if is_swing_low and show_swing_low
right_bar = get_right_boundary(swing_low_extendOption, swing_low_extendCandles, last_bar + 3)
new_line = line.new(bar_index -1, low , right_bar, low ,
color=swing_low_color)
new_label = label.new(right_bar, low , "Swing Low",
color=color.new(color.white, 30),
style=label.style_label_left,
textcolor=swing_low_color,
size=size.tiny)
array.unshift(swing_low_data, new_line)
array.unshift(swing_low_labels, new_label)
if array.size(swing_low_data) > swing_low_count
line.delete(array.pop(swing_low_data))
label.delete(array.pop(swing_low_labels))
// Clean up if toggles are turned off
if not show_bull_fvg and array.size(bull_fvg_data) > 0
for i = 0 to array.size(bull_fvg_data) - 1
box.delete(array.get(bull_fvg_data, i))
line.delete(array.get(bull_fvg_midlines, i))
label.delete(array.get(bull_fvg_labels, i))
array.clear(bull_fvg_data)
array.clear(bull_fvg_midlines)
array.clear(bull_fvg_labels)
array.clear(bull_fvg_tops)
array.clear(bull_fvg_bottoms)
if not show_bear_fvg and array.size(bear_fvg_data) > 0
for i = 0 to array.size(bear_fvg_data) - 1
box.delete(array.get(bear_fvg_data, i))
line.delete(array.get(bear_fvg_midlines, i))
label.delete(array.get(bear_fvg_labels, i))
array.clear(bear_fvg_data)
array.clear(bear_fvg_midlines)
array.clear(bear_fvg_labels)
array.clear(bear_fvg_tops)
array.clear(bear_fvg_bottoms)
// === Swing High/Low Detection ===
var float swingHighs = array.new()
var int swingHighTimes = array.new()
var float swingLows = array.new()
var int swingLowTimes = array.new()
var line swingHighLines = array.new()
var label swingHighLabels = array.new()
var line swingLowLines = array.new()
var label swingLowLabels = array.new()
isSwingHigh = high > high and high > high
isSwingLow = low < low and low < low
if isSwingHigh
array.unshift(swingHighs, high )
array.unshift(swingHighTimes, time )
if isSwingLow
array.unshift(swingLows, low )
array.unshift(swingLowTimes, time )
// === Next Target Detection ===
var line currentTargetLine = na
var label currentTargetLabel = na
if showNextTarget
if not na(currentTargetLine)
line.delete(currentTargetLine)
if not na(currentTargetLabel)
label.delete(currentTargetLabel)
priceRising = close > open
priceFalling = close < open
// Use slightly longer extension for targets
targetExtension = barDuration * 8
if priceRising and array.size(swingHighs) > 0
for i = 0 to array.size(swingHighs) - 1
target = array.get(swingHighs, i)
targetTime = array.get(swingHighTimes, i)
if target > close
currentTargetLine := line.new(
x1=targetTime, y1=target,
x2=time + targetExtension, y2=target,
color=nextTargetHighColor, width=2,
style=line.style_dashed,
xloc=xloc.bar_time)
currentTargetLabel := label.new(
x=time + targetExtension, y=target,
text="Potential Target", size=size.tiny,
style=label.style_label_left,
color=nextTargetHighColor,
textcolor=color.white,
xloc=xloc.bar_time)
break
else if priceFalling and array.size(swingLows) > 0
for i = 0 to array.size(swingLows) - 1
target = array.get(swingLows, i)
targetTime = array.get(swingLowTimes, i)
if target < close
currentTargetLine := line.new(
x1=targetTime, y1=target,
x2=time + targetExtension, y2=target,
color=nextTargetLowColor, width=2,
style=line.style_dashed,
xloc=xloc.bar_time)
currentTargetLabel := label.new(
x=time + targetExtension, y=target,
text="Potential Target", size=size.tiny,
style=label.style_label_left,
color=nextTargetLowColor,
textcolor=color.white,
xloc=xloc.bar_time)
break
SPY Sniper Levels [Day Trader]Here is a professional, concise description you can copy and paste directly into the TradingView publication description box. I’ve written it to appeal to other serious price action traders.
***
**Title:** SPY Sniper Levels
**Description:**
Designed for high-speed day trading on **SPY** and major indices. This lightweight script eliminates the need for manual morning prep by automatically plotting the four critical liquidity zones that institutional algorithms target every session.
**Features:**
* **PDH / PDL (Solid Lines):** Previous Day High & Low. These are the major "walls" for the session.
* **PMH / PML (Dotted Circles):** Pre-Market High & Low. These levels automatically track during the pre-market session (04:00–09:30 EST) and **lock** the moment the market opens. This creates a static reference for Opening Range Breakouts (ORB).
**How to Trade This Setup:**
1. **The Breakout:** Look for high-volume candles closing outside the PMH/PML in the first 30 minutes.
2. **The Fade:** Watch for "traps" (long wicks) at the PDH/PDL to fade the price back toward VWAP.
3. **The Trend:** If price holds above the PDH, look for a trend day. If it fails to break the PML, look for a chop day.
**Best Settings:**
* Optimized for **1m, 2m, and 5m** timeframes.
* Works best on Dark Mode charts.
***
googleusercontent.com






















