OPEN-SOURCE SCRIPT

Trend Trader-Remastered

Atualizado
The script was originally coded in 2018 with Pine Script version 3, and it was in invite only status. It has been updated and optimised for Pine Script v5 and made completely open source.


Overview
The Trend Trader-Remastered is a refined and highly sophisticated implementation of the Parabolic SAR designed to create strategic buy and sell entry signals, alongside precision take profit and re-entry signals based on marked Bill Williams (BW) fractals. Built with a deep emphasis on clarity and accuracy, this indicator ensures that only relevant and meaningful signals are generated, eliminating any unnecessary entries or exits.

Key Features
1) Parabolic SAR-Based Entry Signals:

  • This indicator leverages an advanced implementation of the Parabolic SAR to create clear buy and sell position entry signals.
  • The Parabolic SAR detects potential trend shifts, helping traders make timely entries in trending markets.
  • These entries are strategically aligned to maximise trend-following opportunities and minimise whipsaw trades, providing an effective approach for trend traders.


2) Take Profit and Re-Entry Signals with BW Fractals:
The indicator goes beyond simple entry and exit signals by integrating BW Fractal-based take profit and re-entry signals.
  • Relevant Signal Generation: The indicator maintains strict criteria for signal relevance, ensuring that a re-entry signal is only generated if there has been a preceding take profit signal in the respective position. This prevents any misleading or premature re-entry signals.
  • Progressive Take Profit Signals: The script generates multiple take profit signals sequentially in alignment with prior take profit levels. For instance, in a buy position initiated at a price of 100, the first take profit might occur at 110. Any subsequent take profit signals will then occur at prices greater than 110, ensuring they are "in favour" of the original position's trajectory and previous take profits.


3) Consistent Trend-Following Structure:
  • This design allows the Trend Trader-Remastered to continue signaling take profit opportunities as the trend advances. The indicator only generates take profit signals in alignment with previous ones, supporting a systematic and profit-maximising strategy.
  • This structure helps traders maintain positions effectively, securing incremental profits as the trend progresses.


4) Customisability and Usability:
  • Adjustable Parameters: Users can configure key settings, including sensitivity to the Parabolic SAR and fractal identification. This allows flexibility to fine-tune the indicator according to different market conditions or trading styles.
  • User-Friendly Alerts: The indicator provides clear visual signals on the chart, along with optional alerts to notify traders of new buy, sell, take profit, or re-entry opportunities in real-time.
Notas de Lançamento
Release Notes:
  • Pine Script v5 implementation.
  • Variable type optimisation.
  • Fractal calculation optimisation.
  • Improved code re-usability via libraries.
  • Improved input grouping and descriptions.


New Feature:
  • Detailed signal selection.
  • Minimum Re-Entry Proximity: You can now define minimum required proximity ratio for re-signals.


Signal Descriptions:
  • Entry signals: Alert instantly.
  • Take Profit Signals: Alert on bar close.
  • Re-Entry Signals: Alert on bar close. Always require prior take-profit signal.
Notas de Lançamento
Minor update.
Notas de Lançamento
  • - Pine Script updated from v5 to v6.
  • - Alert conditions added.


Algorithm Signal Recommendations:
The signals generated by this script are optimised for the following alert settings:
  • Enter-Buy: Once Per Bar (Immediately Valid)
  • Enter-Sell: Once Per Bar (Immediately Valid)
  • TP-Buy: Once Per Bar Close (Valid Only on Bar Close)
  • TP-Sell: Once Per Bar Close (Valid Only on Bar Close)
  • RE-Buy: Once Per Bar Close (Valid Only on Bar Close)
  • RE-Sell: Once Per Bar Close (Valid Only on Bar Close)
Notas de Lançamento
  • Detailed alert condition messages implemented to provide programatic trading capability.
  • A non-displayed plot 'AlertPosEntryValue' added to ensure entry signal (price) values are included for entry signal alerts even 'Show: Pos Entry' is disabled.


Programatic Trading Signal (Alert Message) Structure:
Delimiter: | (Pipe)
0: Indicator Name
1: Signal Title
2: Ticker
3: Exchange
4: Interval
5: Time (UTC ISO8601 Format (TradingView's Default))
6: Signal (Price) Value

Programatic Trading Alert Messages:
  • Enter-Buy: TTR|Enter-Buy|{{ticker}}|{{exchange}}|{{interval}}|{{time}}|{{plot("AlertPosEntryValue")}}
  • Enter-Sell: TTR|Enter-Sell|{{ticker}}|{{exchange}}|{{interval}}|{{time}}|{{plot("AlertPosEntryValue")}}
  • TP-Buy: TTR|TP-Buy|{{ticker}}|{{exchange}}|{{interval}}|{{time}}|{{close}}
  • TP-Sell: TTR|TP-Sell|{{ticker}}|{{exchange}}|{{interval}}|{{time}}|{{close}}
  • RE-Buy: TTR|RE-Buy|{{ticker}}|{{exchange}}|{{interval}}|{{time}}|{{close}}
  • RE-Sell: TTR|RE-Sell|{{ticker}}|{{exchange}}|{{interval}}|{{time}}|{{close}}
Notas de Lançamento
Official strategy of the indicator is now published with the latest update!

Strategy: Trend Trader Remastered (TTR)-Strategy

MAJOR & IMPORTANT UPDATE:
According to the feedback, I dedicated my last two days to identifying potential problems. I observed that the default PSAR calculation on TradingView is fast-oriented. I identified the issue at 2024-06-02 20:00 UTC and 2024-06-03 00:00 UTC candles at BTCUSD symbol on BITSTAMP 4h interval. The Parabolic SAR was recalculated when the trend direction changed. Therefore, I had to implement a lagging version of PSAR on top of the default PSAR calculation. With this release, you can observe that the default PSAR is lagging PSAR for the indicator. In other words, the PSAR value generated with TradingView's built-in functionality was causing the PSAR value not to be persistent when the trend direction changed. Now, with the lagging PSAR, the value of PSAR is persistent when the direction changes. Therefore, it provides more reliable signals and better visualisation. The default lagging PSAR line colours are now yellow and fuchsia.


Release Notes:
  • TradingView PSAR calculation is fast-oriented. The issue was identified at 2024-06-02 20:00 UTC and 2024-06-03 00:00 UTC candles at the BTCUSD symbol on the BITSTAMP 4h interval.
  • PSAR calculation customised for lagging functionality
  • Lagging PSAR will be used for trend change indications
  • Position entry price is now lagging PSAR
  • PSAR Max Multiplier merged with PSAR Max and it removed
  • Lagging PSAR plot added (now default)
  • Despite the implementation of Lagging PSAR, PSAR was kept intact for debugging purposes and community to understand the difference
  • Entry buy condition changed to crossover(high, psar_lagging)
  • Entry sell condition changed to crossunder(low, psar_lagging)
  • Exit-Buy and Exit-Sell plots and signals implemented. There have been a significant amount of questions regarding exiting on position direction change. Therefore, it was necessary to make the FIFO principle more obvious for the strategy.
Bill Williams IndicatorsbuysignalParabolic Stop and Reverse (PSAR)psarreentrysellsignalsignaltakeprofittrendTrend Analysistrendtrading

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?


Também em:

Aviso legal