PROTECTED SOURCE SCRIPT

Master Trend Reversal

Updated
The 'Master Trend Reversal' strategy is an innovative approach to detecting trend reversals in the market. This strategy harnesses the power of 'Pin Bars', a specific type of candlestick, to pinpoint potential trading opportunities.

Based on the properties of Pin Bars, this strategy identifies scenarios where the market is likely to reverse its trend. In particular, it seeks out Pin Bars that are significantly longer than their surrounding candles, a length determined by the 'Pin Bar Size (%)' parameter.

When a bullish Pin Bar is detected (i.e., the closing price is lower than the opening price, and the gap between the opening and low prices exceeds the specified Pin Bar size), the strategy goes long. Conversely, upon identifying a bearish Pin Bar (the closing price is higher than the opening price, and the difference between the high and opening prices is greater than the specified Pin Bar size), the strategy goes short.

Furthermore, 'Master Trend Reversal' incorporates an efficient risk management mechanism via stop-loss orders. The stop-loss level is calculated based on the average price of the position and the 'Stop Loss Percentage (%)' as specified by the user.

Hence, the 'Master Trend Reversal' strategy offers a unique approach to capitalize on market trend reversals while limiting potential losses through the use of stop-loss orders. This combination of precise trend reversal detection and robust risk management makes this strategy particularly useful for traders seeking to maximize their profits while effectively controlling their risk exposure.

Please remember that, like any trading strategy, 'Master Trend Reversal' does not guarantee success and should be used as part of a holistic risk management approach in the markets.
Release Notes
Hello Traders,

We are thrilled to announce an exciting update to our "Master Trend Reversal" strategy on TradingView! Your trading experience is about to become more visual and interactive than ever before.

What's New?

Trade Closing Visuals: We've incorporated a feature that allows you to see exactly when a trade closes. This update will give you a more intuitive understanding of when your stop loss orders are being triggered. This way, you'll be able to follow the strategy execution more closely. Whenever a long trade is closed, a blue shape will appear above the bar, and an orange shape will appear below the bar when a short trade is closed.

Enhanced Pin Bar Detection: We have refined the criteria for bullish and bearish pin bar detection, aiming to make it more accurate and effective.

Stop Loss and Pin Bar Size Customization: In response to your feedback, we've added input options that allow you to customize the size of the pin bars and the percentage for stop loss.

These features aim to give you a more comprehensive view of the trading signals and strategy performance. We hope that these additions will further aid in your trading decisions, making your trading journey more strategic, informed, and successful.

Thank you for your continued support and happy trading!
Release Notes
This update to the 'Master Trend Reversal' strategy introduces visual indicators to signal the closure of a trade. Users will now be able to distinctly see when a long or short trade has been closed, significantly enhancing the readability and understanding of the script's actions.
Release Notes
I've made an update to the 'Master Trend Reversal' strategy to address an issue where the script was generating too many orders, exceeding TradingView's 9000 order limit.

In the previous version of the script, a new position was opened every time a 'pin bar' was detected, without checking if a position was already open. This could lead to many positions being opened, especially if 'pin bars' were frequent in the data.

In this update, I've added a condition to check if a position is already open before entering a new position. Now, the script will only open a long position if a bullish 'pin bar' is detected and no position is open, and it will only open a short position if a bearish 'pin bar' is detected and no position is open.

This should reduce the number of orders generated by the script and prevent exceeding TradingView's 9000 order limit.
Moving AveragesParabolic Stop and Reverse (PSAR)reversaltrendTrend Analysistrendreversal

Protected script

This script is published closed-source and you may privately use it freely.

Want to use this script on a chart?

Disclaimer