Yesterday’s High Breakout - Trend Following StrategyYesterday’s High Breakout it is a trading system based on the analysis of yesterday's highs, it works in trend-following mode therefore it opens a long position at the breakout of yesterday's highs even if they occur several times in one day.
There are several methods for exiting a trade, each with its own unique strategy. The first method involves setting Take-Profit and Stop-Loss percentages, while the second utilizes a trailing-stop with a specified offset value. The third method calls for a conditional exit when the candle closes below a reference EMA.
Additionally, operational filters can be applied based on the volatility of the currency pair, such as calculating the percentage change from the opening or incorporating a gap to the previous day's high levels. These filters help to anticipate or delay entry into the market, mitigating the risk of false breakouts.
In the specific case of NULS, a 9% Take-Profit and a 3% Stop-Loss were set, with an activated trailing-stop percentage. To postpone entry and avoid false breakouts, a 1% gap was added to the price of yesterday's highs.
Name : Yesterday's High Breakout - Trend Follower Strategy
Author : @tumiza999
Category : Trend Follower, Breakout of Yesterday's High.
Operating mode : Spot or Futures (only long).
Trade duration : Intraday.
Timeframe : 30M, 1H, 2H, 4H
Market : Crypto
Suggested usage : Short-term trading, when the market is in trend and it is showing high volatility.
Entry : When there is a breakout of Yesterday's High.
Exit : Profit target or Trailing stop, Stop loss or Crossunder EMA.
Configuration :
- Gap to anticipate or postpone the entry before or after the identified level
- Rate of Change for Entry Condition
- Take Profit, Stop Loss and Trailing Stop
- EMA length
Backtesting :
⁃ Exchange: BINANCE
⁃ Pair: NULSUSDT
⁃ Timeframe: 2H
⁃ Fee: 0.075%
⁃ Slippage: 1
- Initial Capital: 10000 USDT
- Position sizing: 10% of Equity
- Start : 2018-07-26 (Out Of Sample from 2022-12-23)
- Bar magnifier: on
Credits : LucF for Pine Coders (f_security function to avoid repainting using security)
Disclaimer : Risk Management is crucial, so adjust stop loss to your comfort level. A tight stop loss can help minimise potential losses. Use at your own risk.
How you or we can improve? Source code is open so share your ideas!
Leave a comment and smash the boost button!
Thanks for your attention, happy to support the TradingView community.
Gap
Gap Stats v2This helpful analysis tool displays a table of days a stock has gapped, how much it gapped by and what percentage of the gap was covered.
It is meant to be used on the daily timeframe and can help you distinguish if gaps are going to be filled or not. I like to use it mainly on medium + cap stocks
that have gapped overnight or pre-market and see what the tendency is with how it behaves after a major gap.
Gap Absorption StrategyLike the nature, markets don't like the void, and this is something we can take advantage of by trading gaps on some markets.
This technique is well known, so I wanted to write a tiny script based on this strategy to get a bit more comfortable with it.
IMPORTANT: Default parameters wont give you good trades on every markets, you need to modify these parameters to see which proportions correspond to the stock you're trading.
This script triggers signals on predefined variation of a stock price after a gap, and allows its user to configure TP and SL prices corresponding to a specific percentage of this gap movement.
Note: We can observe that opening gaps are often the most interesting.
Options
Trigger: the price variation you want to trigger on (in % of the price)
Stop Loss : in % of the gap
Take profit : in % of the gap
A small table is displayed in the top right corner of the chart to give you TP/SL/Signal prices for each opportunity
SL (red line) and TP (green line) are also displayed on the chart when a signal is triggered
Information concerning the current opportunity is given at the bottom of the chart
Note: This script is based on the Gap-Size-Indicator that I published a few weeks ago.
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.
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.
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 !
MondayOpen Gap strategyThis strategy open orders on first bar of the week if there is a gap with Friday close price.
First bar could be on Sunday or on Monday, it depends on broker time.
Adjust starting hour with broker time. Use arrows to help finding correct broker time.
Also you should adjust gap size and exit hour.
Do not place on Daily charts.
Please use comment section for any feedback.
Next improvement (only to whom is interested to this script and follows me): study with alerts on multiple tickers all at one. Leave a comment if you want to have access to study.
********************************** IMPORTANT*******************************
I have developed an expert advisor for metatrader4 (MT4) and for jforex platform: results of expert advisor form 2015-01-01 to 2018-11-25 are very good with low drawdown and good profit.
********************************************************************************