franzb0

Join data and union of 2 hystorical markets


How to create a union from two contiguous Tradingview tickers (series)

Francesco Marzolo March 18, 2021


Go to the older ticker of the two, for example CME: SP1! and open it on Tradingview.

On the graph thus created, add this script.

In the indicator settings select the same ticker as the chart in Symbol1

while in Symbol2 the ticker from which to retrieve the most recent data, for example: SPX500


The operation this script does is examine each bar of the two tickers, where there is a value for the second it holds this one, where it does not exist in second ticker it keeps the value of the first one. This new series is called Merge. So now in the chart there will be 4 series:

- that of the original chart without script
- the same series loaded via script (Symbol1)
- series 2 of "new" data (Symbol2)
- the Merge series that "prefers" the Symbol2 data if present, otherwise it shows Symbol1

So now you have to change the visibility of the 4 series to see the differences:

- turn off the visibility of the chart indicator
- turn off the Symbol1 series in the script properties (old data only)
- switch off the Symbol2 series as well (only new data)
- switch on the Merge series (new data if existing, old if not present in the new ticker)



Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?