LeviathanCapital

Tweet/X Post Timestamp - By Leviathan

LeviathanCapital Mis à jour   
This script allows you to generate visual timestamps of X/Twitter posts directly on your chart, highlighting the precise moment an X post/tweet was made. All you have to do is copy and paste the post URL.

◽️ Use Cases:
- News Trading: Traders can use this indicator to visually align market price actions with news or announcements made on X (formerly Twitter), aiding in the analysis of news impact on market volatility.
- Behavioral Analysis: Traders studying the influence of social media on price can use the timestamps to track correlations between specific posts and market reactions.
- Proof of Predictions: Traders can use this indicator to timestamp their market forecasts shared on X (formerly Twitter), providing a visual record of their predictions relative to actual market movements. This feature allows for transparent verification of the timing and accuracy of their analyses

◽️ Process of Timestamp Calculation
The calculation of the timestamp from a tweet ID involves the following steps:
Extracting the Post ID:
The script first parses the input URL provided by the user to extract the unique ID of the tweet or X post. This ID is embedded in the URL and is crucial for determining the exact posting time.
Calculating the Timestamp:
The post ID undergoes a mathematical transformation known as a right shift by 22 bits. This operation aligns the ID's timestamp to a base reference time used by the platform.
Adding Base Offset:
The result from the right shift is then added to a base offset timestamp (1288834974657 ms, the epoch used by Twitter/X). This converts the processed ID into a UNIX timestamp reflecting the exact moment the post was made.
Date-Time Conversion:
The UNIX timestamp is further broken down into conventional date and time components (year, month, day, hour, minute, second) using calculations that account for leap years and varying days per month.
Label Placement:
Based on user settings, labels displaying the timestamp, username, and other optional information such as price changes or pivot points are dynamically placed on the chart at the bar corresponding to the timestamp.
Notes de version:
Minor error fixed
Notes de version:
Minor errors fixed

Register to support free indicators:
BYBIT: partner.bybit.com/b/Leviathan
WOO X: referral.woo.org/7MY2
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?