Gap detector
This is a very simple gap indicator derived by comparing the previous opening and next closing price.
Gap down if opening price is lesser than previous closed price.
Gap up if opening is more than previous closed price.
This gap detector use to evaluate the continuation or reversal of next candle and needed to be implement with other indicator such as Moving average or Boilinger band to read the possible direction of trend. Basic knowledge of candlestick pattern may help to predict the direction of next candlestick base on gap up or down of current price.
Alert can be setup using this gap detector accordingly to the time frame of chart.
Multiple time frame is recommended
Gap
BITCOIN CME FUTURES GAPSDisplays information about Bitcoin CME Futures Gaps over BTCUSD (or XBTUSD) charts.
You can configure a threshold percentage to only display gaps whose size is greater than that percentage. The gap precentage is calculated based on the current close price.
Gaps up are displayed in Orange, gaps down in Green
Daily GAP StatsI did not write the script from scratch but rather started editing code of an existing one. The original code came from a script called GAP DETECTOR by @Asch-
First up: I am a trader, not a programmer and therefore my code most likely is inefficient. If someone with more expertise would like to help and optimize it - feel free to get in touch, I am always happy to learn some new tricks. :)
This script does 2 things:
- It shows daily gaps stats based on user inputs
- It shows color coded labels on gap days with additional information in tooltips ( important: make sure to read 'known issues/limitations' at the end )
User Inputs
==========
Although the input dialog is pretty straight forward, I do a quick rundown:
- Length: max lookback time
- Gap Direction: self explanatory
- Show All Gaps | Cont Only | Reversal Only | Off:
This refers to the way labels are displayed on gap days (again: make sure to read known issues/limitations!)
- Show All Gaps: does what it says
- Cont Only: only shows gaps where price continued in the gap direction. If you filter for gap ups and chose 'Cont only' you will only see labels on gap days where price closed above the open (and vice versa if you scan for gap downs).
- Reversal Only: you will only see labels for closes below the open on gap up days (and the opposite on gap down days)
- Off: self explanatory
- Gap Measure in ATR/PCT: self explanatory, ATR is calculated over a 10d period
- Gap Size (Abs Values): no negative values allowed here. If you filter for gap downs and enter 3 it means it will show gaps where the stock fell more than 3 ATR/PCT on the open.
- RVOL Factor: along with significant gaps should come significant volume. RVOL = volume of the gap day / 20d average volume
- Viewing Options: Placing the stats label in the window is a bit tricky (see knonw issues/limitations) and I was not sure which way I liked better. See for yourself what works best for you.
Known Isusses/Limitations:
=======================
- Positioning of the stats table:
As to my knowledge, Tradingview only allows label positioning relative to price and not relative to the chart window. I tried to always display the gap stats table in the upper right corner, using 52wk high as y-coordinate. This works ok most of the time, but is not pretty. If anybody has some fancy way to tag the label in a fixed position, please get in touch.
- Max number of labels per script:
TradingView has a limitation that allows a maxium of ~50 labels per script. If there are more labels, TradingView will automatically cut the oldest ones, without any notification. I have found this behaviour to be rather inconsistent - sometimes it'll dump labels even if there are a lot fewer than 50. Hopefully TradingView will drop this limitation at one point in the future.
Important: The inconsistent display of the gap day labels has NO INFLUENCE on the calculations in the gap stats table - the count and the calculations are complete and correct!
GapGap
I've seen many trade decisions based on the CME Bitcoin Futures gap, so this indicator will let you know if that strategy is good or not, so use it as another confirmation 👍🏻.
- Shows when a gap is created, when it is filled and if not filled if a new gap is created.
- You can also use another security as a reference.
- Multi Timeframe , by default it will search the daily gaps.
GAP based S/RThis Script is designed to show repeating pattern in the market, encountered by gaps.
Depending on the Gap, the Lines will be drawn in the selected color.
The Gap is checked from the lowest point of the old candle-body to the highest point of the new candle body for a bearish Gap and vice versa for bullish Gap.
The Script allows to:
- enable bearish gaps, bullish gaps or both
- adjust the minimum pips for the marketjump to be considered a gap
- adjust color of the bullish/bearish gap
- define how much bars should be considered in the history, where 4999 is the max value.
With this functionality and the showing patterns, it is possible to determine support and resistance zones.
When the script is used in markets/periods with many gaps and a high number of historic candles is watched, you might not see any horizontal lines at all -> please reduce the number of historical bars in order to draw an appropriate number of lines.
Moving Average Gap AnalyzerExtremely simple algorithm in order to calculate the gap between 2 simple moving averages. Analyzing perspective defines the line of color as white, green or red. This is done by checking sources of both moving averages and evaluate their past values with the mutual length respectively. Analysis is done by scoring the movements of sources.
What to expect?
- Higher the gap, higher the volatility.
- If the analysis line is green sources have been raising (most likely bull market), if the analysis line is white the market is mostly likely close to horizontal, if the analysis line is red, sources have been decreasing gradually (most likely bear market).
ps. Genuine indicator idea of me. This indicator is not a product or an idea of any group I work with. Completely clear of all types of IP.
Gap Down Reversal StrategyA "Gap down Reversal" is when the current days candle, opens, below the prior days close, and "finishes up" on the day with the close greater than the open. This type of price action can provide traders with favorable entry points to trade long, as anyone who was short the prior day, can get squeezed or panic out of the trade as they would see profits erode quickly from the gap down at the open.
Strategy results are shown on SHOP with 10k starting capital and 10k per trade. The strategy enters at next days close after the gap down reversal fires off, and a 5% trailing stop order is also executed. This is important to understand when experimenting with different trailing stops on different symbols and observing results to find the most viable strategy. The discretionary trader may choose to enter at the close, or at the next days open, so understand results are not calculated for those entry points.
You also may alter the start date of the strategy, so you can include, or exclude certain dates.
Experiment with different stops and symbols! More volatile symbols most likely will need looser stops and Vice Versa. Concentrate on symbols in up trends, as "the dips" usually get consistently bought in these names, but hard reversals in downtrends can happen as well.
Any questions/concerns please let me know and happy trading.
GapAnalysisI am a new Trading View user. I am trying to gain some reputation so that I can start contributing more to the community and start learning more. Therefore I have written this very simple pine script that simply adds a label to the first bar of the day if there is a gap between 2% and 8% or a gap between -2* and -8%.
Questions:
1) Lots of missing candlesticks e.g. at 16:30 and 08:00 meaning the candlestick may not of truely gapped up or down. Why are there missing bars? Is it because I have the free version? Are there any missing candlesticks on the paid for version?
2) Does the Gap filter always look at the first bar of the day and compare it to the last bar the previous day? (assuming you select 1d above the filters).
3) How does the Gap filter work if you select 1w above the filters?
4) The filter columns save for me, however the filter values do not. For example, if I select the Gap filter and select the values 'between 2% and 6%', then the column is saved but the values are not. Is this correct?
Forex Virtual Index FIAT VersionThis is virtually created FX Fiat pairs index based on OANDAs data.
Pairs are: EUR/USD , AUD/USD , GBP/USD , NZD/USD , AUD/JPY , EUR/JPY , GBP/JPY , USD/JPY , USD/CAD , USD/PLN
Be awared that some pairs like USD/CAD , have reversed correlation to the index.
You may look at the gaps as on standard S/R levels.
ps. Take look inside the scirpt's settings.
ps2. This script is invite-only for the members of our trading group (info in signature, group is free of charge).
[astropark] Fair Value GapsDear Followers,
today a new epic tool, the "Fair Value Gap (FVG) Finder" .
Fair Value Gaps are quite important to trade, as they represent both volume and trading unfilled gaps, which most of the time are filled and then price reverse .
This indicator will let you set alerts on when a new FVG is found and when it is filled.
Traded together with Breaker Blocks (BB) and Supply/Demand Order Blocks (OB) , you can easily spot important points where to start a short or a long trade.
Here my Breaker Blocks (BB) and Supply/Demand Order Blocks (OB) indicator
Here below some examples on how to use the indicator.
On Bitcoin
On EURUSD
How to detect last bar of day Simple way how to detect last bar of day and close all positions
UPD: day end can be different for yours because stocks market use another timezone
Gap driven intraday trade (better in 15 Min chart)// Based on yesterday's High, Low, today's open, and Bollinger Band (20) in current minute chart,
// Defined intraday Trading opportunity: Stop, Entry, T0, Target (S.E.T.T)
// Back test in 60, 30, 15, 5 Min charts with SPY, QQQ, XOP, AAPL, TSLA, NVDA, UAL
// In 60 and 30 min chart, the stop and target are too big. 5 min is too small.
// 15 min Chart is the best time frame for this strategy;
// -------------------------------------------------------------------------------
// There will be Four lines in this study:
// 1. Entry Line,
// 1.1 Green Color line to Buy, If today's open price above Yesterday's High, and current price below BB upper line.
// 1.2 Red Color line to Short, if today's open price below Yesterday's Low, and current above BB Lower line.
//
// 2. Black line to show initial stop, one ATR in current min chart;
//
// 3. Blue Line (T0) to show where trader can move stop to make even, one ATR in current min chart;
//
// 4. Orange Line to show initial target, Three ATR in current min chart;
//
// Trading opportunity:
// If Entry line is green color, Set stop buy order at today's Open;
// Whenever price is below the green line, Prepare to buy;
//
// If Entry line is Red color, Set Stop short at today's Open;
// Whenever price is above the red line, Prepare to short;
//
// Initial Stop: One ATR in min chart;
// Initial T0: One ATR in min chart;
// Initial Target: Three ATR in min chart;
// Initial RRR: Reward Risk Ratio = 3:1;
//
// Maintain: Once the position moves to T0, Move stop to "Make even + Lunch (such as, Entry + $0.10)";
// Allow to move target bigger, such as, next demand/supply zone;
// When near target or demand/supply zone or near Market close, move stop tightly;
//
// Close position: Limit order filled, or near Market Close, or trendline break;
//
// Key Step: Move stop to "Make even" after T0, Do not turn winner to loser;
// Willing to "in and out" many times in one day, and trade the same direction, same price again and again.
//
// Basic trading platform requests:
// To use this strategy, user needs to:
// 1. Scan Stocks Before market open:
// Prepare a watch list for top 10 ETF and Top 90 stocks which are most actively traded.
// Stock might be limited by price range, Beta, optionable, ...
// Before market open, Run a scan for these stocks, find which has GAP and inside BB;
// create watch list for that day.
//
// 2. Attach OSO and OCO orders:
// User needs to Send Entry, Stop (loss), and limit (target) orders at one time;
// Order Send order ( OSO ): Entry order sends Stop order and limit order;
// Order Cancel order ( OCO ): Stop order and limit order, when one is filled, it will cancel the other instantly;
All in 1 Indikator (MAs, GAP Indikator, BB, Clouds)This indicator provides:
-> up to 5 SMAs and EMAs at the same time.
-> HullMA
-> VWMA (Volume based MA)
-> Ichimoku Cloud
-> Parabolic SAR (for Trend analysis)
-> special 1. Add up to 2 Bollinger Bands (so you can add 2 BB at the same time with different standard deviations)
-> special 2. You also can add an GAP Indikator. The red and green lines you can see in the picture. This tool finds gap's in the btc cme chart for example and shows them to you
Gap Trading Strategy: CME BitcoinI created a strategy which finds gaps on CME Futures market for Bitcoin, BTC1! and opens a long or short position on the crypto exchange depending on what kind of gap was found (up or down) on CME.
Up gap: today open price > previous day high price
Down gap: today open price < previous day low price
Two lines below the main chart show when gaps appear. The green line represents the size of up gaps, when it crosses zero it gives a long signal. The red line - represents the size of down gaps, when it crosses zero - short signal.
Instead of having to look between multiple charts, this simply overlays the past weeks open and close should a gap appear.
Usage:
Strategy flips long / short depending of indicator signals. It could cut the position by stop loss or take profit.
Features:
ability to set stop loss and take profit in %
ability to set delta for gaps (if you want to filter small ones)
ability to choose strategy type. Standart: Long Up/Short Down || Inverse: Short Up/Long Down.
Backtesting:
Backtested on BTCPERP ( FTX ) and XBTUSD (Bitmex).
It shows a low drawdown, a small number of trades and 50% of profit for the 2020.
For example, I set high delta for down gaps to filter small ones
Strategy doesn't repaint.
NSDT Daily Gap RangeSimple script that plots the range between the previous day close and the current day open. This makes it easier to reference the gap up or gap down zone throughout the day.
S/R levels v1.00With the help of this script you can see premarket GAPs in the price, which tend to be closed. Strongest EMAs (50,100,200) in one click. Well known inside candle pattern and new Mpattern good for breakout scalping on low TF (1m or so). You can also switch on levels good for Option trading, specially for SPX, ATM level and 5$ increment levels on bouth sides, you can then better judge and manage your trades. Last setting allows you to see our own levels on several tickers.
send PM or visit website to get access
Takashi Gaps | 2nd Gen | [Alerts]Spot gaps between bars and benefit from the correction of the market as the price restores its position.
Inputs
Value In
Options input. Defines if the gap between bars will be checked by Points or Percent.
Gap Size
Float input. Value to trigger a signal if the gap between bars is bigger than.
To get access to this and other scripts check links below.
Gap Filling Strategy Gaps are market prices structures that appear frequently in the stock market, and can be detected when the opening price is different from the previous closing price, this is why gaps are also called "opening price jumps". While gaps can occur frequently, some of them are more significant than others, and can be observed when looking at a long term chart.
The following strategy is based on the exploitation of significant gaps occurring during a new session, and posses various options that can return a wide variety of results.
Type Of Gaps And Occurence
I'am not a professional when it comes to gaps, but as you know the stock market close for the day, however it is still possible to place orders, your broker will hold them until the market open back. Once the market reopen the broker execute the pending orders, and when many orders where pending the market register really high volume and the price might differ from the precedent close.
Gaps are generally broken down into four types:
Common : Gaps occurring within a certain price range, mostly occurs during ranging markets.
Break Away : Gaps breaking a support and resistance, making a new higher high/lower low.
Runaway : Gaps occurring within a trend, followed by a continuation of the trend.
Exhaustion : Gaps occurring at the end of a trend, followed by a reversal.
As said before, some gaps are more significant than others, the significance of a gap can be determined by comparing the opening price with the previous high/low price and by looking at volume. Significant up gaps will have an opening price greater than the previous high, while significant down gap will have an opening price lower than the previous low with both high volume accompanying them.
After a gap, when the price go back to the point previous to the gap we say that it has been "filled", this characteristic is what will be exploited in this strategy.
Strategy Rules & Logic
In this strategy, the significance of a gap is determined by the position of the opening price relative to the previous high/low and make sure the bar following the gap don't fill it.
When the setting invert is set to false the strategy interpret the detected gaps as being exhaustion gaps, therefore when an up gap occur a short position is opened, when a down gap occur a long position is opened. When invert is set to true gaps are considered to be runaway or break away gaps, therefore the contrary positions are opened. Positions are exited when the gap has been filled, which in the chart is show'n when the price cross the red level who act as either a take profit (invert = false) or as a stop loss (invert = true).
There are various closing conditions available that the user can select from the "close when" setting.
New Session : This option close all previous positions when the market is in a new session.
New Gap : This option close all previous position when a new gap has been detected.
Reverse Position : This option close all previous position when a contrary position to the current one is opened. This option would reduce the number of trades.
Testing On Some Stocks
The analysis will be tested in different tech stocks with a main TF of 15 minutes with no spread and commissions applied. Default settings will be used. We'll be making our first analysis using AMD, who has recently formed a full reverse HS pattern, where the neckline has been crossed by the price. (by the way i have a bad feeling about it, hey ! feeling filling ! Lame jokes!)
Profit: $ -12.22
Trades: 272
Profitability: 65.07 %
We can see negative results, with an heavily decreasing balance. Using invert would return positive results.
We will now test the strategy on NVDA, the company is one of the biggest when it comes to the Gpu market.
Profit: $ -215.54
Trades: 297
Profitability: 60.27 %
Not better, using invert would of course create better results. Like AMD the balance is heavily decreasing.
Finally we will test the strategy on Seagate technology, a company mostly known for their mechanical hard drives.
Profit: $ -4.32
Trades: 261
Profitability: 65.9 %
Here the balance does not appear so heavily decreasing and even managed to reach back the initial balance before going down again.
Summary
A strategy based on gap filling has been briefly introduced and tested with 3 tech stocks. The results show that using invert option might be better. The advantage of this strategy against ones using technical indicators is that this one does not heavily depend on user settings, which make it way more efficient, this a big advantage of patterns based strategies.
Thx to LucF for helping with the "process_orders_on_close" element, since i had to use closing price i had to remove it tho, was afraid results would differ even more from a more realistic backtest. And thx for those who continuously support me, more cool stuff is coming up.
Thx for reading and i hope you'll have learned something new today !
Trendbar IM This script show me iniciative move. It it based on 3, 4 or 5 candles thats contains pivot low/high and hidden gap. I use that with volume profile to confirm that the gap is really made with "big players". It shows me momentum in the market. For intraday i am using that on 1h chart and swing 4h and daily chart.
GAPS CheckerUsing this indicator allows you to indentify large GAPS directly in your stock chart at first glance.
It uses two different sorts for large GAPS (e.g. larger than 3%) and for very large GAPS (e.g. larger than 6%). These values can be changed in the indicator settings.
Hope this helps many of you to be more efficient in your chart analysis - have fun!
TeoTrading 27 - GAP DetectorThis Indicator Detects different Types of GAPs.
You can configure:
PercentThreshold: minimum percent value to consider in the GAP detection.
Date from.
Date To.
Ignore End Date.
Over the last candle, prints the values of the different type of GAPs found.
GAPS Checker v2 PROUsing this indicator allows you to indentify large GAPS directly in your stock chart at first glance. The algorithm of the indicator *Gaps Checker v2* was optimized in this new indicator as well as it using the new pine script version v4. For backwards compatibility reasons this indicator is published.
This indicator is available in two versions ‘Lite’ and ‘PRO’. The difference is the calculated precision and the percent inputs in integer numbers or more granular in float values.
It uses two different sorts for large GAPS (yellow, e.g. larger than 2%) and for very large GAPS (red, e.g. larger than 4%). These values can be changed in the indicator settings.
Hope this helps many of you to be more efficient in your chart analysis - have fun!
GAPS Checker v2 LiteUsing this indicator allows you to indentify large GAPS directly in your stock chart at first glance. The algorithm of the indicator *Gaps Checker v2* was optimized in this new indicator as well as it using the new pine script version v4. For backwards compatibility reasons this indicator is published.
This indicator is available in two versions ‘Lite’ and ‘PRO’. The difference is the calculated precision and the percent inputs in integer numbers or more granular in float values.
It uses two different sorts for large GAPS (yellow, e.g. larger than 2%) and for very large GAPS (red, e.g. larger than 4%). These values can be changed in the indicator settings.
Hope this helps many of you to be more efficient in your chart analysis - have fun!
Gap Finder v1.0 by Nimit ChomnawangThis indicator shows locations of price gaps (or candle stick discontinuities). It prints out the labels "Gap" under the price bars where gaps occur. Asterisk " * " is used to pin point the bars with gaps.