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が提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?