TradingView
TheSocialCryptoClub
23 אפר׳ 2023 16:46

Yesterday’s High Breakout - Trend Following Strategy 

Nuls / TetherUSBinance

תיאור

Yesterday’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.
תגובות
tumiza999
Wonderful Strategy!!! ;-)))))
Siwoopapa
If you change the trailing offset value and trailing stop value to 0.01, you will get unrealistic results, but it seems to be repainted
TheSocialCryptoClub
@Siwoopapa, use realistic values for trailing stop, not this one. Also, for better backtesting, it is helpful to use the bar_magnifier, given the presence of limit/stop orders
Siwoopapa
@TheSocialCryptoClub, Then we'll have to raise the trailing stop and offset trailing values to 0.01 or higher to see if the test is normal Can't you tell me from what number it's normal?
ks1267
"This strategy did not generate any orders throughout the testing range". I don't see anywhere I can edit the time range. What should I set to be able to backtest strategy?
TheSocialCryptoClub
@ks1267, what error do you receive?
ks1267
@TheSocialCryptoClub, Hi, it's not the error but I got the caution message coming up on backtest result panel shwing "Caution, This strategy did not generate any orders throughout the testing range". So it does not show the backtest result. I assume it's something about the date range is out of range. I had this caution before on other strategy but I could look into their code and edit the date range to be in recent range. But in this script, I could not find the code that specific the date range so I could not edit it. Not sure where should I edit to be able to see the backtest result?
TheSocialCryptoClub
@ks1267, thanks for the message. we did not include a date filter. can you check that next to the strategy name there is no red exclamation mark? also what symbol and timeframe are you using it on?
ks1267
@TheSocialCryptoClub, There is red exclamation mark behind the strategy name. However I can view the backtesting result by go to "Strategy tester > properties" and then I untick "use bar magnifier" in "backtesting precision" and it works :) Thank you so much.
burgercrisis
@TheSocialCryptoClub, I think it needs a date filter. I'm getting exceeding balance issues that can only be resolved by lowering %... also will allow automative trading to work better :)
עוד