taylor_o

two_leg_spread_returns_zscore

taylor_o ที่อัปเดต:   
This script helps assess the relative returns of each leg in a two-legged spread. It shows the z-score of each period's returns, along with a moving average of the difference between the two returns. A negative moving average implies that the second leg is strengthening, on a relative return basis, against the first leg, and vice versa. The inputs are:

- timeframe: the timeframe for the calculations. the default is five minutes.
- leg1_sym: the symbol for the first leg
- leg2_sym: the symbol for the second leg
- ma_length: the length of the moving average. by default it is 48, or the previous four hours, given the default timeframe.

The default symbols are RB and HO, simply as an example of an intercommodity spread.
เอกสารเผยแพร่:
- made lines transparent so they don't block each other
- added 0 line
เอกสารเผยแพร่:
- set background faint pink if returns have different signs
เอกสารเผยแพร่:
- colored background faint blue if leg1 advances while leg 2 declines, and orange if leg 2 advances and leg 1 declines
เอกสารเผยแพร่:
- moving average line is blue if above 0 (leg1 returns strengthening relative to leg 2), orange if below (opposite).
สคริปต์โอเพนซอร์ซ

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

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

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

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