StefanReich

Pullback Analyzer

StefanReich ที่อัปเดต:   
Pullback Analyzer - a trailing stop helper.

This indicator measures the biggest pullback encountered during an up or down move.
You can use the reported percentages to fine-tune your trailing stop.

The reporting is very precise: On higher timeframes, the pullback size can sometimes not be determined exactly from the candles.
In this case, the script displays a lower and upper bound for this number.
I suggest that you use the upper bound as your trailing stop callback rate (plus some safety margin if you like).

The size of the move itself is always reported as a lower bound.

The biggest pullback within each move is marked with a gray dotted line.

There is only one parameter, "lookback"' (or lookback limit), which determines how many bars a single move can comprise. A value of 50 was found to be a nice default. If you lower the lookback, long moves will be split up into multiple moves, each being at or below the lookback limit. Conversely, you can capture longer moves in one piece by raising the lookback limit.

The algorithm automatically ignores small moves and trading ranges near a bigger move. (We may add a parameter to control this behavior more precisely in the future.)

How the algorithm works

There is a central class called MoveFinder which scans the candle feed for the biggest possible move in a certain direction (up or down).

Two instances of this class are used, one for each direction, to find the biggest next up and down move simultaneously (upFinder and downFinder).

Additionally, each of these main MoveFinders contains two more MoveFinders. These are used to find pullbacks within the move. (This comes from the observation that finding a pullback is fundamentally the exact same operation as finding a move, just with opposing direction and limited to the time between the move's beginning and end.)

Why two nested MoveFinders per parent (for a total of 6 in the program)? Well, one of them runs in "lower bound" and one runs in "upper bound" mode, so we can print the detected pullback size as an exact interval (lower bound <= real pullback <= upper bound). I am a mathematician. I like precision.

Moves as well as pullbacks that have been found are stored as instances of class Move which simply stores start and end bar index as well as start and end price.
เอกสารเผยแพร่:
Fixed a bug in the script that sometimes showed a wrong pullback value. Changed increment for lookback value to 10 which I think is more practical.
เอกสารเผยแพร่:
Added a "forex mode", i.e. an option to show percentages as pips. :) Selecting this mode also improves the label placement for low volatility assets such as forex pairs.
เอกสารเผยแพร่:
Added an option to show move sizes in points. Added an option to not show pullbacks. Added an option to show beginning and end price of each move.

สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?