<html><head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Advanced Financial Instrument Analysis</title>

<style>

:root {

  --primary-color: #1e2a3a;

  --secondary-color: #2c3e50;

  --accent-color: #3498db;

  --text-color: #ecf0f1;

  --positive-color: #2ecc71;

  --negative-color: #e74c3c;

  --neutral-color: #f39c12;

}


* {

  box-sizing: border-box;

  margin: 0;

  padding: 0;

}


body {

  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  background-color: var(--primary-color);

  color: var(--text-color);

  line-height: 1.6;

}


.container {

  display: flex;

  height: 100vh;

}


.sidebar {

  width: 250px;

  background-color: var(--secondary-color);

  padding: 20px;

  overflow-y: auto;

  border-right: 1px solid var(--accent-color);

  display: flex;

  flex-direction: column;

}


.main-content {

  flex: 1;

  padding: 20px;

  overflow-y: auto;

  display: flex;

  flex-direction: column;

}


h2, h3 {

  margin-bottom: 15px;

  color: var(--accent-color);

}


ul {

  list-style-type: none;

}


li {

  margin-bottom: 10px;

}


button {

  width: 100%;

  padding: 10px;

  background-color: var(--accent-color);

  color: var(--text-color);

  border: none;

  border-radius: 5px;

  cursor: pointer;

  transition: all 0.3s ease;

  font-weight: bold;

  display: flex;

  align-items: center;

  justify-content: flex-start;

}


button:hover {

  background-color: #2980b9;

  transform: translateY(-2px);

  box-shadow: 0 4px 8px rgba(0,0,0,0.2);

}


button.active {

  background-color: #2ecc71;

}


button i {

  margin-right: 8px;

  font-size: 1.2em;

}


#tradingviewWidget, #argentineDashboard {

  height: 100%;

  margin-bottom: 20px;

  border-radius: 10px;

  overflow: hidden;

  box-shadow: 0 4px 15px rgba(0,0,0,0.1);

}


#argentineDashboard {

  display: none;

  background-color: var(--secondary-color);

  padding: 20px;

  overflow-y: auto;

}


.widget-container {

  display: flex;

  gap: 20px;

  height: 30vh;

}


#relevantData, #gptAssistant {

  flex: 1;

  background-color: var(--secondary-color);

  padding: 20px;

  border-radius: 10px;

  box-shadow: 0 4px 15px rgba(0,0,0,0.1);

  transition: all 0.3s ease;

  overflow-y: auto;

}


#relevantData:hover, #gptAssistant:hover {

  transform: translateY(-5px);

  box-shadow: 0 6px 20px rgba(0,0,0,0.15);

}


.performance-grid {

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 10px;

}


.performance-item {

  background-color: rgba(255, 255, 255, 0.1);

  padding: 10px;

  border-radius: 5px;

  text-align: center;

}


.performance-value {

  font-size: 1.2em;

  font-weight: bold;

}


.performance-period {

  font-size: 0.8em;

  opacity: 0.8;

}


.positive {

  color: var(--positive-color);

}


.negative {

  color: var(--negative-color);

}


#gptAssistant {

  display: flex;

  flex-direction: column;

}


#gptAssistantContent {

  flex-grow: 1;

  overflow-y: auto;

  background-color: rgba(255, 255, 255, 0.05);

  padding: 15px;

  border-radius: 5px;

}


.currency-box {

  background-color: rgba(255, 255, 255, 0.1);

  border-radius: 10px;

  padding: 15px;

  margin-bottom: 15px;

}


.currency-title {

  font-size: 1.2em;

  font-weight: bold;

  margin-bottom: 10px;

}


.currency-value {

  font-size: 1.5em;

  font-weight: bold;

}


.currency-change {

  font-size: 0.9em;

}


.argentina-button {

  margin-top: auto;

}


@media (max-width: 768px) {

  .container {

    flex-direction: column;

  }

  

  .sidebar {

    width: 100%;

    height: auto;

  }

  

  .widget-container {

    flex-direction: column;

    height: auto;

  }


  #tradingviewWidget, #argentineDashboard {

    height: 50vh;

  }


  #relevantData, #gptAssistant {

    height: 30vh;

  }

}

</style>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">

</head>

<body>

<div class="container">

  <div class="sidebar">

    <ul>

      <li><h3>Cryptocurrencies</h3>

        <ul>

          <li><button onclick="updateInstrument('BTCUSD')"><i class="fab fa-bitcoin"></i>BTCUSD</button></li>

          <li><button onclick="updateInstrument('ETHUSD')"><i class="fab fa-ethereum"></i>ETHUSD</button></li>

          <li><button onclick="updateInstrument('USDTUSD')"><i class="fas fa-dollar-sign"></i>USDTUSD</button></li>

        </ul>

      </li>

      <li><h3>Stocks</h3>

        <ul>

          <li><button onclick="updateInstrument('GOOGL')"><i class="fab fa-google"></i>Google (GOOGL)</button></li>

          <li><button onclick="updateInstrument('NVDA')"><i class="fas fa-microchip"></i>NVIDIA (NVDA)</button></li>

          <li><button onclick="updateInstrument('AAPL')"><i class="fab fa-apple"></i>Apple (AAPL)</button></li>

          <li><button onclick="updateInstrument('MSFT')"><i class="fab fa-microsoft"></i>Microsoft (MSFT)</button></li>

          <li><button onclick="updateInstrument('AMZN')"><i class="fab fa-amazon"></i>Amazon (AMZN)</button></li>

          <li><button onclick="updateInstrument('TSLA')"><i class="fas fa-car"></i>Tesla (TSLA)</button></li>

          <li><button onclick="updateInstrument('MELI')"><i class="fas fa-shopping-cart"></i>MercadoLibre (MELI)</button></li>

        </ul>

      </li>

    </ul>

    <button class="argentina-button" onclick="toggleArgentineDashboard()"><i class="fas fa-flag"></i>Argentine Instruments Dashboard</button>

  </div>

  <div class="main-content">

    <div id="tradingviewWidget"></div>

    <div id="argentineDashboard">

      <div class="currency-box">

        <div class="currency-title">Banco Nacion Dollar</div>

        <div class="currency-value">$960</div>

        <div class="currency-change positive">+0.10%</div>

      </div>

      <div class="currency-box">

        <div class="currency-title">Tourist Dollar</div>

        <div class="currency-value">$1,536</div>

        <div class="currency-change positive">+0.10%</div>

      </div>

      <div class="currency-box">

        <div class="currency-title">Free Dollar</div>

        <div class="currency-value">$1,350</div>

        <div class="currency-change positive">+0.37%</div>

      </div>

      <div class="currency-box">

        <div class="currency-title">Contado con Liqui</div>

        <div class="currency-value">$1,269.33</div>

        <div class="currency-change positive">+0.02%</div>

      </div>

      <div class="currency-box">

        <div class="currency-title">MEP Dollar</div>

        <div class="currency-value">$1,267.90</div>

        <div class="currency-change positive">+0.01%</div>

      </div>

      <div class="currency-box">

        <div class="currency-title">Country Risk</div>

        <div class="currency-value">1493</div>

        <div class="currency-change positive">+1.54%</div>

      </div>

      <div class="currency-box">

        <div class="currency-title">AL30 Bond</div>

        <div class="currency-value">$45,820</div>

        <div class="currency-change negative">-0.39%</div>

      </div>

      <div class="currency-box">

        <div class="currency-title">GD30 Bond</div>

        <div class="currency-value">$41,700</div>

        <div class="currency-change positive">+0.24%</div>

      </div>

    </div>

    <div class="widget-container">

      <div id="relevantData">

        <h3>Performance</h3>

        <div class="performance-grid" id="performanceGrid"></div>

      </div>

      <div id="gptAssistant">

        <div id="gptAssistantContent"></div>

      </div>

    </div>

  </div>

</div>


<script src="https://s3.tradingview.com/tv.js"></script>

<script>

let widget;

let currentSymbol;


function createTradingViewWidget(symbol) {

  if (widget) {

    widget.remove();

  }

  

  widget = new TradingView.widget({

    "width": "100%",

    "height": "100%",

    "symbol": symbol,

    "interval": "D",

    "timezone": "Etc/UTC",

    "theme": "dark",

    "style": "1",

    "locale": "en",

    "toolbar_bg": "#f1f3f6",

    "enable_publishing": false,

    "allow_symbol_change": true,

    "container_id": "tradingviewWidget"

  });

}


function updatePerformanceData(symbol) {

  const performanceGrid = document.getElementById('performanceGrid');

  

  // Simulated data, in a real application this would come from an API

  const data = {

    'BTCUSD': [8.42, -7.70, -8.40, 14.59, 41.45, 104.91],

    'ETHUSD': [5.20, -10.30, -15.60, 8.70, 35.20, 95.40],

    'USDTUSD': [0.01, 0.02, -0.01, 0.03, 0.05, 0.10],

    'GOOGL': [2.10, 5.40, 8.70, 15.30, 22.60, 45.80],

    'NVDA': [4.30, 8.20, 12.50, 25.70, 55.40, 180.20],

    'AAPL': [1.80, 3.50, 6.20, 10.40, 18.70, 38.50],

    'MSFT': [2.50, 4.80, 7.90, 13.60, 24.30, 50.70],

    'AMZN': [3.20, 6.70, 10.80, 18.90, 32.50, 68.40],

    'TSLA': [5.60, -3.20, 15.40, 30.70, 60.20, 120.50],

    'MELI': [3.80, 7.50, 12.30, 22.60, 40.80, 85.30],

  };

  

  const periods = ['1D', '1W', '1M', '3M', '6M', '1Y'];

  const instrumentData = data[symbol] || Array(6).fill(0);

  

  performanceGrid.innerHTML = '';

  

  instrumentData.forEach((value, index) => {

    const itemClass = value >= 0 ? 'positive' : 'negative';

    performanceGrid.innerHTML += `

      <div class="performance-item">

        <div class="performance-value ${itemClass}">${value.toFixed(2)}%</div>

        <div class="performance-period">${periods[index]}</div>

      </div>

    `;

  });

}


function updateGPTAssistant(symbol) {

  const gptAssistantContent = document.getElementById('gptAssistantContent');

  

  // Simulated API call to get analysis

  const analysis = getAnalysis(symbol);

  

  gptAssistantContent.innerHTML = `

    <h4>Technical Analysis:</h4>

    <p>${analysis.technical}</p>

    <h4>Recent News:</h4>

    <p>${analysis.news}</p>

    <h4>Comparison with Similar Instruments:</h4>

    <p>${analysis.comparison}</p>

  `;

}


function getAnalysis(symbol) {

  // This is a simplified simulation of an API response

  const analyses = {

    'BTCUSD': {

      technical: 'Bitcoin shows a short-term bullish trend, with the price surpassing the 50-day moving average. The RSI indicates overbought conditions.',

      news: '15/06/2023: SEC approves several spot Bitcoin ETFs, which could increase institutional demand.',

      comparison: 'Bitcoin outperforms Ethereum in terms of market capitalization, but Ethereum shows higher growth in DeFi adoption.'

    },

    'ETHUSD': {

      technical: 'Ethereum is in a lateral channel, with support at $1800 and resistance at $2000. The MACD suggests a possible bullish impulse.',

      news: '10/06/2023: Ethereum successfully completes the "Shapella" upgrade, allowing staking withdrawals.',

      comparison: 'Ethereum leads in transaction volume and DeFi adoption compared to other blockchains like Solana and Cardano.'

    },

    'USDTUSD': {

      technical: 'Tether maintains its parity with the dollar, with minimal fluctuations. Market capitalization continues to grow.',

      news: '20/06/2023: Tether announces a full audit by one of the Big Four accounting firms.',

      comparison: 'USDT maintains its position as the most used stablecoin, surpassing USDC and BUSD in transaction volume.'

    },

    'GOOGL': {

      technical: 'Google shows a bullish trend, breaking the $120 resistance. Trading volume supports the movement.',

      news: '18/06/2023: Google announces new generative AI tools for its productivity suite.',

      comparison: 'Google outperforms Microsoft in advertising revenue growth but lags in cloud services.'

    },

    'NVDA': {

      technical: 'NVIDIA is in overbought territory according to the RSI, but maintains strong bullish momentum. Approaching psychological resistance levels.',

      news: '22/06/2023: NVIDIA introduces a new line of GPUs optimized for AI and deep learning.',

      comparison: 'NVIDIA leads the GPU market for AI, outperforming competitors like AMD and Intel in performance and adoption.'

    },

    'AAPL': {

      technical: 'Apple is approaching all-time highs, with a bullish flag pattern forming. The MACD shows positive divergence.',

      news: '05/06/2023: Apple introduces its new mixed reality device, the Apple Vision Pro.',

      comparison: 'Apple maintains its position as the highest market cap company, surpassing Microsoft and Amazon.'

    },

    'MSFT': {

      technical: 'Microsoft shows a sustained bullish trend, with the price above all major moving averages.',

      news: '13/06/2023: Microsoft integrates ChatGPT into all its Office 365 applications.',

      comparison: 'Microsoft leads in cloud services growth, outperforming Amazon AWS and Google Cloud.'

    },

    'AMZN': {

      technical: 'Amazon has formed a double bottom, indicating a possible bullish reversal. Trading volume increases on upswings.',

      news: '25/06/2023: Amazon announces a major expansion of its drone delivery network.',

      comparison: 'Amazon maintains its e-commerce dominance but faces growing competition from Walmart in the United States.'

    },

    'TSLA': {

      technical: 'Tesla is in a lateral trend, consolidating after a strong rise. Bollinger Bands are narrowing, suggesting an important move is coming.',

      news: '30/06/2023: Tesla announces significant advances in solid-state batteries.',

      comparison: 'Tesla leads in electric vehicle sales but faces growing competition from traditional manufacturers and Chinese startups.'

    },

    'MELI': {

      technical: 'MercadoLibre shows a bullish trend, surpassing the $1200 resistance. The RSI indicates overbought conditions.',

      news: '28/06/2023: MercadoLibre expands its financial services to more Latin American countries.',

      comparison: 'MercadoLibre dominates e-commerce in Latin America, outperforming local competitors and Amazon in the region.'

    },

  };

  

  return analyses[symbol] || {

    technical: 'No technical analysis available for this instrument.',

    news: 'No recent news available for this instrument.',

    comparison: 'No comparisons available for this instrument.'

  };

}


function updateInstrument(symbol) {

  currentSymbol = symbol;

  document.getElementById('tradingviewWidget').style.display = 'block';

  document.getElementById('argentineDashboard').style.display = 'none';

  document.querySelector('.widget-container').style.display = 'flex';

  createTradingViewWidget(symbol);

  updatePerformanceData(symbol);

  updateGPTAssistant(symbol);

  

  // Update active button

  const buttons = document.querySelectorAll('button');

  buttons.forEach(button => button.classList.remove('active'));

  event.target.classList.add('active');

}


function toggleArgentineDashboard() {

  const tradingviewWidget = document.getElementById('tradingviewWidget');

  const argentineDashboard = document.getElementById('argentineDashboard');

  const widgetContainer = document.querySelector('.widget-container');

  

  if (argentineDashboard.style.display === 'none') {

    tradingviewWidget.style.display = 'none';

    argentineDashboard.style.display = 'block';

    widgetContainer.style.display = 'none';

  } else {

    tradingviewWidget.style.display = 'block';

    argentineDashboard.style.display = 'none';

    widgetContainer.style.display = 'flex';

  }

  

  // Update active button

  const buttons = document.querySelectorAll('button');

  buttons.forEach(button => button.classList.remove('active'));

  event.target.classList.add('active');

}


// Initialize with BTCUSD

document.addEventListener('DOMContentLoaded', function() {

  updateInstrument('BTCUSD');

});

</script>

</body></html>