[ AlgoChart ] - Compare MarketIndicator Description:
This indicator allows you to display a second asset, selectable from the input panel, in a separate window. Plotted on the same time scale as the first asset but with a distinct price scale, the indicator enables analysis of the relationships and relative movements of two financial instruments. It’s an ideal tool for understanding whether two assets move in a correlated or divergent manner.
Key Features:
Multi-Asset Comparison: Display two assets simultaneously to compare their trends.
Custom Scale: Each asset uses its own price scale, making comparative analysis easier.
Intuitive Interface: Easily select the second asset through the input panel.
Operational Applications:
Spread Trading: Identify optimal moments to execute spread trades when two highly correlated instruments move in opposite directions.
Supply & Demand: Pinpoint zones of interest on both assets, increasing the validity of support and resistance areas.
Exposure Reduction: Monitor instruments that move similarly to avoid exposing the portfolio in identical directions, thereby reducing the risk of double losses.
Additional Features:
Candle Color Change: When a directional divergence occurs between the two assets, the candles change color to highlight the event.
Customizable Notifications: Receive instant alerts when a divergence occurs, allowing you to act promptly.
Comparecandles
Overlay Mini Plot(s) of Correlated Asset(s)Overlay a small plot of a correlated asset of your choosing. Shrink/expand, Set vertical and horizontal position, plot multiple mini-plots via duplicate indicators with varied settings.
Plots the last X bars of any asset; including the live candle currently painting
Useful for low time frame trading when you want to see correlated asset price movement right alongside the price movement you're watching.
Useful for quick and simple comparisons; when you don't want the clutter of split screen or multi-pane view.
Useful for backtesting.
Price scale agnostic; just plots the shape of the recent price action, with several optional labels: Asset+timeframe | Live Price | Highest price over X bars | Lowest price over X bars.
Works fine with all the assets i've tested it on.
~~User inputs~~
-number of bars to paint.
-horizontal offset: plot to right X bars or to left X bars
-vertical offset: shift up or down, shrink or expand; by using 2 'spacer' inputs
-color/transparancy of candles and price labels.
-width (pixels) of candle bodies.
-choose to display price labels or not
-choose to display asset label or not
~~Tips~~
--Add several of these indicators; changing the vertical 'Shift/Shrink' settings on each to visually separate them.
--In the above chart or EurUsd, there are three indicators =>> three mini-plots overlaid: DXY, EurGbp and GbpUsd. Using the following settings for Space Above:Space Below: DXY- 0.1:4.5 | EurGbp- 1.8:1.8 | GbpUsd- 4.5:0.1
--the more you add, the more you'll have to vertically shrink the plots
© twingall
Advanced Comparison ToolWith the new Pine Script features you can build pretty interesting scripts.
Here is my try to expand functionality of basic comparison tool you have in TradingView.
When you apply it on your chart you can select a bar when do you want to start comparing your instrument from.
In parameters you can specify up to 32 symbols to compare. You can also disable symbols and change color for them as well.
As a result you'll see a table with summary and line for every instrument you selected as if it started from the close of the selected bar.
Disclaimer.
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice