RagingRocketBull

SadLittleThings Price Compare With Offset MTF by RRB

SadLittleThings Price Compare With Offset MTF by RagingRocketBull 2018
Version 1.0

This indicator lets you compare multiple assets across different timeframes, supports offsets and alpha multipliers.
Standard TradingView Compare doesn't have Offset/Timeframe/Multiplier options, hence this indicator.

Features:
- compare current asset's price with 2 custom ext OHLC sources
- plot sources as lines/bars/candles
- use offset:
- for lines - both positive/negative offsets, unlimited
- for bars/candles - only positive offsets <= 5000
- specify timeframe for each source
- uses timeframe textbox instead of input resolution dropdown to allow for 240 120 and other custom TFs
- support for timeframes in H: H, 2H, 4H etc
- show/hide sources
- colorize sources
- convert source price to 1000s, mlns, or blns using alpha multiplier
- total bars counter

Notes on using offsets:
- Max offset is defined by study max_bars_back which is limited to 5000 for free accounts. This variable specifies the number of history bars an indicator can access.
- if you see the 'internal server study error' => one of the indexes of ohlc series is out of bounds (i.e. close) => decrease the offset <= 5000 or switch to line type
- you will be limited only by the total number of bars in history (n) +/- 1 full screen of empty bars
- you can't scroll past the beginning of history - 1 empty screen and past the end of history + 1 empty screen to be able to still see the line with applied offset
- before applying a large offset, scroll back long enough to make sure you have enough history loaded
- if you have a long history the indicator will get slower, its UI less responsive. Reloading the page may fix that.
- you will not see source's history past the beginning of the current asset - open the chart with the longest history first (i.e. BLX, not COINBASE)
- Make sure that the Left Price Scale shows up with Auto Fit Data enabled. You can reattach the indicator to a different scale in Style.
- you may not be able to plot intraday TFs < current TF, because free accounts are limited to TFs >= D1 (i.e. D, 2D, 3D, W), but you can still plot, say, H4+ on a lower TF H1 chart

1. uses plot*, security, change
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?