This Pine Script is a test script that calculates the export price (รับซื้อ) of Gold 96.5% purity in Thai Baht (THB). It uses the bid price for gold (XAUUSD) and the bid price for the Thai Baht (USDTHB) to estimate the price, which is then displayed in a table on the chart. The displayed price is rounded to the nearest multiple of 10 THB for a cleaner look.
1/ Key Features:
- Price Calculation (Test Formula): The export price is calculated based on the bid prices of gold and USD/THB using a test formula that includes the purity factor (0.965) and export percentage (0.49).
2/ Rounded to Nearest 10:
- The calculated price is rounded to the nearest 10 THB. For example:
If the price is 39,914, it rounds down to 39,910.
If the price is 39,916, it rounds up to 39,920.
3/Customizable Table Display:
- Users can adjust the table position (Top Right, Top Left, Bottom Right, Bottom Left) and customize the text size, text color, and background color.
4/Table Output:
- The rounded export price is displayed in a clean format with comma-separated thousands for better readability.
Important Note:
This is a test script for experimental purposes only and is not guaranteed to reflect the actual price of gold. It uses high/low prices as proxies for the bid/ask, which may not be accurate for real-time pricing. The values are updated every minute based on market data. Use this script at your own discretion as it may not reflect real market conditions and should not be relied upon for financial decisions.