AmosTradingSystem

Correlation prix [SP500, TESLA, BTC

Before you see this post I want to thank all the TradingView team. Every day that passes I learn better and better to use Pine script and I owe this to all those who publish and to the philosophy of TradingView. Thanks from Amos

This trading indicator compares the prices of the S&P 500 Index (SP500), Tesla (TSLA), and Bitcoin (BTC) to find correlations between them. To make the prices of SP500 and Tesla comparable to the price of Bitcoin, the indicator multiplies the closing price of Tesla by 114 and the closing price of the S&P 500 Index by 5.6.
In this way we can superimpose the prices on the BTC chart and see what happens.

Average BTC price/ tesla price = 114, so if we multiply the tesla price by 114 times we can superimpose it on the BTC price
At average BTC/SPX price = 5.6, also in this case we multiply the price of SPX by 5.6 to overlay the graph and see any correlations.

The indicator then calculates the average price between SP500 and Tesla, using the formula (SP500 + Tesla) / 2. This calculation creates a new line on the chart that represents the average price between these two assets.
The BTC_SP_TE variable is then calculated as the average of the closing price of Bitcoin and the previously calculated average price of SP500 and Tesla, using the formula (Btc + SP_TE) / 2. This calculation creates another line on the chart that represents the average price between Bitcoin and the previously calculated average between SP500 and Tesla.

The idea behind calculating these averages is to find correlations and patterns between the prices of these assets, which can help identify potential trading opportunities. By comparing the average prices of different assets, the trader can look for trends and patterns that might not be apparent when looking at each asset individually.
The indicator plots these prices on a chart and fills the area between them with either green or fuchsia, depending on which one is higher. The strategy suggests buying Bitcoin when the average price of SP500 and Tesla is higher than the current price of Bitcoin, and selling when it is lower.
To add visual cues to the trading strategy, the indicator uses the plotchar function to display a small triangle below the chart when it detects a potential buying opportunity. This is done with the following parameters:

Value: BTC_SP_TE < Btc and Btc > Btc1 and Btc1 > Btc, which is a logical expression that checks whether the average price of SP500 and Tesla is less than the current price of Bitcoin (BTC_SP_TE < Btc), and whether the current price of Bitcoin is higher than the price 10 bars ago (Btc > Btc1) and higher than the price on the previous bar (Btc1 > Btc).
Text: "Moyen BTC_SP_Te", which is the text to display inside the marker.

Symbol: "▲", which is the symbol to use for the marker. In this case, it is a small triangle pointing upwards.

Location: location.belowbar, which specifies that the marker should be placed below the bar.


I hope this is an example of how to create an indicator on TradingView, remember that correlations do not always last, it is possible that when you see the graph this correspondence no longer exists, do your studies and get inspired.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?