OPEN-SOURCE SCRIPT

Peterbolic SAR

Cập nhật
The Peterbolic SAR indicator is based on Peter Brandt's 3 Day Trailing Stop Rule. The yellow triangles indicate setup candles, and the green and red triangles represent trigger candles to buy and sell, respectively.

Sawcruhteez asked me to create the code for this SAR. Gabriel Harber came up with the name for the SAR. Peter Brandt gave his permission to use his name.

For more information, see Sawcruhteez Streamz: Live Coaching Sessionz with Gabriel Harber - Trading Peterbolic SAR

and Peter Brandt's original description of the 3DTSR
Phát hành các Ghi chú
Overview

The Peterbolic SAR was developed using the 3 Day Rule that Peter Brandt outlined on page 50 of Diary of a Commodity Trader.

Below is the exact quote from the book:

“The first step to the exit strategy is to identify the highest day of the move (bull trend). Of course, it will change as new highs are made. The high day in the Dow was August 28 (2009). The setup day occurs on any day a market closes below the low of the high day. This occurred on August 31. The trigger and exit then takes place when the low of the setup day is penetrated. This occurred on September 1.”

If it is a bear trend then the setup occurs any day a market closes above the high of the low day. The trigger then takes place when the high of the setup day is penetrated. Note that Peter uses this on the daily chart but we have found it to be very useful on all time frames.

It was designed as a trailing stop loss system, but I believe it can be used as a SAR (Stop And Reversal). Instead of simply exiting a position this can be used to signal a full reversal (cover long & immediately go short or cover short and immediately go long). As a result it has been named the Peterbolic SAR instead of the 3 Day Rule.

As a result if trading this system one would expect to always be either long or short. Nevertheless that isn’t how it has to be traded. It would certainly be feasible to only take long signals when the trend is bullish and vice versa. It can also be used exclusively as a stop loss, as Peter intended.

In the past Sawcruhteez has relied on Welles Wilder’s Parabolic SAR to trail stop losses but has never been able to use that as a full Stop and Reversal system, as Welles intended. After preliminary backtesting Sawcruhteez is inclined to believe that the Peterbolic SAR will be a better way to trail stops as well as being a profitable to signal entries in the opposite direction.

Signals

Yellow triangle is the setup. If it is below the candle it is a buy setup. If it is above the candle it is a sell setup.

Red triangle is the sell trigger. Green triangle is the buy trigger.

If a setup is not followed by a trigger then there is no exit or entry signaled. Signals only occur on the trigger. Note that the trigger does not require a close above or below the setup, those levels only need to be penetrated intra candle. Therefore hard stop losses can be placed after the setup occurs.

If it is a sell setup then a stop loss for longs can be entered one tick below the low of the setup candle. If it is a buy setup then a hard stop loss for shorts can be placed one tick above the high of the setup candle.

If trading as a full Stop And Reversal then stop loss orders would be entered for 200% of the current position size. On the large majority of crypto exchanges this would close out the existing position and enter equal exposure in the other direction, otherwise known as flipping the position.
Phát hành các Ghi chú
Fix - The labels for style options "Target to Sell", "Setup to Sell", "Target to Buy", and "Setup to Buy" have been corrected
Phát hành các Ghi chú
Fix for a bug that Sawcruhteez found
Issue #3

Description of bug

Say there's a downtrend with a setup candle in play. If, in a candle following the setup candle, there is first a price that triggers an uptrend and then a price that is higher than the previous high for the downtrend, then this is treated as a new high for the downtrend instead of as a trigger for the change to an uptrend.

Newly implemented rule

If a trigger happens in a candle, even if there's a new extreme point, too, then the candle is a trigger candle and the trend changes

Import tool

This release also includes an import tool written in Rust that allows the PineScript functions to be maintained separately from template scripts. I run this import tool to generate the released scripts. Anywhere there's a line with an import statement in the templates, a function is plugged in from a function file
peterbolicSARsawcruhteezTrend Analysis

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?


Ngoài ra, trên:

Thông báo miễn trừ trách nhiệm