<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:yandex="http://news.yandex.ru" xmlns:turbo="http://turbo.yandex.ru" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Analyse Terminal</title>
    <link>https://bitradyx.com</link>
    <description/>
    <language>ru</language>
    <lastBuildDate>Thu, 20 Aug 2026 14:03:55 +0300</lastBuildDate>
    <item turbo="true">
      <title>ETH Analyse Terminal</title>
      <link>https://bitradyx.com/tpost/iokh78bbh1-eth-analyse-terminal</link>
      <amplink>https://bitradyx.com/tpost/iokh78bbh1-eth-analyse-terminal?amp=true</amplink>
      <pubDate>Mon, 26 Jan 2026 19:04:00 +0300</pubDate>
      <turbo:content><![CDATA[<header><h1>ETH Analyse Terminal</h1></header><div class="t-redactor__text">Дождитесь загрузки данных</div><div class="t-redactor__embedcode"><style>
/* ===== BITRADYX UNIFIED TERMINAL v0.9 (Strategy + Position) ===== */

.bx-wrap{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:24px;
  color:#d1d5db;
  font-family:Inter, Arial, sans-serif;
  max-width:1100px;
}

/* HEADER */
.bx-top{
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
  gap:12px;
}
.bx-title{
  font-size:20px;
  font-weight:800;
  color:#f59e0b;
}
.bx-sub,
.bx-right{
  font-size:12px;
  opacity:0.7;
}

/* CHIPS */
.bx-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 18px;
}
.bx-chip{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:999px;
  padding:5px 11px;
  font-size:12px;
  font-weight:600;
}
.bx-dot{ width:7px;height:7px;border-radius:50%; display:inline-block; margin-right:6px; vertical-align:middle; }
.dot-blue{ background:#3b82f6; }
.dot-yellow{ background:#f59e0b; }
.dot-green{ background:#22c55e; }
.dot-red{ background:#ef4444; }
.dot-gray{ background:#6b7280; }

/* GRID */
.bx-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:14px;
}
@media(max-width:900px){
  .bx-grid{ grid-template-columns:1fr; }
}

/* CARDS */
.bx-card{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:14px;
}
.bx-h{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.6;
  margin-bottom:6px;
}
.bx-text{
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}

/* SCENARIOS */
.bx-scenarios{ display:grid; gap:10px; }
.sc{
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:12px 12px 12px 18px;
  position:relative;
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}
.sc:before{
  content:"";
  position:absolute;
  left:0; top:10px; bottom:10px;
  width:3px; border-radius:6px;
}
.sc.green:before{ background:#22c55e; }
.sc.red:before{ background:#ef4444; }

/* POSITION PANEL */
.bx-pos-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:12px;
}
@media(max-width:900px){
  .bx-pos-grid{ grid-template-columns:1fr 1fr; }
}
@media(max-width:520px){
  .bx-pos-grid{ grid-template-columns:1fr; }
}
.bx-kpi{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:10px 12px;
}
.bx-kpi .k{
  font-size:11px;
  color:#9aa0aa;
  margin-bottom:4px;
}
.bx-kpi .v{
  font-size:16px;
  font-weight:800;
}
.pnl-pos{ color:#22c55e; }
.pnl-neg{ color:#ef4444; }
.risk-low{ color:#22c55e; }
.risk-medium{ color:#f59e0b; }
.risk-high{ color:#fb7185; }
.risk-critical{ color:#ef4444; }
.adv{ color:#f59e0b; font-size:18px; font-weight:900; }
.sub{ font-size:11px; color:#9aa0aa; margin-top:2px; }

.bx-section{
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,0.06);
  padding-top:10px;
}

.bx-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  border-radius:10px;
  background:#121622;
  margin-bottom:6px;
  font-size:13px;
}
.bx-row strong{ font-weight:800; }
.bx-row.start{ background:#1a1f2f; }
.bx-row.mkt{
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.04)
  );
}

.bx-action{
  margin-top:14px;
  border:1px solid #1f1f1f;
  background:#0b0b0b;
  border-radius:14px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.bx-action .label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.65;
}
.bx-action .text{
  font-size:14px;
  font-weight:800;
}
.bx-pill{
  border:1px solid #1f1f1f;
  background:#111;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
  color:#f59e0b;
}

/* LIVE CHART */
.bx-livechart{
  border:1px solid #1f1f1f;
  border-radius:14px;
  padding:10px;
  margin-top:24px;
}
.bx-livechart-inner{
  width:100%;
  height:620px;
  overflow:hidden;
}
@media(max-width:768px){
  .bx-livechart-inner{ height:420px; }
}

/* FOOT */
.bx-foot{
  margin-top:18px;
  font-size:13px;
  opacity:0.85;
  white-space:pre-wrap;
}
.tradingview-widget-copyright{
  display:none;
}
</style>

<div class="bx-wrap">

  <!-- HEADER -->
  <div class="bx-top">
    <div>
      <div class="bx-title" id="bx-title">—</div>
      <div class="bx-sub">Unified Terminal · Bitradyx Analyse Department</div>
    </div>
    <div class="bx-right" id="bx-tf">Таймфрейм: —</div>
  </div>

  <!-- STATUS CHIPS -->
  <div class="bx-chips">
    <div class="bx-chip"><span class="bx-dot dot-blue"></span>Фаза: <b id="bx-phase">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-yellow"></span>Контекст: <b id="bx-context">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-green"></span>Цена в момент анализа: <b id="bx-price">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-red"></span>Сопротивление / Поддержка: <b id="bx-zones">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-gray"></span>Strategy: <b id="bx-strategy-name">—</b></div>
  </div>

  <!-- STRATEGY BRAIN -->
  <div class="bx-grid">
    <div class="bx-card">
      <div class="bx-h">Текущее состояние</div>
      <div class="bx-text" id="bx-state">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">План действий</div>
      <div class="bx-text" id="bx-plan">—</div>
    </div>

    <div class="bx-card">
      <div class="bx-h">Триггеры подтверждения</div>
      <div class="bx-text" id="bx-triggers">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">Что не делать</div>
      <div class="bx-text" id="bx-dont">—</div>
    </div>
  </div>

  <!-- SCENARIOS -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Сценарии развития</div>
    <div class="bx-scenarios">
      <div class="sc green" id="bx-scn-main">—</div>
      <div class="sc red" id="bx-scn-alt">—</div>
    </div>
  </div>

  <!-- POSITION CONTROL -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Position Control</div>

    <div class="bx-pos-grid" id="bx-pos-kpis">
      <div class="bx-kpi">
        <div class="k">Market Price</div>
        <div class="v" id="px-market">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Break-Even Zone</div>
        <div class="v" id="px-be">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Unrealized PnL</div>
        <div class="v" id="px-pnl">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Position Advantage</div>
        <div class="v adv" id="px-adv">—</div>
        <div class="sub" id="px-adv-sub">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Risk</div>
        <div class="v" id="px-risk">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Stage</div>
        <div class="v" id="px-stage">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Days in Position</div>
        <div class="v" id="px-days">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Volatility Rank</div>
        <div class="v" id="px-vol">—</div>
      </div>
    </div>

    <div class="bx-action">
      <div>
        <div class="label">Next Action</div>
        <div class="text" id="px-action">—</div>
      </div>
      <div class="bx-pill" id="px-action-tag">—</div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Entry & Risk Management</div>
      <div id="px-levels">
        <!-- dynamic -->
      </div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Profit Targets</div>
      <div id="px-profits">
        <!-- dynamic -->
      </div>
    </div>
  </div>

  <!-- LIVE CHART -->
  <div class="bx-livechart">
    <div class="bx-livechart-inner">
      <div class="tradingview-widget-container" style="height:100%;width:100%">
        <div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div>
        <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async>
        {
          "allow_symbol_change": true,
          "calendar": false,
          "details": true,
          "hide_side_toolbar": true,
          "hide_top_toolbar": false,
          "hide_legend": false,
          "hide_volume": true,
          "hotlist": false,
          "interval": "D",
          "locale": "ru",
          "save_image": true,
          "style": "3",
          "symbol": "BINANCE:ETHUSD",
          "theme": "dark",
          "timezone": "Etc/UTC",
          "backgroundColor": "#0F0F0F",
          "gridColor": "rgba(242, 242, 242, 0.06)",
          "studies": ["STD;Stochastic_RSI"],
          "autosize": true
        }
        </script>
      </div>
    </div>
  </div>

  <div class="bx-foot" id="bx-footnote">—</div>
</div>

<script>
/* ===== CONFIG ===== */
/* ===== URL PARAMS ===== */
function getParam(name){
  const url = new URL(window.location.href);
  return url.searchParams.get(name);
}
const CURRENT_SYMBOL = getParam("symbol") || "ETH";
const CURRENT_SIGNAL = getParam("signal"); // опционально, но правильно оставить

// Strategy (your existing terminal API)
const STRATEGY_API = "https://script.google.com/macros/s/AKfycbzg-xxRgVMFvX5muejb32hIZVL4Oqmqa7qk2LKFVML-e8kwC0DvthIExbYrAbmEu4TxIA/exec";

// Position (your dashboard/orders API)
const POSITION_API = "https://script.google.com/macros/s/AKfycbw82Q3d9emTXtdDYJbxw5RbY1UJzTva-IsaWj69rM88q1-pJX8ycywL2VT7SehwpXlS/exec";

const TERMINAL = {
  symbol: CURRENT_SYMBOL,
  strategy: null,
  orders: null
};

/* ===== HELPERS ===== */
function fmtNum(x, d=2){
  const n = Number(x);
  if(!isFinite(n)) return "—";
  return n.toFixed(d);
}
function daysSince(dateStr){
  const t = Date.parse(dateStr);
  if(!isFinite(t)) return "—";
  const diff = Date.now() - t;
  return Math.max(0, Math.floor(diff / (1000*60*60*24)));
}
function riskClass(r){
  const rr = (r || "").toLowerCase();
  if(rr === "low") return "risk-low";
  if(rr === "medium") return "risk-medium";
  if(rr === "high") return "risk-high";
  if(rr === "critical") return "risk-critical";
  return "";
}
function pnlClass(v){
  const n = Number(v);
  if(!isFinite(n)) return "";
  return n >= 0 ? "pnl-pos" : "pnl-neg";
}

/* Build aggregated position from rows */
function buildPosition(rows){
  if(!rows || !rows.length) return null;

  // We assume rows already filtered to 1 symbol + Open
  const first = rows[0];

  // levels
  const levels = { Start: undefined };
  for(const r of rows){
    const type = String(r["Order Type"] || "").trim();
    const price = Number(r["Entry Price"]);
    if(!isFinite(price)) continue;

    if(type === "Starting order"){
      levels.Start = (levels.Start === undefined) ? price : Math.max(levels.Start, price);
    }
    const m = type.match(/Doubling\s*(\d+)/i);
    if(m){
      const k = "D" + m[1];
      levels[k] = (levels[k] === undefined) ? price : Math.min(levels[k], price);
    }
  }

  // stage/risk/targets
  const stage = rows.reduce((mx, r) => Math.max(mx, Number(r.Stage) || 0), 0);

  return {
    symbol: first.Symbol,
    strategy: first.Strategy,
    market: Number(first.Market),
    avg: Number(first.Avg),
    pnl: Number(first["PnL %"]),
    risk: first.Risk,
    vol: first["Volatility Rank"],
    stage,
    startDate: first["Date Start"] || first["Start Date"],
    tp1: first.TP1, tp2: first.TP2, tp3: first.TP3,
    typDeal: first["Typ_Deal"],
    levels
  };
}

function getNextAction(p){
  if(!p) return {text:"—", tag:"—"};

  const market = Number(p.market);
  const be = Number(p.avg);
  const stage = Number(p.stage) || 0;

  // find next doubling level (smallest Dn above market? or below? Here: closest below market as "next add" if price drops)
  let nextDoubling = null;
  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl === undefined) continue;
    if(nextDoubling === null) nextDoubling = {i, lvl};
    else if(lvl > nextDoubling.lvl) nextDoubling = {i, lvl}; // highest doubling price as "nearest" to market (usually D1 > D2 > ...)
  }

  if(isFinite(market) && isFinite(be)){
    const diffPct = ((be - market) / be) * 100; // below BE -> positive
    if(market >= be){
      return { text:"Risk decreasing · Above Break-Even", tag:"SAFE ZONE" };
    }
    if(diffPct <= 8){
      return { text:"Near Break-Even · Keep discipline", tag:"ALMOST BE" };
    }
    if(stage >= 3){
      return { text:"Advanced stage · Avoid panic · Follow plan", tag:"STAGE "+stage };
    }
    if(nextDoubling){
      return { text:`Hold · Watch Doubling ${nextDoubling.i} zone`, tag:"WATCH D"+nextDoubling.i };
    }
    return { text:"Hold · Waiting for confirmation", tag:"HOLD" };
  }

  return { text:"Hold", tag:"HOLD" };
}

function tryRender(){
  if(!TERMINAL.strategy || !TERMINAL.orders) return;
  renderTerminal(TERMINAL.strategy, TERMINAL.orders);
}

/* ===== LOAD STRATEGY ===== */
fetch(STRATEGY_API)
  .then(r => r.json())
  .then(data => {
    const d = data.instruments?.[TERMINAL.symbol];
    TERMINAL.strategy = d || null;
    tryRender();
  })
  .catch(()=>{ TERMINAL.strategy = null; tryRender(); });

/* ===== LOAD POSITION ===== */
fetch(POSITION_API)
  .then(r => r.json())
  .then(rows => {
    // Filter: Open + symbol starts with CURRENT_SYMBOL (ETH matches ETH/USDT)
    const filtered = (rows || []).filter(o => {
      const sym = String(o.Symbol || "");
      return sym.startsWith(TERMINAL.symbol) && String(o.Status || "").toLowerCase() === "open";
    });
    // Group by Symbol (if you ever have ETH/USDT and ETH/BTC - take first group)
    const bySymbol = {};
    filtered.forEach(r => {
      bySymbol[r.Symbol] = bySymbol[r.Symbol] || [];
      bySymbol[r.Symbol].push(r);
    });
    const firstKey = Object.keys(bySymbol)[0];
    TERMINAL.orders = firstKey ? bySymbol[firstKey] : [];
    tryRender();
  })
  .catch(()=>{ TERMINAL.orders = []; tryRender(); });

/* ===== RENDER ===== */
function renderTerminal(strategyData, ordersRows){
  // STRATEGY
  if(strategyData){
    document.getElementById("bx-title").innerText = strategyData.Symbol + " / USD";
    document.getElementById("bx-tf").innerText = "Таймфрейм: " + (strategyData.TF || "—");
    document.getElementById("bx-phase").innerText = strategyData.Phase || "—";
    document.getElementById("bx-context").innerText = strategyData.Context || "—";
    document.getElementById("bx-price").innerText = strategyData.Reference_Price ?? "—";
    document.getElementById("bx-zones").innerText = (strategyData["Resistance Zone"] ?? "—") + " / " + (strategyData["Support Zone"] ?? "—");

    document.getElementById("bx-state").innerText = strategyData.STATE || "—";
    document.getElementById("bx-plan").innerText = strategyData.PLAN || "—";
    document.getElementById("bx-triggers").innerText = strategyData.TRIGGERS || "—";
    document.getElementById("bx-dont").innerText = strategyData.DONT || "—";

    document.getElementById("bx-scn-main").innerText = strategyData.SCENARIO_MAIN || "—";
    document.getElementById("bx-scn-alt").innerText = strategyData.SCENARIO_ALT || "—";

    document.getElementById("bx-footnote").innerText = strategyData.FOOTNOTE || "—";
  } else {
    document.getElementById("bx-title").innerText = TERMINAL.symbol + " / USD";
    document.getElementById("bx-footnote").innerText = "Strategy data not found for this symbol.";
  }

  // POSITION
  const p = buildPosition(ordersRows);
  document.getElementById("bx-strategy-name").innerText = p?.strategy || "—";

  if(!p){
    document.getElementById("px-market").innerText = "—";
    document.getElementById("px-be").innerText = "—";
    document.getElementById("px-pnl").innerText = "—";
    document.getElementById("px-adv").innerText = "—";
    document.getElementById("px-adv-sub").innerText = "—";
    document.getElementById("px-risk").innerText = "—";
    document.getElementById("px-stage").innerText = "—";
    document.getElementById("px-days").innerText = "—";
    document.getElementById("px-vol").innerText = "—";
    document.getElementById("px-action").innerText = "No open position for this symbol.";
    document.getElementById("px-action-tag").innerText = "—";
    document.getElementById("px-levels").innerHTML = `<div class="bx-row"><span>No levels</span><span>—</span></div>`;
    document.getElementById("px-profits").innerHTML = `<div class="bx-row"><span>No targets</span><span>—</span></div>`;
    return;
  }

  const market = Number(p.market);
  const be = Number(p.avg);
  const advPct = (isFinite(market) && isFinite(be)) ? ((be - market)/be*100) : NaN;

  document.getElementById("px-market").innerText = fmtNum(market, 2);
  document.getElementById("px-be").innerText = fmtNum(be, 2);

  const pnlEl = document.getElementById("px-pnl");
  pnlEl.innerText = isFinite(p.pnl) ? (fmtNum(p.pnl,2) + "%") : "—";
  pnlEl.className = "v " + pnlClass(p.pnl);

  document.getElementById("px-adv").innerText = isFinite(advPct) ? (fmtNum(Math.abs(advPct),2) + "%") : "—";
  document.getElementById("px-adv-sub").innerText = "Better entry vs current market";

  const riskEl = document.getElementById("px-risk");
  riskEl.innerText = p.risk || "—";
  riskEl.className = "v " + riskClass(p.risk);

  document.getElementById("px-stage").innerText = p.stage ?? "—";
  document.getElementById("px-days").innerText = daysSince(p.startDate);
  document.getElementById("px-vol").innerText = (p.vol !== undefined && p.vol !== null) ? fmtNum(p.vol, 2) : "—";

  const act = getNextAction(p);
  document.getElementById("px-action").innerText = act.text;
  document.getElementById("px-action-tag").innerText = act.tag;

  // ENTRY LEVELS (your requested order):
  // Risk-Free Zone, Current Market Price, Starting Order, Doubling 1..5
  let levelsHTML = "";
  levelsHTML += `<div class="bx-row start"><span>Risk-Free Zone</span><strong>${fmtNum(be,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row mkt"><span>Current Market Price</span><strong>${fmtNum(market,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row"><span>Starting Order</span><strong>${p.levels.Start !== undefined ? fmtNum(p.levels.Start,2) : "—"}</strong></div>`;

  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl !== undefined){
      levelsHTML += `<div class="bx-row"><span>Doubling Level ${i}</span><strong>${fmtNum(lvl,2)}</strong></div>`;
    }
  }

  document.getElementById("px-levels").innerHTML = levelsHTML || `<div class="bx-row"><span>No levels</span><span>—</span></div>`;

  // PROFIT TARGETS (Target scenario + TP1-TP3)
  const tp1 = p.tp1 ?? "—";
  const tp2 = p.tp2 ?? "—";
  const tp3 = p.tp3 ?? "—";
  const tpsHTML = `
    <div class="bx-row"><span>Target Scenario</span><strong>${p.typDeal || "—"}</strong></div>
    <div class="bx-row"><span>Take Profit 1</span><strong>${tp1}</strong></div>
    <div class="bx-row"><span>Take Profit 2</span><strong>${tp2}</strong></div>
    <div class="bx-row"><span>Take Profit 3</span><strong>${tp3}</strong></div>
  `;
  document.getElementById("px-profits").innerHTML = tpsHTML;
}
</script>
</div><div class="t-redactor__embedcode"><style>
/* Увеличиваем ширину контейнера поста в Потоках */
.t-feed__post-popup__container {
    max-width: 1200px !important; /* Установите нужную ширину (стандарт — около 900px) */
    width: 95% !important;
}

/* При необходимости можно также расширить текстовый контент внутри */
.t-feed__post-popup__content {
    max-width: 100% !important;
}
</style></div><hr style="color: #000000;"><h2  class="t-redactor__h2">Инструкция по работе с аналитическим терминалом Bitradyx</h2><h3  class="t-redactor__h3">1️⃣ Что вы видите в терминале</h3><div class="t-redactor__text">Терминал — это <strong>аналитический обзор рынка</strong>, а не автоматический торговый сигнал.</div><div class="t-redactor__text">Каждый инструмент (ETH, XRP, BTC и т.д.) содержит:</div><div class="t-redactor__text"><ul><li data-list="bullet">текущее состояние рынка</li><li data-list="bullet">ключевые зоны поддержки и сопротивления</li><li data-list="bullet">сценарии развития</li><li data-list="bullet">рекомендации <em>что делать и чего не делать</em></li><li data-list="bullet">живой график TradingView для визуального контроля</li></ul></div><h3  class="t-redactor__h3">2️⃣ Как открыть анализ по инструменту</h3><div class="t-redactor__text"><ol><li data-list="ordered">На странице выберите нужный актив (ETH, XRP, BTC и др.)</li><li data-list="ordered">Нажмите кнопку <strong>«Открыть анализ»</strong></li><li data-list="ordered">Откроется PopUp с полноценным терминалом по выбранному инструменту</li></ol></div><div class="t-redactor__text">Каждый PopUp — это <strong>отдельный анализ конкретного актива</strong>.</div><h3  class="t-redactor__h3">3️⃣ Как читать блоки терминала</h3><h4  class="t-redactor__h4">🔹 Фаза</h4><div class="t-redactor__text">Показывает текущее состояние рынка:</div><div class="t-redactor__text"><ul><li data-list="bullet">Диапазон (Range)</li><li data-list="bullet">Тренд</li><li data-list="bullet">Импульс</li><li data-list="bullet">Слом структуры</li></ul></div><div class="t-redactor__text">Это <strong>контекст</strong>, а не точка входа.</div><h4  class="t-redactor__h4">🔹 Контекст</h4><div class="t-redactor__text">Объясняет, <em>почему рынок находится в текущей фазе</em></div><div class="t-redactor__text"> (после импульса, после слома структуры, накопление и т.д.)</div><h4  class="t-redactor__h4">🔹 Цена в момент анализа</h4><div class="t-redactor__text">Цена актива <strong>на момент подготовки аналитики</strong>.</div><div class="t-redactor__text"> Она используется как ориентир, а не как торговый сигнал.</div><h4  class="t-redactor__h4">🔹 Поддержка / Сопротивление</h4><div class="t-redactor__text">Ключевые <strong>зоны принятия решений</strong>, а не точные уровни входа.</div><div class="t-redactor__text">❗ Важно:</div><div class="t-redactor__text"> Входы рассматриваются <strong>только после подтверждения</strong>, а не «на касание».</div><h3  class="t-redactor__h3">4️⃣ Основные текстовые блоки</h3><h4  class="t-redactor__h4">🧠 Текущее состояние</h4><div class="t-redactor__text">Краткое описание рыночной структуры:</div><div class="t-redactor__text"><ul><li data-list="bullet">где находится цена</li><li data-list="bullet">есть ли тренд</li><li data-list="bullet">присутствует ли давление покупателей / продавцов</li></ul></div><h4  class="t-redactor__h4">📌 План действий</h4><div class="t-redactor__text">Логика поведения трейдера:</div><div class="t-redactor__text"><ul><li data-list="bullet">в каких условиях рассматривать вход</li><li data-list="bullet">когда лучше ждать</li><li data-list="bullet">какие действия приоритетны</li></ul></div><h4  class="t-redactor__h4">⚡ Триггеры подтверждения</h4><div class="t-redactor__text">Что должно произойти, <strong>чтобы рынок стал рабочим</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">закрепление</li><li data-list="bullet">объём</li><li data-list="bullet">ускорение</li><li data-list="bullet">слом диапазона</li></ul></div><div class="t-redactor__text">Без этих условий <strong>действий не предпринимается</strong>.</div><h4  class="t-redactor__h4">⛔ Что не делать</h4><div class="t-redactor__text">Самый важный блок для сохранения депозита:</div><div class="t-redactor__text"><ul><li data-list="bullet">где нельзя входить</li><li data-list="bullet">чего нельзя усреднять</li><li data-list="bullet">какие действия считаются ошибочными</li></ul></div><h3  class="t-redactor__h3">5️⃣ Сценарии развития</h3><div class="t-redactor__text">В терминале всегда минимум <strong>два сценария</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet"><strong>Основной сценарий</strong> — более вероятный</li><li data-list="bullet"><strong>Альтернативный сценарий</strong> — защитный</li></ul></div><div class="t-redactor__text">Рынок не обязан идти по прогнозу.</div><div class="t-redactor__text"> Задача — <strong>быть готовым к обоим вариантам</strong>.</div><h3  class="t-redactor__h3">6️⃣ График TradingView</h3><div class="t-redactor__text">В нижней части терминала расположен <strong>живой график</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">полностью синхронизирован с текущим рынком</li><li data-list="bullet">используется для визуального подтверждения аналитики</li><li data-list="bullet">позволяет самостоятельно проверить уровни и реакцию цены</li></ul></div><h3  class="t-redactor__h3">7️⃣ Важно помнить</h3><div class="t-redactor__text"><ul><li data-list="bullet">Терминал <strong>не даёт сигналов «купи / продай сейчас»</strong></li><li data-list="bullet">Аналитика обновляется <strong>только по тем инструментам, где есть активная работа</strong></li><li data-list="bullet">Решения принимаются <strong>только после подтверждения рынка</strong></li></ul></div><blockquote class="t-redactor__callout t-redactor__callout_fontSize_default" style="background: #EBEBEB; color: #000000;">
                                <div class="t-redactor__callout-icon" style="color: #ff0000">
                                    <svg width="24" height="24" role="img" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24">
                                        <circle cx="12.125" cy="12.125" r="12" style="fill:currentColor"/>
                                        <path d="M10.922 6.486c0-.728.406-1.091 1.217-1.091s1.215.363 1.215 1.091c0 .347-.102.617-.304.81-.202.193-.507.289-.911.289-.811 0-1.217-.366-1.217-1.099zm2.33 11.306h-2.234V9.604h2.234v8.188z" style="fill:#fff"/>
                                    </svg>
                                </div>
                                <div class="t-redactor__callout-text">
                                     <strong>Дисклеймер</strong><br />Аналитика носит информационный характер и не является инвестиционной рекомендацией.<br />Ответственность за торговые решения лежит на трейдере.
                                </div>
                            </blockquote>]]></turbo:content>
    </item>
    <item turbo="true">
      <title>XRP Analyse Terminal</title>
      <link>https://bitradyx.com/tpost/d3idrfp0k1-xrp-analyse-terminal</link>
      <amplink>https://bitradyx.com/tpost/d3idrfp0k1-xrp-analyse-terminal?amp=true</amplink>
      <pubDate>Mon, 26 Jan 2026 19:05:00 +0300</pubDate>
      <turbo:content><![CDATA[<header><h1>XRP Analyse Terminal</h1></header><div class="t-redactor__text">Дождитесь загрузки данных </div><div class="t-redactor__embedcode"><style>
/* ===== BITRADYX UNIFIED TERMINAL v0.9 (Strategy + Position) ===== */

.bx-wrap{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:24px;
  color:#d1d5db;
  font-family:Inter, Arial, sans-serif;
  max-width:1100px;
}

/* HEADER */
.bx-top{
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
  gap:12px;
}
.bx-title{
  font-size:20px;
  font-weight:800;
  color:#f59e0b;
}
.bx-sub,
.bx-right{
  font-size:12px;
  opacity:0.7;
}

/* CHIPS */
.bx-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 18px;
}
.bx-chip{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:999px;
  padding:5px 11px;
  font-size:12px;
  font-weight:600;
}
.bx-dot{ width:7px;height:7px;border-radius:50%; display:inline-block; margin-right:6px; vertical-align:middle; }
.dot-blue{ background:#3b82f6; }
.dot-yellow{ background:#f59e0b; }
.dot-green{ background:#22c55e; }
.dot-red{ background:#ef4444; }
.dot-gray{ background:#6b7280; }

/* GRID */
.bx-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:14px;
}
@media(max-width:900px){
  .bx-grid{ grid-template-columns:1fr; }
}

/* CARDS */
.bx-card{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:14px;
}
.bx-h{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.6;
  margin-bottom:6px;
}
.bx-text{
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}

/* SCENARIOS */
.bx-scenarios{ display:grid; gap:10px; }
.sc{
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:12px 12px 12px 18px;
  position:relative;
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}
.sc:before{
  content:"";
  position:absolute;
  left:0; top:10px; bottom:10px;
  width:3px; border-radius:6px;
}
.sc.green:before{ background:#22c55e; }
.sc.red:before{ background:#ef4444; }

/* POSITION PANEL */
.bx-pos-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:12px;
}
@media(max-width:900px){
  .bx-pos-grid{ grid-template-columns:1fr 1fr; }
}
@media(max-width:520px){
  .bx-pos-grid{ grid-template-columns:1fr; }
}
.bx-kpi{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:10px 12px;
}
.bx-kpi .k{
  font-size:11px;
  color:#9aa0aa;
  margin-bottom:4px;
}
.bx-kpi .v{
  font-size:16px;
  font-weight:800;
}
.pnl-pos{ color:#22c55e; }
.pnl-neg{ color:#ef4444; }
.risk-low{ color:#22c55e; }
.risk-medium{ color:#f59e0b; }
.risk-high{ color:#fb7185; }
.risk-critical{ color:#ef4444; }
.adv{ color:#f59e0b; font-size:18px; font-weight:900; }
.sub{ font-size:11px; color:#9aa0aa; margin-top:2px; }

.bx-section{
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,0.06);
  padding-top:10px;
}

.bx-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  border-radius:10px;
  background:#121622;
  margin-bottom:6px;
  font-size:13px;
}
.bx-row strong{ font-weight:800; }
.bx-row.start{ background:#1a1f2f; }
.bx-row.mkt{
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.04)
  );
}

.bx-action{
  margin-top:14px;
  border:1px solid #1f1f1f;
  background:#0b0b0b;
  border-radius:14px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.bx-action .label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.65;
}
.bx-action .text{
  font-size:14px;
  font-weight:800;
}
.bx-pill{
  border:1px solid #1f1f1f;
  background:#111;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
  color:#f59e0b;
}

/* LIVE CHART */
.bx-livechart{
  border:1px solid #1f1f1f;
  border-radius:14px;
  padding:10px;
  margin-top:24px;
}
.bx-livechart-inner{
  width:100%;
  height:620px;
  overflow:hidden;
}
@media(max-width:768px){
  .bx-livechart-inner{ height:420px; }
}

/* FOOT */
.bx-foot{
  margin-top:18px;
  font-size:13px;
  opacity:0.85;
  white-space:pre-wrap;
}
.tradingview-widget-copyright{
  display:none;
}
</style>

<div class="bx-wrap">

  <!-- HEADER -->
  <div class="bx-top">
    <div>
      <div class="bx-title" id="bx-title">—</div>
      <div class="bx-sub">Unified Terminal · Bitradyx Analyse Department</div>
    </div>
    <div class="bx-right" id="bx-tf">Таймфрейм: —</div>
  </div>

  <!-- STATUS CHIPS -->
  <div class="bx-chips">
    <div class="bx-chip"><span class="bx-dot dot-blue"></span>Фаза: <b id="bx-phase">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-yellow"></span>Контекст: <b id="bx-context">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-green"></span>Цена в момент анализа: <b id="bx-price">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-red"></span>Сопротивление / Поддержка: <b id="bx-zones">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-gray"></span>Strategy: <b id="bx-strategy-name">—</b></div>
  </div>

  <!-- STRATEGY BRAIN -->
  <div class="bx-grid">
    <div class="bx-card">
      <div class="bx-h">Текущее состояние</div>
      <div class="bx-text" id="bx-state">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">План действий</div>
      <div class="bx-text" id="bx-plan">—</div>
    </div>

    <div class="bx-card">
      <div class="bx-h">Триггеры подтверждения</div>
      <div class="bx-text" id="bx-triggers">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">Что не делать</div>
      <div class="bx-text" id="bx-dont">—</div>
    </div>
  </div>

  <!-- SCENARIOS -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Сценарии развития</div>
    <div class="bx-scenarios">
      <div class="sc green" id="bx-scn-main">—</div>
      <div class="sc red" id="bx-scn-alt">—</div>
    </div>
  </div>

  <!-- POSITION CONTROL -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Position Control</div>

    <div class="bx-pos-grid" id="bx-pos-kpis">
      <div class="bx-kpi">
        <div class="k">Market Price</div>
        <div class="v" id="px-market">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Break-Even Zone</div>
        <div class="v" id="px-be">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Unrealized PnL</div>
        <div class="v" id="px-pnl">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Position Advantage</div>
        <div class="v adv" id="px-adv">—</div>
        <div class="sub" id="px-adv-sub">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Risk</div>
        <div class="v" id="px-risk">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Stage</div>
        <div class="v" id="px-stage">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Days in Position</div>
        <div class="v" id="px-days">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Volatility Rank</div>
        <div class="v" id="px-vol">—</div>
      </div>
    </div>

    <div class="bx-action">
      <div>
        <div class="label">Next Action</div>
        <div class="text" id="px-action">—</div>
      </div>
      <div class="bx-pill" id="px-action-tag">—</div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Entry & Risk Management</div>
      <div id="px-levels">
        <!-- dynamic -->
      </div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Profit Targets</div>
      <div id="px-profits">
        <!-- dynamic -->
      </div>
    </div>
  </div>

  <!-- LIVE CHART -->
  <div class="bx-livechart">
    <div class="bx-livechart-inner">
      <div class="tradingview-widget-container" style="height:100%;width:100%">
        <div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div>
        <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async>
        {
          "allow_symbol_change": true,
          "calendar": false,
          "details": true,
          "hide_side_toolbar": true,
          "hide_top_toolbar": false,
          "hide_legend": false,
          "hide_volume": true,
          "hotlist": false,
          "interval": "D",
          "locale": "ru",
          "save_image": true,
          "style": "3",
          "symbol": "BINANCE:XRPUSD",
          "theme": "dark",
          "timezone": "Etc/UTC",
          "backgroundColor": "#0F0F0F",
          "gridColor": "rgba(242, 242, 242, 0.06)",
          "studies": ["STD;Stochastic_RSI"],
          "autosize": true
        }
        </script>
      </div>
    </div>
  </div>

  <div class="bx-foot" id="bx-footnote">—</div>
</div>

<script>
/* ===== CONFIG ===== */
/* ===== URL PARAMS ===== */
function getParam(name){
  const url = new URL(window.location.href);
  return url.searchParams.get(name);
}
const CURRENT_SYMBOL = getParam("symbol") || "XRP";
const CURRENT_SIGNAL = getParam("signal"); // опционально, но правильно оставить

// Strategy (your existing terminal API)
const STRATEGY_API = "https://script.google.com/macros/s/AKfycbzg-xxRgVMFvX5muejb32hIZVL4Oqmqa7qk2LKFVML-e8kwC0DvthIExbYrAbmEu4TxIA/exec";

// Position (your dashboard/orders API)
const POSITION_API = "https://script.google.com/macros/s/AKfycbw82Q3d9emTXtdDYJbxw5RbY1UJzTva-IsaWj69rM88q1-pJX8ycywL2VT7SehwpXlS/exec";

const TERMINAL = {
  symbol: CURRENT_SYMBOL,
  strategy: null,
  orders: null
};

/* ===== HELPERS ===== */
function fmtNum(x, d=2){
  const n = Number(x);
  if(!isFinite(n)) return "—";
  return n.toFixed(d);
}
function daysSince(dateStr){
  const t = Date.parse(dateStr);
  if(!isFinite(t)) return "—";
  const diff = Date.now() - t;
  return Math.max(0, Math.floor(diff / (1000*60*60*24)));
}
function riskClass(r){
  const rr = (r || "").toLowerCase();
  if(rr === "low") return "risk-low";
  if(rr === "medium") return "risk-medium";
  if(rr === "high") return "risk-high";
  if(rr === "critical") return "risk-critical";
  return "";
}
function pnlClass(v){
  const n = Number(v);
  if(!isFinite(n)) return "";
  return n >= 0 ? "pnl-pos" : "pnl-neg";
}

/* Build aggregated position from rows */
function buildPosition(rows){
  if(!rows || !rows.length) return null;

  // We assume rows already filtered to 1 symbol + Open
  const first = rows[0];

  // levels
  const levels = { Start: undefined };
  for(const r of rows){
    const type = String(r["Order Type"] || "").trim();
    const price = Number(r["Entry Price"]);
    if(!isFinite(price)) continue;

    if(type === "Starting order"){
      levels.Start = (levels.Start === undefined) ? price : Math.max(levels.Start, price);
    }
    const m = type.match(/Doubling\s*(\d+)/i);
    if(m){
      const k = "D" + m[1];
      levels[k] = (levels[k] === undefined) ? price : Math.min(levels[k], price);
    }
  }

  // stage/risk/targets
  const stage = rows.reduce((mx, r) => Math.max(mx, Number(r.Stage) || 0), 0);

  return {
    symbol: first.Symbol,
    strategy: first.Strategy,
    market: Number(first.Market),
    avg: Number(first.Avg),
    pnl: Number(first["PnL %"]),
    risk: first.Risk,
    vol: first["Volatility Rank"],
    stage,
    startDate: first["Date Start"] || first["Start Date"],
    tp1: first.TP1, tp2: first.TP2, tp3: first.TP3,
    typDeal: first["Typ_Deal"],
    levels
  };
}

function getNextAction(p){
  if(!p) return {text:"—", tag:"—"};

  const market = Number(p.market);
  const be = Number(p.avg);
  const stage = Number(p.stage) || 0;

  // find next doubling level (smallest Dn above market? or below? Here: closest below market as "next add" if price drops)
  let nextDoubling = null;
  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl === undefined) continue;
    if(nextDoubling === null) nextDoubling = {i, lvl};
    else if(lvl > nextDoubling.lvl) nextDoubling = {i, lvl}; // highest doubling price as "nearest" to market (usually D1 > D2 > ...)
  }

  if(isFinite(market) && isFinite(be)){
    const diffPct = ((be - market) / be) * 100; // below BE -> positive
    if(market >= be){
      return { text:"Risk decreasing · Above Break-Even", tag:"SAFE ZONE" };
    }
    if(diffPct <= 8){
      return { text:"Near Break-Even · Keep discipline", tag:"ALMOST BE" };
    }
    if(stage >= 3){
      return { text:"Advanced stage · Avoid panic · Follow plan", tag:"STAGE "+stage };
    }
    if(nextDoubling){
      return { text:`Hold · Watch Doubling ${nextDoubling.i} zone`, tag:"WATCH D"+nextDoubling.i };
    }
    return { text:"Hold · Waiting for confirmation", tag:"HOLD" };
  }

  return { text:"Hold", tag:"HOLD" };
}

function tryRender(){
  if(!TERMINAL.strategy || !TERMINAL.orders) return;
  renderTerminal(TERMINAL.strategy, TERMINAL.orders);
}

/* ===== LOAD STRATEGY ===== */
fetch(STRATEGY_API)
  .then(r => r.json())
  .then(data => {
    const d = data.instruments?.[TERMINAL.symbol];
    TERMINAL.strategy = d || null;
    tryRender();
  })
  .catch(()=>{ TERMINAL.strategy = null; tryRender(); });

/* ===== LOAD POSITION ===== */
fetch(POSITION_API)
  .then(r => r.json())
  .then(rows => {
    // Filter: Open + symbol starts with CURRENT_SYMBOL (ETH matches ETH/USDT)
    const filtered = (rows || []).filter(o => {
      const sym = String(o.Symbol || "");
      return sym.startsWith(TERMINAL.symbol) && String(o.Status || "").toLowerCase() === "open";
    });
    // Group by Symbol (if you ever have ETH/USDT and ETH/BTC - take first group)
    const bySymbol = {};
    filtered.forEach(r => {
      bySymbol[r.Symbol] = bySymbol[r.Symbol] || [];
      bySymbol[r.Symbol].push(r);
    });
    const firstKey = Object.keys(bySymbol)[0];
    TERMINAL.orders = firstKey ? bySymbol[firstKey] : [];
    tryRender();
  })
  .catch(()=>{ TERMINAL.orders = []; tryRender(); });

/* ===== RENDER ===== */
function renderTerminal(strategyData, ordersRows){
  // STRATEGY
  if(strategyData){
    document.getElementById("bx-title").innerText = strategyData.Symbol + " / USD";
    document.getElementById("bx-tf").innerText = "Таймфрейм: " + (strategyData.TF || "—");
    document.getElementById("bx-phase").innerText = strategyData.Phase || "—";
    document.getElementById("bx-context").innerText = strategyData.Context || "—";
    document.getElementById("bx-price").innerText = strategyData.Reference_Price ?? "—";
    document.getElementById("bx-zones").innerText = (strategyData["Resistance Zone"] ?? "—") + " / " + (strategyData["Support Zone"] ?? "—");

    document.getElementById("bx-state").innerText = strategyData.STATE || "—";
    document.getElementById("bx-plan").innerText = strategyData.PLAN || "—";
    document.getElementById("bx-triggers").innerText = strategyData.TRIGGERS || "—";
    document.getElementById("bx-dont").innerText = strategyData.DONT || "—";

    document.getElementById("bx-scn-main").innerText = strategyData.SCENARIO_MAIN || "—";
    document.getElementById("bx-scn-alt").innerText = strategyData.SCENARIO_ALT || "—";

    document.getElementById("bx-footnote").innerText = strategyData.FOOTNOTE || "—";
  } else {
    document.getElementById("bx-title").innerText = TERMINAL.symbol + " / USD";
    document.getElementById("bx-footnote").innerText = "Strategy data not found for this symbol.";
  }

  // POSITION
  const p = buildPosition(ordersRows);
  document.getElementById("bx-strategy-name").innerText = p?.strategy || "—";

  if(!p){
    document.getElementById("px-market").innerText = "—";
    document.getElementById("px-be").innerText = "—";
    document.getElementById("px-pnl").innerText = "—";
    document.getElementById("px-adv").innerText = "—";
    document.getElementById("px-adv-sub").innerText = "—";
    document.getElementById("px-risk").innerText = "—";
    document.getElementById("px-stage").innerText = "—";
    document.getElementById("px-days").innerText = "—";
    document.getElementById("px-vol").innerText = "—";
    document.getElementById("px-action").innerText = "No open position for this symbol.";
    document.getElementById("px-action-tag").innerText = "—";
    document.getElementById("px-levels").innerHTML = `<div class="bx-row"><span>No levels</span><span>—</span></div>`;
    document.getElementById("px-profits").innerHTML = `<div class="bx-row"><span>No targets</span><span>—</span></div>`;
    return;
  }

  const market = Number(p.market);
  const be = Number(p.avg);
  const advPct = (isFinite(market) && isFinite(be)) ? ((be - market)/be*100) : NaN;

  document.getElementById("px-market").innerText = fmtNum(market, 2);
  document.getElementById("px-be").innerText = fmtNum(be, 2);

  const pnlEl = document.getElementById("px-pnl");
  pnlEl.innerText = isFinite(p.pnl) ? (fmtNum(p.pnl,2) + "%") : "—";
  pnlEl.className = "v " + pnlClass(p.pnl);

  document.getElementById("px-adv").innerText = isFinite(advPct) ? (fmtNum(Math.abs(advPct),2) + "%") : "—";
  document.getElementById("px-adv-sub").innerText = "Better entry vs current market";

  const riskEl = document.getElementById("px-risk");
  riskEl.innerText = p.risk || "—";
  riskEl.className = "v " + riskClass(p.risk);

  document.getElementById("px-stage").innerText = p.stage ?? "—";
  document.getElementById("px-days").innerText = daysSince(p.startDate);
  document.getElementById("px-vol").innerText = (p.vol !== undefined && p.vol !== null) ? fmtNum(p.vol, 2) : "—";

  const act = getNextAction(p);
  document.getElementById("px-action").innerText = act.text;
  document.getElementById("px-action-tag").innerText = act.tag;

  // ENTRY LEVELS (your requested order):
  // Risk-Free Zone, Current Market Price, Starting Order, Doubling 1..5
  let levelsHTML = "";
  levelsHTML += `<div class="bx-row start"><span>Risk-Free Zone</span><strong>${fmtNum(be,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row mkt"><span>Current Market Price</span><strong>${fmtNum(market,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row"><span>Starting Order</span><strong>${p.levels.Start !== undefined ? fmtNum(p.levels.Start,2) : "—"}</strong></div>`;

  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl !== undefined){
      levelsHTML += `<div class="bx-row"><span>Doubling Level ${i}</span><strong>${fmtNum(lvl,2)}</strong></div>`;
    }
  }

  document.getElementById("px-levels").innerHTML = levelsHTML || `<div class="bx-row"><span>No levels</span><span>—</span></div>`;

  // PROFIT TARGETS (Target scenario + TP1-TP3)
  const tp1 = p.tp1 ?? "—";
  const tp2 = p.tp2 ?? "—";
  const tp3 = p.tp3 ?? "—";
  const tpsHTML = `
    <div class="bx-row"><span>Target Scenario</span><strong>${p.typDeal || "—"}</strong></div>
    <div class="bx-row"><span>Take Profit 1</span><strong>${tp1}</strong></div>
    <div class="bx-row"><span>Take Profit 2</span><strong>${tp2}</strong></div>
    <div class="bx-row"><span>Take Profit 3</span><strong>${tp3}</strong></div>
  `;
  document.getElementById("px-profits").innerHTML = tpsHTML;
}
</script>
</div><div class="t-redactor__embedcode"><style>
/* Увеличиваем ширину контейнера поста в Потоках */
.t-feed__post-popup__container {
    max-width: 1200px !important; /* Установите нужную ширину (стандарт — около 900px) */
    width: 95% !important;
}

/* При необходимости можно также расширить текстовый контент внутри */
.t-feed__post-popup__content {
    max-width: 100% !important;
}
</style></div><hr style="color: #000000;"><h2  class="t-redactor__h2">Инструкция по работе с аналитическим терминалом Bitradyx</h2><h3  class="t-redactor__h3">1️⃣ Что вы видите в терминале</h3><div class="t-redactor__text">Терминал — это <strong>аналитический обзор рынка</strong>, а не автоматический торговый сигнал.</div><div class="t-redactor__text">Каждый инструмент (ETH, XRP, BTC и т.д.) содержит:</div><div class="t-redactor__text"><ul><li data-list="bullet">текущее состояние рынка</li><li data-list="bullet">ключевые зоны поддержки и сопротивления</li><li data-list="bullet">сценарии развития</li><li data-list="bullet">рекомендации <em>что делать и чего не делать</em></li><li data-list="bullet">живой график TradingView для визуального контроля</li></ul></div><h3  class="t-redactor__h3">2️⃣ Как открыть анализ по инструменту</h3><div class="t-redactor__text"><ol><li data-list="ordered">На странице выберите нужный актив (ETH, XRP, BTC и др.)</li><li data-list="ordered">Нажмите кнопку <strong>«Открыть анализ»</strong></li><li data-list="ordered">Откроется PopUp с полноценным терминалом по выбранному инструменту</li></ol></div><div class="t-redactor__text">Каждый PopUp — это <strong>отдельный анализ конкретного актива</strong>.</div><h3  class="t-redactor__h3">3️⃣ Как читать блоки терминала</h3><h4  class="t-redactor__h4">🔹 Фаза</h4><div class="t-redactor__text">Показывает текущее состояние рынка:</div><div class="t-redactor__text"><ul><li data-list="bullet">Диапазон (Range)</li><li data-list="bullet">Тренд</li><li data-list="bullet">Импульс</li><li data-list="bullet">Слом структуры</li></ul></div><div class="t-redactor__text">Это <strong>контекст</strong>, а не точка входа.</div><h4  class="t-redactor__h4">🔹 Контекст</h4><div class="t-redactor__text">Объясняет, <em>почему рынок находится в текущей фазе</em></div><div class="t-redactor__text"> (после импульса, после слома структуры, накопление и т.д.)</div><h4  class="t-redactor__h4">🔹 Цена в момент анализа</h4><div class="t-redactor__text">Цена актива <strong>на момент подготовки аналитики</strong>.</div><div class="t-redactor__text"> Она используется как ориентир, а не как торговый сигнал.</div><h4  class="t-redactor__h4">🔹 Поддержка / Сопротивление</h4><div class="t-redactor__text">Ключевые <strong>зоны принятия решений</strong>, а не точные уровни входа.</div><div class="t-redactor__text">❗ Важно:</div><div class="t-redactor__text"> Входы рассматриваются <strong>только после подтверждения</strong>, а не «на касание».</div><h3  class="t-redactor__h3">4️⃣ Основные текстовые блоки</h3><h4  class="t-redactor__h4">🧠 Текущее состояние</h4><div class="t-redactor__text">Краткое описание рыночной структуры:</div><div class="t-redactor__text"><ul><li data-list="bullet">где находится цена</li><li data-list="bullet">есть ли тренд</li><li data-list="bullet">присутствует ли давление покупателей / продавцов</li></ul></div><h4  class="t-redactor__h4">📌 План действий</h4><div class="t-redactor__text">Логика поведения трейдера:</div><div class="t-redactor__text"><ul><li data-list="bullet">в каких условиях рассматривать вход</li><li data-list="bullet">когда лучше ждать</li><li data-list="bullet">какие действия приоритетны</li></ul></div><h4  class="t-redactor__h4">⚡ Триггеры подтверждения</h4><div class="t-redactor__text">Что должно произойти, <strong>чтобы рынок стал рабочим</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">закрепление</li><li data-list="bullet">объём</li><li data-list="bullet">ускорение</li><li data-list="bullet">слом диапазона</li></ul></div><div class="t-redactor__text">Без этих условий <strong>действий не предпринимается</strong>.</div><h4  class="t-redactor__h4">⛔ Что не делать</h4><div class="t-redactor__text">Самый важный блок для сохранения депозита:</div><div class="t-redactor__text"><ul><li data-list="bullet">где нельзя входить</li><li data-list="bullet">чего нельзя усреднять</li><li data-list="bullet">какие действия считаются ошибочными</li></ul></div><h3  class="t-redactor__h3">5️⃣ Сценарии развития</h3><div class="t-redactor__text">В терминале всегда минимум <strong>два сценария</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet"><strong>Основной сценарий</strong> — более вероятный</li><li data-list="bullet"><strong>Альтернативный сценарий</strong> — защитный</li></ul></div><div class="t-redactor__text">Рынок не обязан идти по прогнозу.</div><div class="t-redactor__text"> Задача — <strong>быть готовым к обоим вариантам</strong>.</div><h3  class="t-redactor__h3">6️⃣ График TradingView</h3><div class="t-redactor__text">В нижней части терминала расположен <strong>живой график</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">полностью синхронизирован с текущим рынком</li><li data-list="bullet">используется для визуального подтверждения аналитики</li><li data-list="bullet">позволяет самостоятельно проверить уровни и реакцию цены</li></ul></div><h3  class="t-redactor__h3">7️⃣ Важно помнить</h3><div class="t-redactor__text"><ul><li data-list="bullet">Терминал <strong>не даёт сигналов «купи / продай сейчас»</strong></li><li data-list="bullet">Аналитика обновляется <strong>только по тем инструментам, где есть активная работа</strong></li><li data-list="bullet">Решения принимаются <strong>только после подтверждения рынка</strong></li></ul></div><blockquote class="t-redactor__callout t-redactor__callout_fontSize_default" style="background: #EBEBEB; color: #000000;">
                                <div class="t-redactor__callout-icon" style="color: #ff0000">
                                    <svg width="24" height="24" role="img" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24">
                                        <circle cx="12.125" cy="12.125" r="12" style="fill:currentColor"/>
                                        <path d="M10.922 6.486c0-.728.406-1.091 1.217-1.091s1.215.363 1.215 1.091c0 .347-.102.617-.304.81-.202.193-.507.289-.911.289-.811 0-1.217-.366-1.217-1.099zm2.33 11.306h-2.234V9.604h2.234v8.188z" style="fill:#fff"/>
                                    </svg>
                                </div>
                                <div class="t-redactor__callout-text">
                                     <strong>Дисклеймер</strong><br />Аналитика носит информационный характер и не является инвестиционной рекомендацией.<br />Ответственность за торговые решения лежит на трейдере.
                                </div>
                            </blockquote>]]></turbo:content>
    </item>
    <item turbo="true">
      <title>LTC Analyse Terminal</title>
      <link>https://bitradyx.com/tpost/7f2cim0t21-ltc-analyse-terminal</link>
      <amplink>https://bitradyx.com/tpost/7f2cim0t21-ltc-analyse-terminal?amp=true</amplink>
      <pubDate>Fri, 30 Jan 2026 14:42:00 +0300</pubDate>
      <turbo:content><![CDATA[<header><h1>LTC Analyse Terminal</h1></header><div class="t-redactor__text">Дождитесь загрузки данных </div><div class="t-redactor__embedcode"><style>
/* ===== BITRADYX UNIFIED TERMINAL v0.9 (Strategy + Position) ===== */

.bx-wrap{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:24px;
  color:#d1d5db;
  font-family:Inter, Arial, sans-serif;
  max-width:1100px;
}

/* HEADER */
.bx-top{
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
  gap:12px;
}
.bx-title{
  font-size:20px;
  font-weight:800;
  color:#f59e0b;
}
.bx-sub,
.bx-right{
  font-size:12px;
  opacity:0.7;
}

/* CHIPS */
.bx-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 18px;
}
.bx-chip{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:999px;
  padding:5px 11px;
  font-size:12px;
  font-weight:600;
}
.bx-dot{ width:7px;height:7px;border-radius:50%; display:inline-block; margin-right:6px; vertical-align:middle; }
.dot-blue{ background:#3b82f6; }
.dot-yellow{ background:#f59e0b; }
.dot-green{ background:#22c55e; }
.dot-red{ background:#ef4444; }
.dot-gray{ background:#6b7280; }

/* GRID */
.bx-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:14px;
}
@media(max-width:900px){
  .bx-grid{ grid-template-columns:1fr; }
}

/* CARDS */
.bx-card{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:14px;
}
.bx-h{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.6;
  margin-bottom:6px;
}
.bx-text{
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}

/* SCENARIOS */
.bx-scenarios{ display:grid; gap:10px; }
.sc{
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:12px 12px 12px 18px;
  position:relative;
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}
.sc:before{
  content:"";
  position:absolute;
  left:0; top:10px; bottom:10px;
  width:3px; border-radius:6px;
}
.sc.green:before{ background:#22c55e; }
.sc.red:before{ background:#ef4444; }

/* POSITION PANEL */
.bx-pos-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:12px;
}
@media(max-width:900px){
  .bx-pos-grid{ grid-template-columns:1fr 1fr; }
}
@media(max-width:520px){
  .bx-pos-grid{ grid-template-columns:1fr; }
}
.bx-kpi{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:10px 12px;
}
.bx-kpi .k{
  font-size:11px;
  color:#9aa0aa;
  margin-bottom:4px;
}
.bx-kpi .v{
  font-size:16px;
  font-weight:800;
}
.pnl-pos{ color:#22c55e; }
.pnl-neg{ color:#ef4444; }
.risk-low{ color:#22c55e; }
.risk-medium{ color:#f59e0b; }
.risk-high{ color:#fb7185; }
.risk-critical{ color:#ef4444; }
.adv{ color:#f59e0b; font-size:18px; font-weight:900; }
.sub{ font-size:11px; color:#9aa0aa; margin-top:2px; }

.bx-section{
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,0.06);
  padding-top:10px;
}

.bx-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  border-radius:10px;
  background:#121622;
  margin-bottom:6px;
  font-size:13px;
}
.bx-row strong{ font-weight:800; }
.bx-row.start{ background:#1a1f2f; }
.bx-row.mkt{
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.04)
  );
}

.bx-action{
  margin-top:14px;
  border:1px solid #1f1f1f;
  background:#0b0b0b;
  border-radius:14px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.bx-action .label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.65;
}
.bx-action .text{
  font-size:14px;
  font-weight:800;
}
.bx-pill{
  border:1px solid #1f1f1f;
  background:#111;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
  color:#f59e0b;
}

/* LIVE CHART */
.bx-livechart{
  border:1px solid #1f1f1f;
  border-radius:14px;
  padding:10px;
  margin-top:24px;
}
.bx-livechart-inner{
  width:100%;
  height:620px;
  overflow:hidden;
}
@media(max-width:768px){
  .bx-livechart-inner{ height:420px; }
}

/* FOOT */
.bx-foot{
  margin-top:18px;
  font-size:13px;
  opacity:0.85;
  white-space:pre-wrap;
}
.tradingview-widget-copyright{
  display:none;
}
</style>

<div class="bx-wrap">

  <!-- HEADER -->
  <div class="bx-top">
    <div>
      <div class="bx-title" id="bx-title">—</div>
      <div class="bx-sub">Unified Terminal · Bitradyx Analyse Department</div>
    </div>
    <div class="bx-right" id="bx-tf">Таймфрейм: —</div>
  </div>

  <!-- STATUS CHIPS -->
  <div class="bx-chips">
    <div class="bx-chip"><span class="bx-dot dot-blue"></span>Фаза: <b id="bx-phase">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-yellow"></span>Контекст: <b id="bx-context">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-green"></span>Цена в момент анализа: <b id="bx-price">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-red"></span>Сопротивление / Поддержка: <b id="bx-zones">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-gray"></span>Strategy: <b id="bx-strategy-name">—</b></div>
  </div>

  <!-- STRATEGY BRAIN -->
  <div class="bx-grid">
    <div class="bx-card">
      <div class="bx-h">Текущее состояние</div>
      <div class="bx-text" id="bx-state">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">План действий</div>
      <div class="bx-text" id="bx-plan">—</div>
    </div>

    <div class="bx-card">
      <div class="bx-h">Триггеры подтверждения</div>
      <div class="bx-text" id="bx-triggers">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">Что не делать</div>
      <div class="bx-text" id="bx-dont">—</div>
    </div>
  </div>

  <!-- SCENARIOS -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Сценарии развития</div>
    <div class="bx-scenarios">
      <div class="sc green" id="bx-scn-main">—</div>
      <div class="sc red" id="bx-scn-alt">—</div>
    </div>
  </div>

  <!-- POSITION CONTROL -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Position Control</div>

    <div class="bx-pos-grid" id="bx-pos-kpis">
      <div class="bx-kpi">
        <div class="k">Market Price</div>
        <div class="v" id="px-market">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Break-Even Zone</div>
        <div class="v" id="px-be">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Unrealized PnL</div>
        <div class="v" id="px-pnl">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Position Advantage</div>
        <div class="v adv" id="px-adv">—</div>
        <div class="sub" id="px-adv-sub">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Risk</div>
        <div class="v" id="px-risk">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Stage</div>
        <div class="v" id="px-stage">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Days in Position</div>
        <div class="v" id="px-days">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Volatility Rank</div>
        <div class="v" id="px-vol">—</div>
      </div>
    </div>

    <div class="bx-action">
      <div>
        <div class="label">Next Action</div>
        <div class="text" id="px-action">—</div>
      </div>
      <div class="bx-pill" id="px-action-tag">—</div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Entry & Risk Management</div>
      <div id="px-levels">
        <!-- dynamic -->
      </div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Profit Targets</div>
      <div id="px-profits">
        <!-- dynamic -->
      </div>
    </div>
  </div>

  <!-- LIVE CHART -->
  <div class="bx-livechart">
    <div class="bx-livechart-inner">
      <div class="tradingview-widget-container" style="height:100%;width:100%">
        <div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div>
        <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async>
        {
          "allow_symbol_change": true,
          "calendar": false,
          "details": true,
          "hide_side_toolbar": true,
          "hide_top_toolbar": false,
          "hide_legend": false,
          "hide_volume": true,
          "hotlist": false,
          "interval": "D",
          "locale": "ru",
          "save_image": true,
          "style": "3",
          "symbol": "BINANCE:LTCUSD",
          "theme": "dark",
          "timezone": "Etc/UTC",
          "backgroundColor": "#0F0F0F",
          "gridColor": "rgba(242, 242, 242, 0.06)",
          "studies": ["STD;Stochastic_RSI"],
          "autosize": true
        }
        </script>
      </div>
    </div>
  </div>

  <div class="bx-foot" id="bx-footnote">—</div>
</div>

<script>
/* ===== CONFIG ===== */
/* ===== URL PARAMS ===== */
function getParam(name){
  const url = new URL(window.location.href);
  return url.searchParams.get(name);
}
const CURRENT_SYMBOL = getParam("symbol") || "LTC";
const CURRENT_SIGNAL = getParam("signal"); // опционально, но правильно оставить

// Strategy (your existing terminal API)
const STRATEGY_API = "https://script.google.com/macros/s/AKfycbzg-xxRgVMFvX5muejb32hIZVL4Oqmqa7qk2LKFVML-e8kwC0DvthIExbYrAbmEu4TxIA/exec";

// Position (your dashboard/orders API)
const POSITION_API = "https://script.google.com/macros/s/AKfycbw82Q3d9emTXtdDYJbxw5RbY1UJzTva-IsaWj69rM88q1-pJX8ycywL2VT7SehwpXlS/exec";

const TERMINAL = {
  symbol: CURRENT_SYMBOL,
  strategy: null,
  orders: null
};

/* ===== HELPERS ===== */
function fmtNum(x, d=2){
  const n = Number(x);
  if(!isFinite(n)) return "—";
  return n.toFixed(d);
}
function daysSince(dateStr){
  const t = Date.parse(dateStr);
  if(!isFinite(t)) return "—";
  const diff = Date.now() - t;
  return Math.max(0, Math.floor(diff / (1000*60*60*24)));
}
function riskClass(r){
  const rr = (r || "").toLowerCase();
  if(rr === "low") return "risk-low";
  if(rr === "medium") return "risk-medium";
  if(rr === "high") return "risk-high";
  if(rr === "critical") return "risk-critical";
  return "";
}
function pnlClass(v){
  const n = Number(v);
  if(!isFinite(n)) return "";
  return n >= 0 ? "pnl-pos" : "pnl-neg";
}

/* Build aggregated position from rows */
function buildPosition(rows){
  if(!rows || !rows.length) return null;

  // We assume rows already filtered to 1 symbol + Open
  const first = rows[0];

  // levels
  const levels = { Start: undefined };
  for(const r of rows){
    const type = String(r["Order Type"] || "").trim();
    const price = Number(r["Entry Price"]);
    if(!isFinite(price)) continue;

    if(type === "Starting order"){
      levels.Start = (levels.Start === undefined) ? price : Math.max(levels.Start, price);
    }
    const m = type.match(/Doubling\s*(\d+)/i);
    if(m){
      const k = "D" + m[1];
      levels[k] = (levels[k] === undefined) ? price : Math.min(levels[k], price);
    }
  }

  // stage/risk/targets
  const stage = rows.reduce((mx, r) => Math.max(mx, Number(r.Stage) || 0), 0);

  return {
    symbol: first.Symbol,
    strategy: first.Strategy,
    market: Number(first.Market),
    avg: Number(first.Avg),
    pnl: Number(first["PnL %"]),
    risk: first.Risk,
    vol: first["Volatility Rank"],
    stage,
    startDate: first["Date Start"] || first["Start Date"],
    tp1: first.TP1, tp2: first.TP2, tp3: first.TP3,
    typDeal: first["Typ_Deal"],
    levels
  };
}

function getNextAction(p){
  if(!p) return {text:"—", tag:"—"};

  const market = Number(p.market);
  const be = Number(p.avg);
  const stage = Number(p.stage) || 0;

  // find next doubling level (smallest Dn above market? or below? Here: closest below market as "next add" if price drops)
  let nextDoubling = null;
  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl === undefined) continue;
    if(nextDoubling === null) nextDoubling = {i, lvl};
    else if(lvl > nextDoubling.lvl) nextDoubling = {i, lvl}; // highest doubling price as "nearest" to market (usually D1 > D2 > ...)
  }

  if(isFinite(market) && isFinite(be)){
    const diffPct = ((be - market) / be) * 100; // below BE -> positive
    if(market >= be){
      return { text:"Risk decreasing · Above Break-Even", tag:"SAFE ZONE" };
    }
    if(diffPct <= 8){
      return { text:"Near Break-Even · Keep discipline", tag:"ALMOST BE" };
    }
    if(stage >= 3){
      return { text:"Advanced stage · Avoid panic · Follow plan", tag:"STAGE "+stage };
    }
    if(nextDoubling){
      return { text:`Hold · Watch Doubling ${nextDoubling.i} zone`, tag:"WATCH D"+nextDoubling.i };
    }
    return { text:"Hold · Waiting for confirmation", tag:"HOLD" };
  }

  return { text:"Hold", tag:"HOLD" };
}

function tryRender(){
  if(!TERMINAL.strategy || !TERMINAL.orders) return;
  renderTerminal(TERMINAL.strategy, TERMINAL.orders);
}

/* ===== LOAD STRATEGY ===== */
fetch(STRATEGY_API)
  .then(r => r.json())
  .then(data => {
    const d = data.instruments?.[TERMINAL.symbol];
    TERMINAL.strategy = d || null;
    tryRender();
  })
  .catch(()=>{ TERMINAL.strategy = null; tryRender(); });

/* ===== LOAD POSITION ===== */
fetch(POSITION_API)
  .then(r => r.json())
  .then(rows => {
    // Filter: Open + symbol starts with CURRENT_SYMBOL (ETH matches ETH/USDT)
    const filtered = (rows || []).filter(o => {
      const sym = String(o.Symbol || "");
      return sym.startsWith(TERMINAL.symbol) && String(o.Status || "").toLowerCase() === "open";
    });
    // Group by Symbol (if you ever have ETH/USDT and ETH/BTC - take first group)
    const bySymbol = {};
    filtered.forEach(r => {
      bySymbol[r.Symbol] = bySymbol[r.Symbol] || [];
      bySymbol[r.Symbol].push(r);
    });
    const firstKey = Object.keys(bySymbol)[0];
    TERMINAL.orders = firstKey ? bySymbol[firstKey] : [];
    tryRender();
  })
  .catch(()=>{ TERMINAL.orders = []; tryRender(); });

/* ===== RENDER ===== */
function renderTerminal(strategyData, ordersRows){
  // STRATEGY
  if(strategyData){
    document.getElementById("bx-title").innerText = strategyData.Symbol + " / USD";
    document.getElementById("bx-tf").innerText = "Таймфрейм: " + (strategyData.TF || "—");
    document.getElementById("bx-phase").innerText = strategyData.Phase || "—";
    document.getElementById("bx-context").innerText = strategyData.Context || "—";
    document.getElementById("bx-price").innerText = strategyData.Reference_Price ?? "—";
    document.getElementById("bx-zones").innerText = (strategyData["Resistance Zone"] ?? "—") + " / " + (strategyData["Support Zone"] ?? "—");

    document.getElementById("bx-state").innerText = strategyData.STATE || "—";
    document.getElementById("bx-plan").innerText = strategyData.PLAN || "—";
    document.getElementById("bx-triggers").innerText = strategyData.TRIGGERS || "—";
    document.getElementById("bx-dont").innerText = strategyData.DONT || "—";

    document.getElementById("bx-scn-main").innerText = strategyData.SCENARIO_MAIN || "—";
    document.getElementById("bx-scn-alt").innerText = strategyData.SCENARIO_ALT || "—";

    document.getElementById("bx-footnote").innerText = strategyData.FOOTNOTE || "—";
  } else {
    document.getElementById("bx-title").innerText = TERMINAL.symbol + " / USD";
    document.getElementById("bx-footnote").innerText = "Strategy data not found for this symbol.";
  }

  // POSITION
  const p = buildPosition(ordersRows);
  document.getElementById("bx-strategy-name").innerText = p?.strategy || "—";

  if(!p){
    document.getElementById("px-market").innerText = "—";
    document.getElementById("px-be").innerText = "—";
    document.getElementById("px-pnl").innerText = "—";
    document.getElementById("px-adv").innerText = "—";
    document.getElementById("px-adv-sub").innerText = "—";
    document.getElementById("px-risk").innerText = "—";
    document.getElementById("px-stage").innerText = "—";
    document.getElementById("px-days").innerText = "—";
    document.getElementById("px-vol").innerText = "—";
    document.getElementById("px-action").innerText = "No open position for this symbol.";
    document.getElementById("px-action-tag").innerText = "—";
    document.getElementById("px-levels").innerHTML = `<div class="bx-row"><span>No levels</span><span>—</span></div>`;
    document.getElementById("px-profits").innerHTML = `<div class="bx-row"><span>No targets</span><span>—</span></div>`;
    return;
  }

  const market = Number(p.market);
  const be = Number(p.avg);
  const advPct = (isFinite(market) && isFinite(be)) ? ((be - market)/be*100) : NaN;

  document.getElementById("px-market").innerText = fmtNum(market, 2);
  document.getElementById("px-be").innerText = fmtNum(be, 2);

  const pnlEl = document.getElementById("px-pnl");
  pnlEl.innerText = isFinite(p.pnl) ? (fmtNum(p.pnl,2) + "%") : "—";
  pnlEl.className = "v " + pnlClass(p.pnl);

  document.getElementById("px-adv").innerText = isFinite(advPct) ? (fmtNum(Math.abs(advPct),2) + "%") : "—";
  document.getElementById("px-adv-sub").innerText = "Better entry vs current market";

  const riskEl = document.getElementById("px-risk");
  riskEl.innerText = p.risk || "—";
  riskEl.className = "v " + riskClass(p.risk);

  document.getElementById("px-stage").innerText = p.stage ?? "—";
  document.getElementById("px-days").innerText = daysSince(p.startDate);
  document.getElementById("px-vol").innerText = (p.vol !== undefined && p.vol !== null) ? fmtNum(p.vol, 2) : "—";

  const act = getNextAction(p);
  document.getElementById("px-action").innerText = act.text;
  document.getElementById("px-action-tag").innerText = act.tag;

  // ENTRY LEVELS (your requested order):
  // Risk-Free Zone, Current Market Price, Starting Order, Doubling 1..5
  let levelsHTML = "";
  levelsHTML += `<div class="bx-row start"><span>Risk-Free Zone</span><strong>${fmtNum(be,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row mkt"><span>Current Market Price</span><strong>${fmtNum(market,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row"><span>Starting Order</span><strong>${p.levels.Start !== undefined ? fmtNum(p.levels.Start,2) : "—"}</strong></div>`;

  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl !== undefined){
      levelsHTML += `<div class="bx-row"><span>Doubling Level ${i}</span><strong>${fmtNum(lvl,2)}</strong></div>`;
    }
  }

  document.getElementById("px-levels").innerHTML = levelsHTML || `<div class="bx-row"><span>No levels</span><span>—</span></div>`;

  // PROFIT TARGETS (Target scenario + TP1-TP3)
  const tp1 = p.tp1 ?? "—";
  const tp2 = p.tp2 ?? "—";
  const tp3 = p.tp3 ?? "—";
  const tpsHTML = `
    <div class="bx-row"><span>Target Scenario</span><strong>${p.typDeal || "—"}</strong></div>
    <div class="bx-row"><span>Take Profit 1</span><strong>${tp1}</strong></div>
    <div class="bx-row"><span>Take Profit 2</span><strong>${tp2}</strong></div>
    <div class="bx-row"><span>Take Profit 3</span><strong>${tp3}</strong></div>
  `;
  document.getElementById("px-profits").innerHTML = tpsHTML;
}
</script>
</div><div class="t-redactor__embedcode"><style>
/* Увеличиваем ширину контейнера поста в Потоках */
.t-feed__post-popup__container {
    max-width: 1200px !important; /* Установите нужную ширину (стандарт — около 900px) */
    width: 95% !important;
}

/* При необходимости можно также расширить текстовый контент внутри */
.t-feed__post-popup__content {
    max-width: 100% !important;
}
</style></div><hr style="color: #000000;"><h2  class="t-redactor__h2">Инструкция по работе с аналитическим терминалом Bitradyx</h2><h3  class="t-redactor__h3">1️⃣ Что вы видите в терминале</h3><div class="t-redactor__text">Терминал — это <strong>аналитический обзор рынка</strong>, а не автоматический торговый сигнал.</div><div class="t-redactor__text">Каждый инструмент (ETH, XRP, BTC и т.д.) содержит:</div><div class="t-redactor__text"><ul><li data-list="bullet">текущее состояние рынка</li><li data-list="bullet">ключевые зоны поддержки и сопротивления</li><li data-list="bullet">сценарии развития</li><li data-list="bullet">рекомендации <em>что делать и чего не делать</em></li><li data-list="bullet">живой график TradingView для визуального контроля</li></ul></div><h3  class="t-redactor__h3">2️⃣ Как открыть анализ по инструменту</h3><div class="t-redactor__text"><ol><li data-list="ordered">На странице выберите нужный актив (ETH, XRP, BTC и др.)</li><li data-list="ordered">Нажмите кнопку <strong>«Открыть анализ»</strong></li><li data-list="ordered">Откроется PopUp с полноценным терминалом по выбранному инструменту</li></ol></div><div class="t-redactor__text">Каждый PopUp — это <strong>отдельный анализ конкретного актива</strong>.</div><h3  class="t-redactor__h3">3️⃣ Как читать блоки терминала</h3><h4  class="t-redactor__h4">🔹 Фаза</h4><div class="t-redactor__text">Показывает текущее состояние рынка:</div><div class="t-redactor__text"><ul><li data-list="bullet">Диапазон (Range)</li><li data-list="bullet">Тренд</li><li data-list="bullet">Импульс</li><li data-list="bullet">Слом структуры</li></ul></div><div class="t-redactor__text">Это <strong>контекст</strong>, а не точка входа.</div><h4  class="t-redactor__h4">🔹 Контекст</h4><div class="t-redactor__text">Объясняет, <em>почему рынок находится в текущей фазе</em></div><div class="t-redactor__text"> (после импульса, после слома структуры, накопление и т.д.)</div><h4  class="t-redactor__h4">🔹 Цена в момент анализа</h4><div class="t-redactor__text">Цена актива <strong>на момент подготовки аналитики</strong>.</div><div class="t-redactor__text"> Она используется как ориентир, а не как торговый сигнал.</div><h4  class="t-redactor__h4">🔹 Поддержка / Сопротивление</h4><div class="t-redactor__text">Ключевые <strong>зоны принятия решений</strong>, а не точные уровни входа.</div><div class="t-redactor__text">❗ Важно:</div><div class="t-redactor__text"> Входы рассматриваются <strong>только после подтверждения</strong>, а не «на касание».</div><h3  class="t-redactor__h3">4️⃣ Основные текстовые блоки</h3><h4  class="t-redactor__h4">🧠 Текущее состояние</h4><div class="t-redactor__text">Краткое описание рыночной структуры:</div><div class="t-redactor__text"><ul><li data-list="bullet">где находится цена</li><li data-list="bullet">есть ли тренд</li><li data-list="bullet">присутствует ли давление покупателей / продавцов</li></ul></div><h4  class="t-redactor__h4">📌 План действий</h4><div class="t-redactor__text">Логика поведения трейдера:</div><div class="t-redactor__text"><ul><li data-list="bullet">в каких условиях рассматривать вход</li><li data-list="bullet">когда лучше ждать</li><li data-list="bullet">какие действия приоритетны</li></ul></div><h4  class="t-redactor__h4">⚡ Триггеры подтверждения</h4><div class="t-redactor__text">Что должно произойти, <strong>чтобы рынок стал рабочим</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">закрепление</li><li data-list="bullet">объём</li><li data-list="bullet">ускорение</li><li data-list="bullet">слом диапазона</li></ul></div><div class="t-redactor__text">Без этих условий <strong>действий не предпринимается</strong>.</div><h4  class="t-redactor__h4">⛔ Что не делать</h4><div class="t-redactor__text">Самый важный блок для сохранения депозита:</div><div class="t-redactor__text"><ul><li data-list="bullet">где нельзя входить</li><li data-list="bullet">чего нельзя усреднять</li><li data-list="bullet">какие действия считаются ошибочными</li></ul></div><h3  class="t-redactor__h3">5️⃣ Сценарии развития</h3><div class="t-redactor__text">В терминале всегда минимум <strong>два сценария</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet"><strong>Основной сценарий</strong> — более вероятный</li><li data-list="bullet"><strong>Альтернативный сценарий</strong> — защитный</li></ul></div><div class="t-redactor__text">Рынок не обязан идти по прогнозу.</div><div class="t-redactor__text"> Задача — <strong>быть готовым к обоим вариантам</strong>.</div><h3  class="t-redactor__h3">6️⃣ График TradingView</h3><div class="t-redactor__text">В нижней части терминала расположен <strong>живой график</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">полностью синхронизирован с текущим рынком</li><li data-list="bullet">используется для визуального подтверждения аналитики</li><li data-list="bullet">позволяет самостоятельно проверить уровни и реакцию цены</li></ul></div><h3  class="t-redactor__h3">7️⃣ Важно помнить</h3><div class="t-redactor__text"><ul><li data-list="bullet">Терминал <strong>не даёт сигналов «купи / продай сейчас»</strong></li><li data-list="bullet">Аналитика обновляется <strong>только по тем инструментам, где есть активная работа</strong></li><li data-list="bullet">Решения принимаются <strong>только после подтверждения рынка</strong></li></ul></div><blockquote class="t-redactor__callout t-redactor__callout_fontSize_default" style="background: #EBEBEB; color: #000000;">
                                <div class="t-redactor__callout-icon" style="color: #ff0000">
                                    <svg width="24" height="24" role="img" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24">
                                        <circle cx="12.125" cy="12.125" r="12" style="fill:currentColor"/>
                                        <path d="M10.922 6.486c0-.728.406-1.091 1.217-1.091s1.215.363 1.215 1.091c0 .347-.102.617-.304.81-.202.193-.507.289-.911.289-.811 0-1.217-.366-1.217-1.099zm2.33 11.306h-2.234V9.604h2.234v8.188z" style="fill:#fff"/>
                                    </svg>
                                </div>
                                <div class="t-redactor__callout-text">
                                     <strong>Дисклеймер</strong><br />Аналитика носит информационный характер и не является инвестиционной рекомендацией.<br />Ответственность за торговые решения лежит на трейдере.
                                </div>
                            </blockquote>]]></turbo:content>
    </item>
    <item turbo="true">
      <title>BTC - Analyse Terminal</title>
      <link>https://bitradyx.com/tpost/unidafcf91-btc-analyse-terminal</link>
      <amplink>https://bitradyx.com/tpost/unidafcf91-btc-analyse-terminal?amp=true</amplink>
      <pubDate>Fri, 30 Jan 2026 16:52:00 +0300</pubDate>
      <turbo:content><![CDATA[<header><h1>BTC - Analyse Terminal</h1></header><div class="t-redactor__text">Дождитесь загрузки данных </div><div class="t-redactor__embedcode"><style>
/* ===== BITRADYX UNIFIED TERMINAL v0.9 (Strategy + Position) ===== */

.bx-wrap{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:24px;
  color:#d1d5db;
  font-family:Inter, Arial, sans-serif;
  max-width:1100px;f
}

/* HEADER */
.bx-top{
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
  gap:12px;
}
.bx-title{
  font-size:20px;
  font-weight:800;
  color:#f59e0b;
}
.bx-sub,
.bx-right{
  font-size:12px;
  opacity:0.7;
}

/* CHIPS */
.bx-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 18px;
}
.bx-chip{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:999px;
  padding:5px 11px;
  font-size:12px;
  font-weight:600;
}
.bx-dot{ width:7px;height:7px;border-radius:50%; display:inline-block; margin-right:6px; vertical-align:middle; }
.dot-blue{ background:#3b82f6; }
.dot-yellow{ background:#f59e0b; }
.dot-green{ background:#22c55e; }
.dot-red{ background:#ef4444; }
.dot-gray{ background:#6b7280; }

/* GRID */
.bx-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:14px;
}
@media(max-width:900px){
  .bx-grid{ grid-template-columns:1fr; }
}

/* CARDS */
.bx-card{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:14px;
}
.bx-h{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.6;
  margin-bottom:6px;
}
.bx-text{
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}

/* SCENARIOS */
.bx-scenarios{ display:grid; gap:10px; }
.sc{
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:12px 12px 12px 18px;
  position:relative;
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}
.sc:before{
  content:"";
  position:absolute;
  left:0; top:10px; bottom:10px;
  width:3px; border-radius:6px;
}
.sc.green:before{ background:#22c55e; }
.sc.red:before{ background:#ef4444; }

/* POSITION PANEL */
.bx-pos-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:12px;
}
@media(max-width:900px){
  .bx-pos-grid{ grid-template-columns:1fr 1fr; }
}
@media(max-width:520px){
  .bx-pos-grid{ grid-template-columns:1fr; }
}
.bx-kpi{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:10px 12px;
}
.bx-kpi .k{
  font-size:11px;
  color:#9aa0aa;
  margin-bottom:4px;
}
.bx-kpi .v{
  font-size:16px;
  font-weight:800;
}
.pnl-pos{ color:#22c55e; }
.pnl-neg{ color:#ef4444; }
.risk-low{ color:#22c55e; }
.risk-medium{ color:#f59e0b; }
.risk-high{ color:#fb7185; }
.risk-critical{ color:#ef4444; }
.adv{ color:#f59e0b; font-size:18px; font-weight:900; }
.sub{ font-size:11px; color:#9aa0aa; margin-top:2px; }

.bx-section{
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,0.06);
  padding-top:10px;
}

.bx-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  border-radius:10px;
  background:#121622;
  margin-bottom:6px;
  font-size:13px;
}
.bx-row strong{ font-weight:800; }
.bx-row.start{ background:#1a1f2f; }
.bx-row.mkt{
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.04)
  );
}

.bx-action{
  margin-top:14px;
  border:1px solid #1f1f1f;
  background:#0b0b0b;
  border-radius:14px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.bx-action .label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.65;
}
.bx-action .text{
  font-size:14px;
  font-weight:800;
}
.bx-pill{
  border:1px solid #1f1f1f;
  background:#111;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
  color:#f59e0b;
}

/* LIVE CHART */
.bx-livechart{
  border:1px solid #1f1f1f;
  border-radius:14px;
  padding:10px;
  margin-top:24px;
}
.bx-livechart-inner{
  width:100%;
  height:620px;
  overflow:hidden;
}
@media(max-width:768px){
  .bx-livechart-inner{ height:420px; }
}

/* FOOT */
.bx-foot{
  margin-top:18px;
  font-size:13px;
  opacity:0.85;
  white-space:pre-wrap;
}
.tradingview-widget-copyright{
  display:none;
}
</style>

<div class="bx-wrap">

  <!-- HEADER -->
  <div class="bx-top">
    <div>
      <div class="bx-title" id="bx-title">—</div>
      <div class="bx-sub">Unified Terminal · Bitradyx Analyse Department</div>
    </div>
    <div class="bx-right" id="bx-tf">Таймфрейм: —</div>
  </div>

  <!-- STATUS CHIPS -->
  <div class="bx-chips">
    <div class="bx-chip"><span class="bx-dot dot-blue"></span>Фаза: <b id="bx-phase">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-yellow"></span>Контекст: <b id="bx-context">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-green"></span>Цена в момент анализа: <b id="bx-price">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-red"></span>Сопротивление / Поддержка: <b id="bx-zones">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-gray"></span>Strategy: <b id="bx-strategy-name">—</b></div>
  </div>

  <!-- STRATEGY BRAIN -->
  <div class="bx-grid">
    <div class="bx-card">
      <div class="bx-h">Текущее состояние</div>
      <div class="bx-text" id="bx-state">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">План действий</div>
      <div class="bx-text" id="bx-plan">—</div>
    </div>

    <div class="bx-card">
      <div class="bx-h">Триггеры подтверждения</div>
      <div class="bx-text" id="bx-triggers">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">Что не делать</div>
      <div class="bx-text" id="bx-dont">—</div>
    </div>
  </div>

  <!-- SCENARIOS -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Сценарии развития</div>
    <div class="bx-scenarios">
      <div class="sc green" id="bx-scn-main">—</div>
      <div class="sc red" id="bx-scn-alt">—</div>
    </div>
  </div>

  <!-- POSITION CONTROL -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Position Control</div>

    <div class="bx-pos-grid" id="bx-pos-kpis">
      <div class="bx-kpi">
        <div class="k">Market Price</div>
        <div class="v" id="px-market">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Break-Even Zone</div>
        <div class="v" id="px-be">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Unrealized PnL</div>
        <div class="v" id="px-pnl">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Position Advantage</div>
        <div class="v adv" id="px-adv">—</div>
        <div class="sub" id="px-adv-sub">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Risk</div>
        <div class="v" id="px-risk">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Stage</div>
        <div class="v" id="px-stage">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Days in Position</div>
        <div class="v" id="px-days">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Volatility Rank</div>
        <div class="v" id="px-vol">—</div>
      </div>
    </div>

    <div class="bx-action">
      <div>
        <div class="label">Next Action</div>
        <div class="text" id="px-action">—</div>
      </div>
      <div class="bx-pill" id="px-action-tag">—</div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Entry & Risk Management</div>
      <div id="px-levels">
        <!-- dynamic -->
      </div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Profit Targets</div>
      <div id="px-profits">
        <!-- dynamic -->
      </div>
    </div>
  </div>

  <!-- LIVE CHART -->
  <div class="bx-livechart">
    <div class="bx-livechart-inner">
      <div class="tradingview-widget-container" style="height:100%;width:100%">
        <div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div>
        <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async>
        {
          "allow_symbol_change": true,
          "calendar": false,
          "details": true,
          "hide_side_toolbar": true,
          "hide_top_toolbar": false,
          "hide_legend": false,
          "hide_volume": true,
          "hotlist": false,
          "interval": "D",
          "locale": "ru",
          "save_image": true,
          "style": "3",
          "symbol": "BINANCE:BTCUSD",
          "theme": "dark",
          "timezone": "Etc/UTC",
          "backgroundColor": "#0F0F0F",
          "gridColor": "rgba(242, 242, 242, 0.06)",
          "studies": ["STD;Stochastic_RSI"],
          "autosize": true
        }
        </script>
      </div>
    </div>
  </div>

  <div class="bx-foot" id="bx-footnote">—</div>
</div>

<script>
/* ===== CONFIG ===== */
/* ===== URL PARAMS ===== */
function getParam(name){
  const url = new URL(window.location.href);
  return url.searchParams.get(name);
}
const CURRENT_SYMBOL = getParam("symbol") || "BTC";
const CURRENT_SIGNAL = getParam("signal"); // опционально, но правильно оставить

// Strategy (your existing terminal API)
const STRATEGY_API = "https://script.google.com/macros/s/AKfycbzg-xxRgVMFvX5muejb32hIZVL4Oqmqa7qk2LKFVML-e8kwC0DvthIExbYrAbmEu4TxIA/exec";

// Position (your dashboard/orders API)
const POSITION_API = "https://script.google.com/macros/s/AKfycbw82Q3d9emTXtdDYJbxw5RbY1UJzTva-IsaWj69rM88q1-pJX8ycywL2VT7SehwpXlS/exec";

const TERMINAL = {
  symbol: CURRENT_SYMBOL,
  strategy: null,
  orders: null
};

/* ===== HELPERS ===== */
function fmtNum(x, d=2){
  const n = Number(x);
  if(!isFinite(n)) return "—";
  return n.toFixed(d);
}
function daysSince(dateStr){
  const t = Date.parse(dateStr);
  if(!isFinite(t)) return "—";
  const diff = Date.now() - t;
  return Math.max(0, Math.floor(diff / (1000*60*60*24)));
}
function riskClass(r){
  const rr = (r || "").toLowerCase();
  if(rr === "low") return "risk-low";
  if(rr === "medium") return "risk-medium";
  if(rr === "high") return "risk-high";
  if(rr === "critical") return "risk-critical";
  return "";
}
function pnlClass(v){
  const n = Number(v);
  if(!isFinite(n)) return "";
  return n >= 0 ? "pnl-pos" : "pnl-neg";
}

/* Build aggregated position from rows */
function buildPosition(rows){
  if(!rows || !rows.length) return null;

  // We assume rows already filtered to 1 symbol + Open
  const first = rows[0];

  // levels
  const levels = { Start: undefined };
  for(const r of rows){
    const type = String(r["Order Type"] || "").trim();
    const price = Number(r["Entry Price"]);
    if(!isFinite(price)) continue;

    if(type === "Starting order"){
      levels.Start = (levels.Start === undefined) ? price : Math.max(levels.Start, price);
    }
    const m = type.match(/Doubling\s*(\d+)/i);
    if(m){
      const k = "D" + m[1];
      levels[k] = (levels[k] === undefined) ? price : Math.min(levels[k], price);
    }
  }

  // stage/risk/targets
  const stage = rows.reduce((mx, r) => Math.max(mx, Number(r.Stage) || 0), 0);

  return {
    symbol: first.Symbol,
    strategy: first.Strategy,
    market: Number(first.Market),
    avg: Number(first.Avg),
    pnl: Number(first["PnL %"]),
    risk: first.Risk,
    vol: first["Volatility Rank"],
    stage,
    startDate: first["Date Start"] || first["Start Date"],
    tp1: first.TP1, tp2: first.TP2, tp3: first.TP3,
    typDeal: first["Typ_Deal"],
    levels
  };
}

function getNextAction(p){
  if(!p) return {text:"—", tag:"—"};

  const market = Number(p.market);
  const be = Number(p.avg);
  const stage = Number(p.stage) || 0;

  // find next doubling level (smallest Dn above market? or below? Here: closest below market as "next add" if price drops)
  let nextDoubling = null;
  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl === undefined) continue;
    if(nextDoubling === null) nextDoubling = {i, lvl};
    else if(lvl > nextDoubling.lvl) nextDoubling = {i, lvl}; // highest doubling price as "nearest" to market (usually D1 > D2 > ...)
  }

  if(isFinite(market) && isFinite(be)){
    const diffPct = ((be - market) / be) * 100; // below BE -> positive
    if(market >= be){
      return { text:"Risk decreasing · Above Break-Even", tag:"SAFE ZONE" };
    }
    if(diffPct <= 8){
      return { text:"Near Break-Even · Keep discipline", tag:"ALMOST BE" };
    }
    if(stage >= 3){
      return { text:"Advanced stage · Avoid panic · Follow plan", tag:"STAGE "+stage };
    }
    if(nextDoubling){
      return { text:`Hold · Watch Doubling ${nextDoubling.i} zone`, tag:"WATCH D"+nextDoubling.i };
    }
    return { text:"Hold · Waiting for confirmation", tag:"HOLD" };
  }

  return { text:"Hold", tag:"HOLD" };
}

function tryRender(){
  if(!TERMINAL.strategy || !TERMINAL.orders) return;
  renderTerminal(TERMINAL.strategy, TERMINAL.orders);
}

/* ===== LOAD STRATEGY ===== */
fetch(STRATEGY_API)
  .then(r => r.json())
  .then(data => {
    const d = data.instruments?.[TERMINAL.symbol];
    TERMINAL.strategy = d || null;
    tryRender();
  })
  .catch(()=>{ TERMINAL.strategy = null; tryRender(); });

/* ===== LOAD POSITION ===== */
fetch(POSITION_API)
  .then(r => r.json())
  .then(rows => {
    // Filter: Open + symbol starts with CURRENT_SYMBOL (ETH matches ETH/USDT)
    const filtered = (rows || []).filter(o => {
      const sym = String(o.Symbol || "");
      return sym.startsWith(TERMINAL.symbol) && String(o.Status || "").toLowerCase() === "open";
    });
    // Group by Symbol (if you ever have ETH/USDT and ETH/BTC - take first group)
    const bySymbol = {};
    filtered.forEach(r => {
      bySymbol[r.Symbol] = bySymbol[r.Symbol] || [];
      bySymbol[r.Symbol].push(r);
    });
    const firstKey = Object.keys(bySymbol)[0];
    TERMINAL.orders = firstKey ? bySymbol[firstKey] : [];
    tryRender();
  })
  .catch(()=>{ TERMINAL.orders = []; tryRender(); });

/* ===== RENDER ===== */
function renderTerminal(strategyData, ordersRows){
  // STRATEGY
  if(strategyData){
    document.getElementById("bx-title").innerText = strategyData.Symbol + " / USD";
    document.getElementById("bx-tf").innerText = "Таймфрейм: " + (strategyData.TF || "—");
    document.getElementById("bx-phase").innerText = strategyData.Phase || "—";
    document.getElementById("bx-context").innerText = strategyData.Context || "—";
    document.getElementById("bx-price").innerText = strategyData.Reference_Price ?? "—";
    document.getElementById("bx-zones").innerText = (strategyData["Resistance Zone"] ?? "—") + " / " + (strategyData["Support Zone"] ?? "—");

    document.getElementById("bx-state").innerText = strategyData.STATE || "—";
    document.getElementById("bx-plan").innerText = strategyData.PLAN || "—";
    document.getElementById("bx-triggers").innerText = strategyData.TRIGGERS || "—";
    document.getElementById("bx-dont").innerText = strategyData.DONT || "—";

    document.getElementById("bx-scn-main").innerText = strategyData.SCENARIO_MAIN || "—";
    document.getElementById("bx-scn-alt").innerText = strategyData.SCENARIO_ALT || "—";

    document.getElementById("bx-footnote").innerText = strategyData.FOOTNOTE || "—";
  } else {
    document.getElementById("bx-title").innerText = TERMINAL.symbol + " / USD";
    document.getElementById("bx-footnote").innerText = "Strategy data not found for this symbol.";
  }

  // POSITION
  const p = buildPosition(ordersRows);
  document.getElementById("bx-strategy-name").innerText = p?.strategy || "—";

  if(!p){
    document.getElementById("px-market").innerText = "—";
    document.getElementById("px-be").innerText = "—";
    document.getElementById("px-pnl").innerText = "—";
    document.getElementById("px-adv").innerText = "—";
    document.getElementById("px-adv-sub").innerText = "—";
    document.getElementById("px-risk").innerText = "—";
    document.getElementById("px-stage").innerText = "—";
    document.getElementById("px-days").innerText = "—";
    document.getElementById("px-vol").innerText = "—";
    document.getElementById("px-action").innerText = "No open position for this symbol.";
    document.getElementById("px-action-tag").innerText = "—";
    document.getElementById("px-levels").innerHTML = `<div class="bx-row"><span>No levels</span><span>—</span></div>`;
    document.getElementById("px-profits").innerHTML = `<div class="bx-row"><span>No targets</span><span>—</span></div>`;
    return;
  }

  const market = Number(p.market);
  const be = Number(p.avg);
  const advPct = (isFinite(market) && isFinite(be)) ? ((be - market)/be*100) : NaN;

  document.getElementById("px-market").innerText = fmtNum(market, 2);
  document.getElementById("px-be").innerText = fmtNum(be, 2);

  const pnlEl = document.getElementById("px-pnl");
  pnlEl.innerText = isFinite(p.pnl) ? (fmtNum(p.pnl,2) + "%") : "—";
  pnlEl.className = "v " + pnlClass(p.pnl);

  document.getElementById("px-adv").innerText = isFinite(advPct) ? (fmtNum(Math.abs(advPct),2) + "%") : "—";
  document.getElementById("px-adv-sub").innerText = "Better entry vs current market";

  const riskEl = document.getElementById("px-risk");
  riskEl.innerText = p.risk || "—";
  riskEl.className = "v " + riskClass(p.risk);

  document.getElementById("px-stage").innerText = p.stage ?? "—";
  document.getElementById("px-days").innerText = daysSince(p.startDate);
  document.getElementById("px-vol").innerText = (p.vol !== undefined && p.vol !== null) ? fmtNum(p.vol, 2) : "—";

  const act = getNextAction(p);
  document.getElementById("px-action").innerText = act.text;
  document.getElementById("px-action-tag").innerText = act.tag;

  // ENTRY LEVELS (your requested order):
  // Risk-Free Zone, Current Market Price, Starting Order, Doubling 1..5
  let levelsHTML = "";
  levelsHTML += `<div class="bx-row start"><span>Risk-Free Zone</span><strong>${fmtNum(be,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row mkt"><span>Current Market Price</span><strong>${fmtNum(market,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row"><span>Starting Order</span><strong>${p.levels.Start !== undefined ? fmtNum(p.levels.Start,2) : "—"}</strong></div>`;

  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl !== undefined){
      levelsHTML += `<div class="bx-row"><span>Doubling Level ${i}</span><strong>${fmtNum(lvl,2)}</strong></div>`;
    }
  }

  document.getElementById("px-levels").innerHTML = levelsHTML || `<div class="bx-row"><span>No levels</span><span>—</span></div>`;

  // PROFIT TARGETS (Target scenario + TP1-TP3)
  const tp1 = p.tp1 ?? "—";
  const tp2 = p.tp2 ?? "—";
  const tp3 = p.tp3 ?? "—";
  const tpsHTML = `
    <div class="bx-row"><span>Target Scenario</span><strong>${p.typDeal || "—"}</strong></div>
    <div class="bx-row"><span>Take Profit 1</span><strong>${tp1}</strong></div>
    <div class="bx-row"><span>Take Profit 2</span><strong>${tp2}</strong></div>
    <div class="bx-row"><span>Take Profit 3</span><strong>${tp3}</strong></div>
  `;
  document.getElementById("px-profits").innerHTML = tpsHTML;
}
</script>
</div><div class="t-redactor__embedcode"><style>
/* Увеличиваем ширину контейнера поста в Потоках */
.t-feed__post-popup__container {
    max-width: 1200px !important; /* Установите нужную ширину (стандарт — около 900px) */
    width: 95% !important;
}

/* При необходимости можно также расширить текстовый контент внутри */
.t-feed__post-popup__content {
    max-width: 100% !important;
}
</style></div><hr style="color: #000000;"><h2  class="t-redactor__h2">Инструкция по работе с аналитическим терминалом Bitradyx</h2><h3  class="t-redactor__h3">1️⃣ Что вы видите в терминале</h3><div class="t-redactor__text">Терминал — это <strong>аналитический обзор рынка</strong>, а не автоматический торговый сигнал.</div><div class="t-redactor__text">Каждый инструмент (ETH, XRP, BTC и т.д.) содержит:</div><div class="t-redactor__text"><ul><li data-list="bullet">текущее состояние рынка</li><li data-list="bullet">ключевые зоны поддержки и сопротивления</li><li data-list="bullet">сценарии развития</li><li data-list="bullet">рекомендации <em>что делать и чего не делать</em></li><li data-list="bullet">живой график TradingView для визуального контроля</li></ul></div><h3  class="t-redactor__h3">2️⃣ Как открыть анализ по инструменту</h3><div class="t-redactor__text"><ol><li data-list="ordered">На странице выберите нужный актив (ETH, XRP, BTC и др.)</li><li data-list="ordered">Нажмите кнопку <strong>«Открыть анализ»</strong></li><li data-list="ordered">Откроется PopUp с полноценным терминалом по выбранному инструменту</li></ol></div><div class="t-redactor__text">Каждый PopUp — это <strong>отдельный анализ конкретного актива</strong>.</div><h3  class="t-redactor__h3">3️⃣ Как читать блоки терминала</h3><h4  class="t-redactor__h4">🔹 Фаза</h4><div class="t-redactor__text">Показывает текущее состояние рынка:</div><div class="t-redactor__text"><ul><li data-list="bullet">Диапазон (Range)</li><li data-list="bullet">Тренд</li><li data-list="bullet">Импульс</li><li data-list="bullet">Слом структуры</li></ul></div><div class="t-redactor__text">Это <strong>контекст</strong>, а не точка входа.</div><h4  class="t-redactor__h4">🔹 Контекст</h4><div class="t-redactor__text">Объясняет, <em>почему рынок находится в текущей фазе</em></div><div class="t-redactor__text"> (после импульса, после слома структуры, накопление и т.д.)</div><h4  class="t-redactor__h4">🔹 Цена в момент анализа</h4><div class="t-redactor__text">Цена актива <strong>на момент подготовки аналитики</strong>.</div><div class="t-redactor__text"> Она используется как ориентир, а не как торговый сигнал.</div><h4  class="t-redactor__h4">🔹 Поддержка / Сопротивление</h4><div class="t-redactor__text">Ключевые <strong>зоны принятия решений</strong>, а не точные уровни входа.</div><div class="t-redactor__text">❗ Важно:</div><div class="t-redactor__text"> Входы рассматриваются <strong>только после подтверждения</strong>, а не «на касание».</div><h3  class="t-redactor__h3">4️⃣ Основные текстовые блоки</h3><h4  class="t-redactor__h4">🧠 Текущее состояние</h4><div class="t-redactor__text">Краткое описание рыночной структуры:</div><div class="t-redactor__text"><ul><li data-list="bullet">где находится цена</li><li data-list="bullet">есть ли тренд</li><li data-list="bullet">присутствует ли давление покупателей / продавцов</li></ul></div><h4  class="t-redactor__h4">📌 План действий</h4><div class="t-redactor__text">Логика поведения трейдера:</div><div class="t-redactor__text"><ul><li data-list="bullet">в каких условиях рассматривать вход</li><li data-list="bullet">когда лучше ждать</li><li data-list="bullet">какие действия приоритетны</li></ul></div><h4  class="t-redactor__h4">⚡ Триггеры подтверждения</h4><div class="t-redactor__text">Что должно произойти, <strong>чтобы рынок стал рабочим</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">закрепление</li><li data-list="bullet">объём</li><li data-list="bullet">ускорение</li><li data-list="bullet">слом диапазона</li></ul></div><div class="t-redactor__text">Без этих условий <strong>действий не предпринимается</strong>.</div><h4  class="t-redactor__h4">⛔ Что не делать</h4><div class="t-redactor__text">Самый важный блок для сохранения депозита:</div><div class="t-redactor__text"><ul><li data-list="bullet">где нельзя входить</li><li data-list="bullet">чего нельзя усреднять</li><li data-list="bullet">какие действия считаются ошибочными</li></ul></div><h3  class="t-redactor__h3">5️⃣ Сценарии развития</h3><div class="t-redactor__text">В терминале всегда минимум <strong>два сценария</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet"><strong>Основной сценарий</strong> — более вероятный</li><li data-list="bullet"><strong>Альтернативный сценарий</strong> — защитный</li></ul></div><div class="t-redactor__text">Рынок не обязан идти по прогнозу.</div><div class="t-redactor__text"> Задача — <strong>быть готовым к обоим вариантам</strong>.</div><h3  class="t-redactor__h3">6️⃣ График TradingView</h3><div class="t-redactor__text">В нижней части терминала расположен <strong>живой график</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">полностью синхронизирован с текущим рынком</li><li data-list="bullet">используется для визуального подтверждения аналитики</li><li data-list="bullet">позволяет самостоятельно проверить уровни и реакцию цены</li></ul></div><h3  class="t-redactor__h3">7️⃣ Важно помнить</h3><div class="t-redactor__text"><ul><li data-list="bullet">Терминал <strong>не даёт сигналов «купи / продай сейчас»</strong></li><li data-list="bullet">Аналитика обновляется <strong>только по тем инструментам, где есть активная работа</strong></li><li data-list="bullet">Решения принимаются <strong>только после подтверждения рынка</strong></li></ul></div><blockquote class="t-redactor__callout t-redactor__callout_fontSize_default" style="background: #EBEBEB; color: #000000;">
                                <div class="t-redactor__callout-icon" style="color: #ff0000">
                                    <svg width="24" height="24" role="img" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24">
                                        <circle cx="12.125" cy="12.125" r="12" style="fill:currentColor"/>
                                        <path d="M10.922 6.486c0-.728.406-1.091 1.217-1.091s1.215.363 1.215 1.091c0 .347-.102.617-.304.81-.202.193-.507.289-.911.289-.811 0-1.217-.366-1.217-1.099zm2.33 11.306h-2.234V9.604h2.234v8.188z" style="fill:#fff"/>
                                    </svg>
                                </div>
                                <div class="t-redactor__callout-text">
                                     <strong>Дисклеймер</strong><br />Аналитика носит информационный характер и не является инвестиционной рекомендацией.<br />Ответственность за торговые решения лежит на трейдере.
                                </div>
                            </blockquote>]]></turbo:content>
    </item>
    <item turbo="true">
      <title>TON - Analyse Terminal</title>
      <link>https://bitradyx.com/tpost/yc5nzg1u61-ton-analyse-terminal</link>
      <amplink>https://bitradyx.com/tpost/yc5nzg1u61-ton-analyse-terminal?amp=true</amplink>
      <pubDate>Fri, 30 Jan 2026 17:20:00 +0300</pubDate>
      <turbo:content><![CDATA[<header><h1>TON - Analyse Terminal</h1></header><div class="t-redactor__text">Дождитесь загрузки данных </div><div class="t-redactor__embedcode"><style>
/* ===== BITRADYX UNIFIED TERMINAL v0.9 (Strategy + Position) ===== */

.bx-wrap{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:24px;
  color:#d1d5db;
  font-family:Inter, Arial, sans-serif;
  max-width:1100px;f
}

/* HEADER */
.bx-top{
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
  gap:12px;
}
.bx-title{
  font-size:20px;
  font-weight:800;
  color:#f59e0b;
}
.bx-sub,
.bx-right{
  font-size:12px;
  opacity:0.7;
}

/* CHIPS */
.bx-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 18px;
}
.bx-chip{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:999px;
  padding:5px 11px;
  font-size:12px;
  font-weight:600;
}
.bx-dot{ width:7px;height:7px;border-radius:50%; display:inline-block; margin-right:6px; vertical-align:middle; }
.dot-blue{ background:#3b82f6; }
.dot-yellow{ background:#f59e0b; }
.dot-green{ background:#22c55e; }
.dot-red{ background:#ef4444; }
.dot-gray{ background:#6b7280; }

/* GRID */
.bx-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:14px;
}
@media(max-width:900px){
  .bx-grid{ grid-template-columns:1fr; }
}

/* CARDS */
.bx-card{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:14px;
}
.bx-h{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.6;
  margin-bottom:6px;
}
.bx-text{
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}

/* SCENARIOS */
.bx-scenarios{ display:grid; gap:10px; }
.sc{
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:12px 12px 12px 18px;
  position:relative;
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}
.sc:before{
  content:"";
  position:absolute;
  left:0; top:10px; bottom:10px;
  width:3px; border-radius:6px;
}
.sc.green:before{ background:#22c55e; }
.sc.red:before{ background:#ef4444; }

/* POSITION PANEL */
.bx-pos-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:12px;
}
@media(max-width:900px){
  .bx-pos-grid{ grid-template-columns:1fr 1fr; }
}
@media(max-width:520px){
  .bx-pos-grid{ grid-template-columns:1fr; }
}
.bx-kpi{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:10px 12px;
}
.bx-kpi .k{
  font-size:11px;
  color:#9aa0aa;
  margin-bottom:4px;
}
.bx-kpi .v{
  font-size:16px;
  font-weight:800;
}
.pnl-pos{ color:#22c55e; }
.pnl-neg{ color:#ef4444; }
.risk-low{ color:#22c55e; }
.risk-medium{ color:#f59e0b; }
.risk-high{ color:#fb7185; }
.risk-critical{ color:#ef4444; }
.adv{ color:#f59e0b; font-size:18px; font-weight:900; }
.sub{ font-size:11px; color:#9aa0aa; margin-top:2px; }

.bx-section{
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,0.06);
  padding-top:10px;
}

.bx-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  border-radius:10px;
  background:#121622;
  margin-bottom:6px;
  font-size:13px;
}
.bx-row strong{ font-weight:800; }
.bx-row.start{ background:#1a1f2f; }
.bx-row.mkt{
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.04)
  );
}

.bx-action{
  margin-top:14px;
  border:1px solid #1f1f1f;
  background:#0b0b0b;
  border-radius:14px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.bx-action .label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.65;
}
.bx-action .text{
  font-size:14px;
  font-weight:800;
}
.bx-pill{
  border:1px solid #1f1f1f;
  background:#111;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
  color:#f59e0b;
}

/* LIVE CHART */
.bx-livechart{
  border:1px solid #1f1f1f;
  border-radius:14px;
  padding:10px;
  margin-top:24px;
}
.bx-livechart-inner{
  width:100%;
  height:620px;
  overflow:hidden;
}
@media(max-width:768px){
  .bx-livechart-inner{ height:420px; }
}

/* FOOT */
.bx-foot{
  margin-top:18px;
  font-size:13px;
  opacity:0.85;
  white-space:pre-wrap;
}
.tradingview-widget-copyright{
  display:none;
}
</style>

<div class="bx-wrap">

  <!-- HEADER -->
  <div class="bx-top">
    <div>
      <div class="bx-title" id="bx-title">—</div>
      <div class="bx-sub">Unified Terminal · Bitradyx Analyse Department</div>
    </div>
    <div class="bx-right" id="bx-tf">Таймфрейм: —</div>
  </div>

  <!-- STATUS CHIPS -->
  <div class="bx-chips">
    <div class="bx-chip"><span class="bx-dot dot-blue"></span>Фаза: <b id="bx-phase">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-yellow"></span>Контекст: <b id="bx-context">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-green"></span>Цена в момент анализа: <b id="bx-price">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-red"></span>Сопротивление / Поддержка: <b id="bx-zones">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-gray"></span>Strategy: <b id="bx-strategy-name">—</b></div>
  </div>

  <!-- STRATEGY BRAIN -->
  <div class="bx-grid">
    <div class="bx-card">
      <div class="bx-h">Текущее состояние</div>
      <div class="bx-text" id="bx-state">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">План действий</div>
      <div class="bx-text" id="bx-plan">—</div>
    </div>

    <div class="bx-card">
      <div class="bx-h">Триггеры подтверждения</div>
      <div class="bx-text" id="bx-triggers">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">Что не делать</div>
      <div class="bx-text" id="bx-dont">—</div>
    </div>
  </div>

  <!-- SCENARIOS -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Сценарии развития</div>
    <div class="bx-scenarios">
      <div class="sc green" id="bx-scn-main">—</div>
      <div class="sc red" id="bx-scn-alt">—</div>
    </div>
  </div>

  <!-- POSITION CONTROL -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Position Control</div>

    <div class="bx-pos-grid" id="bx-pos-kpis">
      <div class="bx-kpi">
        <div class="k">Market Price</div>
        <div class="v" id="px-market">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Break-Even Zone</div>
        <div class="v" id="px-be">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Unrealized PnL</div>
        <div class="v" id="px-pnl">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Position Advantage</div>
        <div class="v adv" id="px-adv">—</div>
        <div class="sub" id="px-adv-sub">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Risk</div>
        <div class="v" id="px-risk">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Stage</div>
        <div class="v" id="px-stage">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Days in Position</div>
        <div class="v" id="px-days">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Volatility Rank</div>
        <div class="v" id="px-vol">—</div>
      </div>
    </div>

    <div class="bx-action">
      <div>
        <div class="label">Next Action</div>
        <div class="text" id="px-action">—</div>
      </div>
      <div class="bx-pill" id="px-action-tag">—</div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Entry & Risk Management</div>
      <div id="px-levels">
        <!-- dynamic -->
      </div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Profit Targets</div>
      <div id="px-profits">
        <!-- dynamic -->
      </div>
    </div>
  </div>

  <!-- LIVE CHART -->
  <div class="bx-livechart">
    <div class="bx-livechart-inner">
      <div class="tradingview-widget-container" style="height:100%;width:100%">
        <div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div>
        <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async>
        {
          "allow_symbol_change": true,
          "calendar": false,
          "details": true,
          "hide_side_toolbar": true,
          "hide_top_toolbar": false,
          "hide_legend": false,
          "hide_volume": true,
          "hotlist": false,
          "interval": "D",
          "locale": "ru",
          "save_image": true,
          "style": "3",
          "symbol": "BINANCE:TONUSDT",
          "theme": "dark",
          "timezone": "Etc/UTC",
          "backgroundColor": "#0F0F0F",
          "gridColor": "rgba(242, 242, 242, 0.06)",
          "studies": ["STD;Stochastic_RSI"],
          "autosize": true
        }
        </script>
      </div>
    </div>
  </div>

  <div class="bx-foot" id="bx-footnote">—</div>
</div>

<script>
/* ===== CONFIG ===== */
/* ===== URL PARAMS ===== */
function getParam(name){
  const url = new URL(window.location.href);
  return url.searchParams.get(name);
}
const CURRENT_SYMBOL = getParam("symbol") || "TON";
const CURRENT_SIGNAL = getParam("signal"); // опционально, но правильно оставить

// Strategy (your existing terminal API)
const STRATEGY_API = "https://script.google.com/macros/s/AKfycbzg-xxRgVMFvX5muejb32hIZVL4Oqmqa7qk2LKFVML-e8kwC0DvthIExbYrAbmEu4TxIA/exec";

// Position (your dashboard/orders API)
const POSITION_API = "https://script.google.com/macros/s/AKfycbw82Q3d9emTXtdDYJbxw5RbY1UJzTva-IsaWj69rM88q1-pJX8ycywL2VT7SehwpXlS/exec";

const TERMINAL = {
  symbol: CURRENT_SYMBOL,
  strategy: null,
  orders: null
};

/* ===== HELPERS ===== */
function fmtNum(x, d=2){
  const n = Number(x);
  if(!isFinite(n)) return "—";
  return n.toFixed(d);
}
function daysSince(dateStr){
  const t = Date.parse(dateStr);
  if(!isFinite(t)) return "—";
  const diff = Date.now() - t;
  return Math.max(0, Math.floor(diff / (1000*60*60*24)));
}
function riskClass(r){
  const rr = (r || "").toLowerCase();
  if(rr === "low") return "risk-low";
  if(rr === "medium") return "risk-medium";
  if(rr === "high") return "risk-high";
  if(rr === "critical") return "risk-critical";
  return "";
}
function pnlClass(v){
  const n = Number(v);
  if(!isFinite(n)) return "";
  return n >= 0 ? "pnl-pos" : "pnl-neg";
}

/* Build aggregated position from rows */
function buildPosition(rows){
  if(!rows || !rows.length) return null;

  // We assume rows already filtered to 1 symbol + Open
  const first = rows[0];

  // levels
  const levels = { Start: undefined };
  for(const r of rows){
    const type = String(r["Order Type"] || "").trim();
    const price = Number(r["Entry Price"]);
    if(!isFinite(price)) continue;

    if(type === "Starting order"){
      levels.Start = (levels.Start === undefined) ? price : Math.max(levels.Start, price);
    }
    const m = type.match(/Doubling\s*(\d+)/i);
    if(m){
      const k = "D" + m[1];
      levels[k] = (levels[k] === undefined) ? price : Math.min(levels[k], price);
    }
  }

  // stage/risk/targets
  const stage = rows.reduce((mx, r) => Math.max(mx, Number(r.Stage) || 0), 0);

  return {
    symbol: first.Symbol,
    strategy: first.Strategy,
    market: Number(first.Market),
    avg: Number(first.Avg),
    pnl: Number(first["PnL %"]),
    risk: first.Risk,
    vol: first["Volatility Rank"],
    stage,
    startDate: first["Date Start"] || first["Start Date"],
    tp1: first.TP1, tp2: first.TP2, tp3: first.TP3,
    typDeal: first["Typ_Deal"],
    levels
  };
}

function getNextAction(p){
  if(!p) return {text:"—", tag:"—"};

  const market = Number(p.market);
  const be = Number(p.avg);
  const stage = Number(p.stage) || 0;

  // find next doubling level (smallest Dn above market? or below? Here: closest below market as "next add" if price drops)
  let nextDoubling = null;
  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl === undefined) continue;
    if(nextDoubling === null) nextDoubling = {i, lvl};
    else if(lvl > nextDoubling.lvl) nextDoubling = {i, lvl}; // highest doubling price as "nearest" to market (usually D1 > D2 > ...)
  }

  if(isFinite(market) && isFinite(be)){
    const diffPct = ((be - market) / be) * 100; // below BE -> positive
    if(market >= be){
      return { text:"Risk decreasing · Above Break-Even", tag:"SAFE ZONE" };
    }
    if(diffPct <= 8){
      return { text:"Near Break-Even · Keep discipline", tag:"ALMOST BE" };
    }
    if(stage >= 3){
      return { text:"Advanced stage · Avoid panic · Follow plan", tag:"STAGE "+stage };
    }
    if(nextDoubling){
      return { text:`Hold · Watch Doubling ${nextDoubling.i} zone`, tag:"WATCH D"+nextDoubling.i };
    }
    return { text:"Hold · Waiting for confirmation", tag:"HOLD" };
  }

  return { text:"Hold", tag:"HOLD" };
}

function tryRender(){
  if(!TERMINAL.strategy || !TERMINAL.orders) return;
  renderTerminal(TERMINAL.strategy, TERMINAL.orders);
}

/* ===== LOAD STRATEGY ===== */
fetch(STRATEGY_API)
  .then(r => r.json())
  .then(data => {
    const d = data.instruments?.[TERMINAL.symbol];
    TERMINAL.strategy = d || null;
    tryRender();
  })
  .catch(()=>{ TERMINAL.strategy = null; tryRender(); });

/* ===== LOAD POSITION ===== */
fetch(POSITION_API)
  .then(r => r.json())
  .then(rows => {
    // Filter: Open + symbol starts with CURRENT_SYMBOL (ETH matches ETH/USDT)
    const filtered = (rows || []).filter(o => {
      const sym = String(o.Symbol || "");
      return sym.startsWith(TERMINAL.symbol) && String(o.Status || "").toLowerCase() === "open";
    });
    // Group by Symbol (if you ever have ETH/USDT and ETH/BTC - take first group)
    const bySymbol = {};
    filtered.forEach(r => {
      bySymbol[r.Symbol] = bySymbol[r.Symbol] || [];
      bySymbol[r.Symbol].push(r);
    });
    const firstKey = Object.keys(bySymbol)[0];
    TERMINAL.orders = firstKey ? bySymbol[firstKey] : [];
    tryRender();
  })
  .catch(()=>{ TERMINAL.orders = []; tryRender(); });

/* ===== RENDER ===== */
function renderTerminal(strategyData, ordersRows){
  // STRATEGY
  if(strategyData){
    document.getElementById("bx-title").innerText = strategyData.Symbol + " / USD";
    document.getElementById("bx-tf").innerText = "Таймфрейм: " + (strategyData.TF || "—");
    document.getElementById("bx-phase").innerText = strategyData.Phase || "—";
    document.getElementById("bx-context").innerText = strategyData.Context || "—";
    document.getElementById("bx-price").innerText = strategyData.Reference_Price ?? "—";
    document.getElementById("bx-zones").innerText = (strategyData["Resistance Zone"] ?? "—") + " / " + (strategyData["Support Zone"] ?? "—");

    document.getElementById("bx-state").innerText = strategyData.STATE || "—";
    document.getElementById("bx-plan").innerText = strategyData.PLAN || "—";
    document.getElementById("bx-triggers").innerText = strategyData.TRIGGERS || "—";
    document.getElementById("bx-dont").innerText = strategyData.DONT || "—";

    document.getElementById("bx-scn-main").innerText = strategyData.SCENARIO_MAIN || "—";
    document.getElementById("bx-scn-alt").innerText = strategyData.SCENARIO_ALT || "—";

    document.getElementById("bx-footnote").innerText = strategyData.FOOTNOTE || "—";
  } else {
    document.getElementById("bx-title").innerText = TERMINAL.symbol + " / USD";
    document.getElementById("bx-footnote").innerText = "Strategy data not found for this symbol.";
  }

  // POSITION
  const p = buildPosition(ordersRows);
  document.getElementById("bx-strategy-name").innerText = p?.strategy || "—";

  if(!p){
    document.getElementById("px-market").innerText = "—";
    document.getElementById("px-be").innerText = "—";
    document.getElementById("px-pnl").innerText = "—";
    document.getElementById("px-adv").innerText = "—";
    document.getElementById("px-adv-sub").innerText = "—";
    document.getElementById("px-risk").innerText = "—";
    document.getElementById("px-stage").innerText = "—";
    document.getElementById("px-days").innerText = "—";
    document.getElementById("px-vol").innerText = "—";
    document.getElementById("px-action").innerText = "No open position for this symbol.";
    document.getElementById("px-action-tag").innerText = "—";
    document.getElementById("px-levels").innerHTML = `<div class="bx-row"><span>No levels</span><span>—</span></div>`;
    document.getElementById("px-profits").innerHTML = `<div class="bx-row"><span>No targets</span><span>—</span></div>`;
    return;
  }

  const market = Number(p.market);
  const be = Number(p.avg);
  const advPct = (isFinite(market) && isFinite(be)) ? ((be - market)/be*100) : NaN;

  document.getElementById("px-market").innerText = fmtNum(market, 2);
  document.getElementById("px-be").innerText = fmtNum(be, 2);

  const pnlEl = document.getElementById("px-pnl");
  pnlEl.innerText = isFinite(p.pnl) ? (fmtNum(p.pnl,2) + "%") : "—";
  pnlEl.className = "v " + pnlClass(p.pnl);

  document.getElementById("px-adv").innerText = isFinite(advPct) ? (fmtNum(Math.abs(advPct),2) + "%") : "—";
  document.getElementById("px-adv-sub").innerText = "Better entry vs current market";

  const riskEl = document.getElementById("px-risk");
  riskEl.innerText = p.risk || "—";
  riskEl.className = "v " + riskClass(p.risk);

  document.getElementById("px-stage").innerText = p.stage ?? "—";
  document.getElementById("px-days").innerText = daysSince(p.startDate);
  document.getElementById("px-vol").innerText = (p.vol !== undefined && p.vol !== null) ? fmtNum(p.vol, 2) : "—";

  const act = getNextAction(p);
  document.getElementById("px-action").innerText = act.text;
  document.getElementById("px-action-tag").innerText = act.tag;

  // ENTRY LEVELS (your requested order):
  // Risk-Free Zone, Current Market Price, Starting Order, Doubling 1..5
  let levelsHTML = "";
  levelsHTML += `<div class="bx-row start"><span>Risk-Free Zone</span><strong>${fmtNum(be,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row mkt"><span>Current Market Price</span><strong>${fmtNum(market,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row"><span>Starting Order</span><strong>${p.levels.Start !== undefined ? fmtNum(p.levels.Start,2) : "—"}</strong></div>`;

  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl !== undefined){
      levelsHTML += `<div class="bx-row"><span>Doubling Level ${i}</span><strong>${fmtNum(lvl,2)}</strong></div>`;
    }
  }

  document.getElementById("px-levels").innerHTML = levelsHTML || `<div class="bx-row"><span>No levels</span><span>—</span></div>`;

  // PROFIT TARGETS (Target scenario + TP1-TP3)
  const tp1 = p.tp1 ?? "—";
  const tp2 = p.tp2 ?? "—";
  const tp3 = p.tp3 ?? "—";
  const tpsHTML = `
    <div class="bx-row"><span>Target Scenario</span><strong>${p.typDeal || "—"}</strong></div>
    <div class="bx-row"><span>Take Profit 1</span><strong>${tp1}</strong></div>
    <div class="bx-row"><span>Take Profit 2</span><strong>${tp2}</strong></div>
    <div class="bx-row"><span>Take Profit 3</span><strong>${tp3}</strong></div>
  `;
  document.getElementById("px-profits").innerHTML = tpsHTML;
}
</script>
</div><div class="t-redactor__embedcode"><style>
/* Увеличиваем ширину контейнера поста в Потоках */
.t-feed__post-popup__container {
    max-width: 1200px !important; /* Установите нужную ширину (стандарт — около 900px) */
    width: 95% !important;
}

/* При необходимости можно также расширить текстовый контент внутри */
.t-feed__post-popup__content {
    max-width: 100% !important;
}
</style></div><hr style="color: #000000;"><h2  class="t-redactor__h2">Инструкция по работе с аналитическим терминалом Bitradyx</h2><h3  class="t-redactor__h3">1️⃣ Что вы видите в терминале</h3><div class="t-redactor__text">Терминал — это <strong>аналитический обзор рынка</strong>, а не автоматический торговый сигнал.</div><div class="t-redactor__text">Каждый инструмент (ETH, XRP, BTC и т.д.) содержит:</div><div class="t-redactor__text"><ul><li data-list="bullet">текущее состояние рынка</li><li data-list="bullet">ключевые зоны поддержки и сопротивления</li><li data-list="bullet">сценарии развития</li><li data-list="bullet">рекомендации <em>что делать и чего не делать</em></li><li data-list="bullet">живой график TradingView для визуального контроля</li></ul></div><h3  class="t-redactor__h3">2️⃣ Как открыть анализ по инструменту</h3><div class="t-redactor__text"><ol><li data-list="ordered">На странице выберите нужный актив (ETH, XRP, BTC и др.)</li><li data-list="ordered">Нажмите кнопку <strong>«Открыть анализ»</strong></li><li data-list="ordered">Откроется PopUp с полноценным терминалом по выбранному инструменту</li></ol></div><div class="t-redactor__text">Каждый PopUp — это <strong>отдельный анализ конкретного актива</strong>.</div><h3  class="t-redactor__h3">3️⃣ Как читать блоки терминала</h3><h4  class="t-redactor__h4">🔹 Фаза</h4><div class="t-redactor__text">Показывает текущее состояние рынка:</div><div class="t-redactor__text"><ul><li data-list="bullet">Диапазон (Range)</li><li data-list="bullet">Тренд</li><li data-list="bullet">Импульс</li><li data-list="bullet">Слом структуры</li></ul></div><div class="t-redactor__text">Это <strong>контекст</strong>, а не точка входа.</div><h4  class="t-redactor__h4">🔹 Контекст</h4><div class="t-redactor__text">Объясняет, <em>почему рынок находится в текущей фазе</em></div><div class="t-redactor__text"> (после импульса, после слома структуры, накопление и т.д.)</div><h4  class="t-redactor__h4">🔹 Цена в момент анализа</h4><div class="t-redactor__text">Цена актива <strong>на момент подготовки аналитики</strong>.</div><div class="t-redactor__text"> Она используется как ориентир, а не как торговый сигнал.</div><h4  class="t-redactor__h4">🔹 Поддержка / Сопротивление</h4><div class="t-redactor__text">Ключевые <strong>зоны принятия решений</strong>, а не точные уровни входа.</div><div class="t-redactor__text">❗ Важно:</div><div class="t-redactor__text"> Входы рассматриваются <strong>только после подтверждения</strong>, а не «на касание».</div><h3  class="t-redactor__h3">4️⃣ Основные текстовые блоки</h3><h4  class="t-redactor__h4">🧠 Текущее состояние</h4><div class="t-redactor__text">Краткое описание рыночной структуры:</div><div class="t-redactor__text"><ul><li data-list="bullet">где находится цена</li><li data-list="bullet">есть ли тренд</li><li data-list="bullet">присутствует ли давление покупателей / продавцов</li></ul></div><h4  class="t-redactor__h4">📌 План действий</h4><div class="t-redactor__text">Логика поведения трейдера:</div><div class="t-redactor__text"><ul><li data-list="bullet">в каких условиях рассматривать вход</li><li data-list="bullet">когда лучше ждать</li><li data-list="bullet">какие действия приоритетны</li></ul></div><h4  class="t-redactor__h4">⚡ Триггеры подтверждения</h4><div class="t-redactor__text">Что должно произойти, <strong>чтобы рынок стал рабочим</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">закрепление</li><li data-list="bullet">объём</li><li data-list="bullet">ускорение</li><li data-list="bullet">слом диапазона</li></ul></div><div class="t-redactor__text">Без этих условий <strong>действий не предпринимается</strong>.</div><h4  class="t-redactor__h4">⛔ Что не делать</h4><div class="t-redactor__text">Самый важный блок для сохранения депозита:</div><div class="t-redactor__text"><ul><li data-list="bullet">где нельзя входить</li><li data-list="bullet">чего нельзя усреднять</li><li data-list="bullet">какие действия считаются ошибочными</li></ul></div><h3  class="t-redactor__h3">5️⃣ Сценарии развития</h3><div class="t-redactor__text">В терминале всегда минимум <strong>два сценария</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet"><strong>Основной сценарий</strong> — более вероятный</li><li data-list="bullet"><strong>Альтернативный сценарий</strong> — защитный</li></ul></div><div class="t-redactor__text">Рынок не обязан идти по прогнозу.</div><div class="t-redactor__text"> Задача — <strong>быть готовым к обоим вариантам</strong>.</div><h3  class="t-redactor__h3">6️⃣ График TradingView</h3><div class="t-redactor__text">В нижней части терминала расположен <strong>живой график</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">полностью синхронизирован с текущим рынком</li><li data-list="bullet">используется для визуального подтверждения аналитики</li><li data-list="bullet">позволяет самостоятельно проверить уровни и реакцию цены</li></ul></div><h3  class="t-redactor__h3">7️⃣ Важно помнить</h3><div class="t-redactor__text"><ul><li data-list="bullet">Терминал <strong>не даёт сигналов «купи / продай сейчас»</strong></li><li data-list="bullet">Аналитика обновляется <strong>только по тем инструментам, где есть активная работа</strong></li><li data-list="bullet">Решения принимаются <strong>только после подтверждения рынка</strong></li></ul></div><blockquote class="t-redactor__callout t-redactor__callout_fontSize_default" style="background: #EBEBEB; color: #000000;">
                                <div class="t-redactor__callout-icon" style="color: #ff0000">
                                    <svg width="24" height="24" role="img" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24">
                                        <circle cx="12.125" cy="12.125" r="12" style="fill:currentColor"/>
                                        <path d="M10.922 6.486c0-.728.406-1.091 1.217-1.091s1.215.363 1.215 1.091c0 .347-.102.617-.304.81-.202.193-.507.289-.911.289-.811 0-1.217-.366-1.217-1.099zm2.33 11.306h-2.234V9.604h2.234v8.188z" style="fill:#fff"/>
                                    </svg>
                                </div>
                                <div class="t-redactor__callout-text">
                                     <strong>Дисклеймер</strong><br />Аналитика носит информационный характер и не является инвестиционной рекомендацией.<br />Ответственность за торговые решения лежит на трейдере.
                                </div>
                            </blockquote>]]></turbo:content>
    </item>
    <item turbo="true">
      <title>BNB - Analyse Terminal</title>
      <link>https://bitradyx.com/tpost/ml05sllme1-bnb-analyse-terminal</link>
      <amplink>https://bitradyx.com/tpost/ml05sllme1-bnb-analyse-terminal?amp=true</amplink>
      <pubDate>Thu, 05 Feb 2026 12:48:00 +0300</pubDate>
      <turbo:content><![CDATA[<header><h1>BNB - Analyse Terminal</h1></header><div class="t-redactor__text">Дождитесь загрузки данных....</div><div class="t-redactor__embedcode"><style>
/* ===== BITRADYX UNIFIED TERMINAL v0.9 (Strategy + Position) ===== */

.bx-wrap{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:24px;
  color:#d1d5db;
  font-family:Inter, Arial, sans-serif;
  max-width:1100px;f
}

/* HEADER */
.bx-top{
  display:flex;
  justify-content:space-between;
  margin-bottom:12px;
  gap:12px;
}
.bx-title{
  font-size:20px;
  font-weight:800;
  color:#f59e0b;
}
.bx-sub,
.bx-right{
  font-size:12px;
  opacity:0.7;
}

/* CHIPS */
.bx-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 18px;
}
.bx-chip{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:999px;
  padding:5px 11px;
  font-size:12px;
  font-weight:600;
}
.bx-dot{ width:7px;height:7px;border-radius:50%; display:inline-block; margin-right:6px; vertical-align:middle; }
.dot-blue{ background:#3b82f6; }
.dot-yellow{ background:#f59e0b; }
.dot-green{ background:#22c55e; }
.dot-red{ background:#ef4444; }
.dot-gray{ background:#6b7280; }

/* GRID */
.bx-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:14px;
}
@media(max-width:900px){
  .bx-grid{ grid-template-columns:1fr; }
}

/* CARDS */
.bx-card{
  background:#0F0F0F;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:14px;
}
.bx-h{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.6;
  margin-bottom:6px;
}
.bx-text{
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}

/* SCENARIOS */
.bx-scenarios{ display:grid; gap:10px; }
.sc{
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:12px 12px 12px 18px;
  position:relative;
  font-size:13.5px;
  line-height:1.55;
  white-space:pre-wrap;
}
.sc:before{
  content:"";
  position:absolute;
  left:0; top:10px; bottom:10px;
  width:3px; border-radius:6px;
}
.sc.green:before{ background:#22c55e; }
.sc.red:before{ background:#ef4444; }

/* POSITION PANEL */
.bx-pos-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1fr;
  gap:12px;
}
@media(max-width:900px){
  .bx-pos-grid{ grid-template-columns:1fr 1fr; }
}
@media(max-width:520px){
  .bx-pos-grid{ grid-template-columns:1fr; }
}
.bx-kpi{
  background:#111;
  border:1px solid #1f1f1f;
  border-radius:12px;
  padding:10px 12px;
}
.bx-kpi .k{
  font-size:11px;
  color:#9aa0aa;
  margin-bottom:4px;
}
.bx-kpi .v{
  font-size:16px;
  font-weight:800;
}
.pnl-pos{ color:#22c55e; }
.pnl-neg{ color:#ef4444; }
.risk-low{ color:#22c55e; }
.risk-medium{ color:#f59e0b; }
.risk-high{ color:#fb7185; }
.risk-critical{ color:#ef4444; }
.adv{ color:#f59e0b; font-size:18px; font-weight:900; }
.sub{ font-size:11px; color:#9aa0aa; margin-top:2px; }

.bx-section{
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,0.06);
  padding-top:10px;
}

.bx-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  border-radius:10px;
  background:#121622;
  margin-bottom:6px;
  font-size:13px;
}
.bx-row strong{ font-weight:800; }
.bx-row.start{ background:#1a1f2f; }
.bx-row.mkt{
  background:linear-gradient(
    90deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.04)
  );
}

.bx-action{
  margin-top:14px;
  border:1px solid #1f1f1f;
  background:#0b0b0b;
  border-radius:14px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.bx-action .label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  opacity:0.65;
}
.bx-action .text{
  font-size:14px;
  font-weight:800;
}
.bx-pill{
  border:1px solid #1f1f1f;
  background:#111;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
  color:#f59e0b;
}

/* LIVE CHART */
.bx-livechart{
  border:1px solid #1f1f1f;
  border-radius:14px;
  padding:10px;
  margin-top:24px;
}
.bx-livechart-inner{
  width:100%;
  height:620px;
  overflow:hidden;
}
@media(max-width:768px){
  .bx-livechart-inner{ height:420px; }
}

/* FOOT */
.bx-foot{
  margin-top:18px;
  font-size:13px;
  opacity:0.85;
  white-space:pre-wrap;
}
.tradingview-widget-copyright{
  display:none;
}
</style>

<div class="bx-wrap">

  <!-- HEADER -->
  <div class="bx-top">
    <div>
      <div class="bx-title" id="bx-title">—</div>
      <div class="bx-sub">Unified Terminal · Bitradyx Analyse Department</div>
    </div>
    <div class="bx-right" id="bx-tf">Таймфрейм: —</div>
  </div>

  <!-- STATUS CHIPS -->
  <div class="bx-chips">
    <div class="bx-chip"><span class="bx-dot dot-blue"></span>Фаза: <b id="bx-phase">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-yellow"></span>Контекст: <b id="bx-context">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-green"></span>Цена в момент анализа: <b id="bx-price">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-red"></span>Сопротивление / Поддержка: <b id="bx-zones">—</b></div>
    <div class="bx-chip"><span class="bx-dot dot-gray"></span>Strategy: <b id="bx-strategy-name">—</b></div>
  </div>

  <!-- STRATEGY BRAIN -->
  <div class="bx-grid">
    <div class="bx-card">
      <div class="bx-h">Текущее состояние</div>
      <div class="bx-text" id="bx-state">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">План действий</div>
      <div class="bx-text" id="bx-plan">—</div>
    </div>

    <div class="bx-card">
      <div class="bx-h">Триггеры подтверждения</div>
      <div class="bx-text" id="bx-triggers">—</div>

      <div style="height:12px"></div>

      <div class="bx-h">Что не делать</div>
      <div class="bx-text" id="bx-dont">—</div>
    </div>
  </div>

  <!-- SCENARIOS -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Сценарии развития</div>
    <div class="bx-scenarios">
      <div class="sc green" id="bx-scn-main">—</div>
      <div class="sc red" id="bx-scn-alt">—</div>
    </div>
  </div>

  <!-- POSITION CONTROL -->
  <div style="height:16px"></div>
  <div class="bx-card">
    <div class="bx-h">Position Control</div>

    <div class="bx-pos-grid" id="bx-pos-kpis">
      <div class="bx-kpi">
        <div class="k">Market Price</div>
        <div class="v" id="px-market">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Break-Even Zone</div>
        <div class="v" id="px-be">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Unrealized PnL</div>
        <div class="v" id="px-pnl">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Position Advantage</div>
        <div class="v adv" id="px-adv">—</div>
        <div class="sub" id="px-adv-sub">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Risk</div>
        <div class="v" id="px-risk">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Stage</div>
        <div class="v" id="px-stage">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Days in Position</div>
        <div class="v" id="px-days">—</div>
      </div>
      <div class="bx-kpi">
        <div class="k">Volatility Rank</div>
        <div class="v" id="px-vol">—</div>
      </div>
    </div>

    <div class="bx-action">
      <div>
        <div class="label">Next Action</div>
        <div class="text" id="px-action">—</div>
      </div>
      <div class="bx-pill" id="px-action-tag">—</div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Entry & Risk Management</div>
      <div id="px-levels">
        <!-- dynamic -->
      </div>
    </div>

    <div class="bx-section">
      <div class="bx-h">Profit Targets</div>
      <div id="px-profits">
        <!-- dynamic -->
      </div>
    </div>
  </div>

  <!-- LIVE CHART -->
  <div class="bx-livechart">
    <div class="bx-livechart-inner">
      <div class="tradingview-widget-container" style="height:100%;width:100%">
        <div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div>
        <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async>
        {
          "allow_symbol_change": true,
          "calendar": false,
          "details": true,
          "hide_side_toolbar": true,
          "hide_top_toolbar": false,
          "hide_legend": false,
          "hide_volume": true,
          "hotlist": false,
          "interval": "D",
          "locale": "ru",
          "save_image": true,
          "style": "3",
          "symbol": "BINANCE:BNBUSDT",
          "theme": "dark",
          "timezone": "Etc/UTC",
          "backgroundColor": "#0F0F0F",
          "gridColor": "rgba(242, 242, 242, 0.06)",
          "studies": ["STD;Stochastic_RSI"],
          "autosize": true
        }
        </script>
      </div>
    </div>
  </div>

  <div class="bx-foot" id="bx-footnote">—</div>
</div>

<script>
/* ===== CONFIG ===== */
/* ===== URL PARAMS ===== */
function getParam(name){
  const url = new URL(window.location.href);
  return url.searchParams.get(name);
}
const CURRENT_SYMBOL = getParam("symbol") || "BNB";
const CURRENT_SIGNAL = getParam("signal"); // опционально, но правильно оставить

// Strategy (your existing terminal API)
const STRATEGY_API = "https://script.google.com/macros/s/AKfycbzg-xxRgVMFvX5muejb32hIZVL4Oqmqa7qk2LKFVML-e8kwC0DvthIExbYrAbmEu4TxIA/exec";

// Position (your dashboard/orders API)
const POSITION_API = "https://script.google.com/macros/s/AKfycbw82Q3d9emTXtdDYJbxw5RbY1UJzTva-IsaWj69rM88q1-pJX8ycywL2VT7SehwpXlS/exec";

const TERMINAL = {
  symbol: CURRENT_SYMBOL,
  strategy: null,
  orders: null
};

/* ===== HELPERS ===== */
function fmtNum(x, d=2){
  const n = Number(x);
  if(!isFinite(n)) return "—";
  return n.toFixed(d);
}
function daysSince(dateStr){
  const t = Date.parse(dateStr);
  if(!isFinite(t)) return "—";
  const diff = Date.now() - t;
  return Math.max(0, Math.floor(diff / (1000*60*60*24)));
}
function riskClass(r){
  const rr = (r || "").toLowerCase();
  if(rr === "low") return "risk-low";
  if(rr === "medium") return "risk-medium";
  if(rr === "high") return "risk-high";
  if(rr === "critical") return "risk-critical";
  return "";
}
function pnlClass(v){
  const n = Number(v);
  if(!isFinite(n)) return "";
  return n >= 0 ? "pnl-pos" : "pnl-neg";
}

/* Build aggregated position from rows */
function buildPosition(rows){
  if(!rows || !rows.length) return null;

  // We assume rows already filtered to 1 symbol + Open
  const first = rows[0];

  // levels
  const levels = { Start: undefined };
  for(const r of rows){
    const type = String(r["Order Type"] || "").trim();
    const price = Number(r["Entry Price"]);
    if(!isFinite(price)) continue;

    if(type === "Starting order"){
      levels.Start = (levels.Start === undefined) ? price : Math.max(levels.Start, price);
    }
    const m = type.match(/Doubling\s*(\d+)/i);
    if(m){
      const k = "D" + m[1];
      levels[k] = (levels[k] === undefined) ? price : Math.min(levels[k], price);
    }
  }

  // stage/risk/targets
  const stage = rows.reduce((mx, r) => Math.max(mx, Number(r.Stage) || 0), 0);

  return {
    symbol: first.Symbol,
    strategy: first.Strategy,
    market: Number(first.Market),
    avg: Number(first.Avg),
    pnl: Number(first["PnL %"]),
    risk: first.Risk,
    vol: first["Volatility Rank"],
    stage,
    startDate: first["Date Start"] || first["Start Date"],
    tp1: first.TP1, tp2: first.TP2, tp3: first.TP3,
    typDeal: first["Typ_Deal"],
    levels
  };
}

function getNextAction(p){
  if(!p) return {text:"—", tag:"—"};

  const market = Number(p.market);
  const be = Number(p.avg);
  const stage = Number(p.stage) || 0;

  // find next doubling level (smallest Dn above market? or below? Here: closest below market as "next add" if price drops)
  let nextDoubling = null;
  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl === undefined) continue;
    if(nextDoubling === null) nextDoubling = {i, lvl};
    else if(lvl > nextDoubling.lvl) nextDoubling = {i, lvl}; // highest doubling price as "nearest" to market (usually D1 > D2 > ...)
  }

  if(isFinite(market) && isFinite(be)){
    const diffPct = ((be - market) / be) * 100; // below BE -> positive
    if(market >= be){
      return { text:"Risk decreasing · Above Break-Even", tag:"SAFE ZONE" };
    }
    if(diffPct <= 8){
      return { text:"Near Break-Even · Keep discipline", tag:"ALMOST BE" };
    }
    if(stage >= 3){
      return { text:"Advanced stage · Avoid panic · Follow plan", tag:"STAGE "+stage };
    }
    if(nextDoubling){
      return { text:`Hold · Watch Doubling ${nextDoubling.i} zone`, tag:"WATCH D"+nextDoubling.i };
    }
    return { text:"Hold · Waiting for confirmation", tag:"HOLD" };
  }

  return { text:"Hold", tag:"HOLD" };
}

function tryRender(){
  if(!TERMINAL.strategy || !TERMINAL.orders) return;
  renderTerminal(TERMINAL.strategy, TERMINAL.orders);
}

/* ===== LOAD STRATEGY ===== */
fetch(STRATEGY_API)
  .then(r => r.json())
  .then(data => {
    const d = data.instruments?.[TERMINAL.symbol];
    TERMINAL.strategy = d || null;
    tryRender();
  })
  .catch(()=>{ TERMINAL.strategy = null; tryRender(); });

/* ===== LOAD POSITION ===== */
fetch(POSITION_API)
  .then(r => r.json())
  .then(rows => {
    // Filter: Open + symbol starts with CURRENT_SYMBOL (ETH matches ETH/USDT)
    const filtered = (rows || []).filter(o => {
      const sym = String(o.Symbol || "");
      return sym.startsWith(TERMINAL.symbol) && String(o.Status || "").toLowerCase() === "open";
    });
    // Group by Symbol (if you ever have ETH/USDT and ETH/BTC - take first group)
    const bySymbol = {};
    filtered.forEach(r => {
      bySymbol[r.Symbol] = bySymbol[r.Symbol] || [];
      bySymbol[r.Symbol].push(r);
    });
    const firstKey = Object.keys(bySymbol)[0];
    TERMINAL.orders = firstKey ? bySymbol[firstKey] : [];
    tryRender();
  })
  .catch(()=>{ TERMINAL.orders = []; tryRender(); });

/* ===== RENDER ===== */
function renderTerminal(strategyData, ordersRows){
  // STRATEGY
  if(strategyData){
    document.getElementById("bx-title").innerText = strategyData.Symbol + " / USD";
    document.getElementById("bx-tf").innerText = "Таймфрейм: " + (strategyData.TF || "—");
    document.getElementById("bx-phase").innerText = strategyData.Phase || "—";
    document.getElementById("bx-context").innerText = strategyData.Context || "—";
    document.getElementById("bx-price").innerText = strategyData.Reference_Price ?? "—";
    document.getElementById("bx-zones").innerText = (strategyData["Resistance Zone"] ?? "—") + " / " + (strategyData["Support Zone"] ?? "—");

    document.getElementById("bx-state").innerText = strategyData.STATE || "—";
    document.getElementById("bx-plan").innerText = strategyData.PLAN || "—";
    document.getElementById("bx-triggers").innerText = strategyData.TRIGGERS || "—";
    document.getElementById("bx-dont").innerText = strategyData.DONT || "—";

    document.getElementById("bx-scn-main").innerText = strategyData.SCENARIO_MAIN || "—";
    document.getElementById("bx-scn-alt").innerText = strategyData.SCENARIO_ALT || "—";

    document.getElementById("bx-footnote").innerText = strategyData.FOOTNOTE || "—";
  } else {
    document.getElementById("bx-title").innerText = TERMINAL.symbol + " / USD";
    document.getElementById("bx-footnote").innerText = "Strategy data not found for this symbol.";
  }

  // POSITION
  const p = buildPosition(ordersRows);
  document.getElementById("bx-strategy-name").innerText = p?.strategy || "—";

  if(!p){
    document.getElementById("px-market").innerText = "—";
    document.getElementById("px-be").innerText = "—";
    document.getElementById("px-pnl").innerText = "—";
    document.getElementById("px-adv").innerText = "—";
    document.getElementById("px-adv-sub").innerText = "—";
    document.getElementById("px-risk").innerText = "—";
    document.getElementById("px-stage").innerText = "—";
    document.getElementById("px-days").innerText = "—";
    document.getElementById("px-vol").innerText = "—";
    document.getElementById("px-action").innerText = "No open position for this symbol.";
    document.getElementById("px-action-tag").innerText = "—";
    document.getElementById("px-levels").innerHTML = `<div class="bx-row"><span>No levels</span><span>—</span></div>`;
    document.getElementById("px-profits").innerHTML = `<div class="bx-row"><span>No targets</span><span>—</span></div>`;
    return;
  }

  const market = Number(p.market);
  const be = Number(p.avg);
  const advPct = (isFinite(market) && isFinite(be)) ? ((be - market)/be*100) : NaN;

  document.getElementById("px-market").innerText = fmtNum(market, 2);
  document.getElementById("px-be").innerText = fmtNum(be, 2);

  const pnlEl = document.getElementById("px-pnl");
  pnlEl.innerText = isFinite(p.pnl) ? (fmtNum(p.pnl,2) + "%") : "—";
  pnlEl.className = "v " + pnlClass(p.pnl);

  document.getElementById("px-adv").innerText = isFinite(advPct) ? (fmtNum(Math.abs(advPct),2) + "%") : "—";
  document.getElementById("px-adv-sub").innerText = "Better entry vs current market";

  const riskEl = document.getElementById("px-risk");
  riskEl.innerText = p.risk || "—";
  riskEl.className = "v " + riskClass(p.risk);

  document.getElementById("px-stage").innerText = p.stage ?? "—";
  document.getElementById("px-days").innerText = daysSince(p.startDate);
  document.getElementById("px-vol").innerText = (p.vol !== undefined && p.vol !== null) ? fmtNum(p.vol, 2) : "—";

  const act = getNextAction(p);
  document.getElementById("px-action").innerText = act.text;
  document.getElementById("px-action-tag").innerText = act.tag;

  // ENTRY LEVELS (your requested order):
  // Risk-Free Zone, Current Market Price, Starting Order, Doubling 1..5
  let levelsHTML = "";
  levelsHTML += `<div class="bx-row start"><span>Risk-Free Zone</span><strong>${fmtNum(be,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row mkt"><span>Current Market Price</span><strong>${fmtNum(market,2)}</strong></div>`;
  levelsHTML += `<div class="bx-row"><span>Starting Order</span><strong>${p.levels.Start !== undefined ? fmtNum(p.levels.Start,2) : "—"}</strong></div>`;

  for(let i=1;i<=5;i++){
    const lvl = p.levels["D"+i];
    if(lvl !== undefined){
      levelsHTML += `<div class="bx-row"><span>Doubling Level ${i}</span><strong>${fmtNum(lvl,2)}</strong></div>`;
    }
  }

  document.getElementById("px-levels").innerHTML = levelsHTML || `<div class="bx-row"><span>No levels</span><span>—</span></div>`;

  // PROFIT TARGETS (Target scenario + TP1-TP3)
  const tp1 = p.tp1 ?? "—";
  const tp2 = p.tp2 ?? "—";
  const tp3 = p.tp3 ?? "—";
  const tpsHTML = `
    <div class="bx-row"><span>Target Scenario</span><strong>${p.typDeal || "—"}</strong></div>
    <div class="bx-row"><span>Take Profit 1</span><strong>${tp1}</strong></div>
    <div class="bx-row"><span>Take Profit 2</span><strong>${tp2}</strong></div>
    <div class="bx-row"><span>Take Profit 3</span><strong>${tp3}</strong></div>
  `;
  document.getElementById("px-profits").innerHTML = tpsHTML;
}
</script>
</div><div class="t-redactor__embedcode"><style>
/* Увеличиваем ширину контейнера поста в Потоках */
.t-feed__post-popup__container {
    max-width: 1200px !important; /* Установите нужную ширину (стандарт — около 900px) */
    width: 95% !important;
}

/* При необходимости можно также расширить текстовый контент внутри */
.t-feed__post-popup__content {
    max-width: 100% !important;
}
</style></div><h2  class="t-redactor__h2">Инструкция по работе с аналитическим терминалом Bitradyx</h2><h3  class="t-redactor__h3">1️⃣ Что вы видите в терминале</h3><div class="t-redactor__text">Терминал — это <strong>аналитический обзор рынка</strong>, а не автоматический торговый сигнал.</div><div class="t-redactor__text">Каждый инструмент (ETH, XRP, BTC и т.д.) содержит:</div><div class="t-redactor__text"><ul><li data-list="bullet">текущее состояние рынка</li><li data-list="bullet">ключевые зоны поддержки и сопротивления</li><li data-list="bullet">сценарии развития</li><li data-list="bullet">рекомендации <em>что делать и чего не делать</em></li><li data-list="bullet">живой график TradingView для визуального контроля</li></ul></div><h3  class="t-redactor__h3">2️⃣ Как открыть анализ по инструменту</h3><div class="t-redactor__text"><ol><li data-list="ordered">На странице выберите нужный актив (ETH, XRP, BTC и др.)</li><li data-list="ordered">Нажмите кнопку <strong>«Открыть анализ»</strong></li><li data-list="ordered">Откроется PopUp с полноценным терминалом по выбранному инструменту</li></ol></div><div class="t-redactor__text">Каждый PopUp — это <strong>отдельный анализ конкретного актива</strong>.</div><h3  class="t-redactor__h3">3️⃣ Как читать блоки терминала</h3><h4  class="t-redactor__h4">🔹 Фаза</h4><div class="t-redactor__text">Показывает текущее состояние рынка:</div><div class="t-redactor__text"><ul><li data-list="bullet">Диапазон (Range)</li><li data-list="bullet">Тренд</li><li data-list="bullet">Импульс</li><li data-list="bullet">Слом структуры</li></ul></div><div class="t-redactor__text">Это <strong>контекст</strong>, а не точка входа.</div><h4  class="t-redactor__h4">🔹 Контекст</h4><div class="t-redactor__text">Объясняет, <em>почему рынок находится в текущей фазе</em></div><div class="t-redactor__text"> (после импульса, после слома структуры, накопление и т.д.)</div><h4  class="t-redactor__h4">🔹 Цена в момент анализа</h4><div class="t-redactor__text">Цена актива <strong>на момент подготовки аналитики</strong>.</div><div class="t-redactor__text"> Она используется как ориентир, а не как торговый сигнал.</div><h4  class="t-redactor__h4">🔹 Поддержка / Сопротивление</h4><div class="t-redactor__text">Ключевые <strong>зоны принятия решений</strong>, а не точные уровни входа.</div><div class="t-redactor__text">❗ Важно:</div><div class="t-redactor__text"> Входы рассматриваются <strong>только после подтверждения</strong>, а не «на касание».</div><h3  class="t-redactor__h3">4️⃣ Основные текстовые блоки</h3><h4  class="t-redactor__h4">Текущее состояние</h4><div class="t-redactor__text">Краткое описание рыночной структуры:</div><div class="t-redactor__text"><ul><li data-list="bullet">где находится цена</li><li data-list="bullet">есть ли тренд</li><li data-list="bullet">присутствует ли давление покупателей / продавцов</li></ul></div><h4  class="t-redactor__h4">План действий</h4><div class="t-redactor__text">Логика поведения трейдера:</div><div class="t-redactor__text"><ul><li data-list="bullet">в каких условиях рассматривать вход</li><li data-list="bullet">когда лучше ждать</li><li data-list="bullet">какие действия приоритетны</li></ul></div><h4  class="t-redactor__h4">Триггеры подтверждения</h4><div class="t-redactor__text">Что должно произойти, <strong>чтобы рынок стал рабочим</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">закрепление</li><li data-list="bullet">объём</li><li data-list="bullet">ускорение</li><li data-list="bullet">слом диапазона</li></ul></div><div class="t-redactor__text">Без этих условий <strong>действий не предпринимается</strong>.</div><h4  class="t-redactor__h4">⛔ Что не делать</h4><div class="t-redactor__text">Самый важный блок для сохранения депозита:</div><div class="t-redactor__text"><ul><li data-list="bullet">где нельзя входить</li><li data-list="bullet">чего нельзя усреднять</li><li data-list="bullet">какие действия считаются ошибочными</li></ul></div><h3  class="t-redactor__h3">5️⃣ Сценарии развития</h3><div class="t-redactor__text">В терминале всегда минимум <strong>два сценария</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet"><strong>Основной сценарий</strong> — более вероятный</li><li data-list="bullet"><strong>Альтернативный сценарий</strong> — защитный</li></ul></div><div class="t-redactor__text">Рынок не обязан идти по прогнозу.</div><div class="t-redactor__text"> Задача — <strong>быть готовым к обоим вариантам</strong>.</div><h3  class="t-redactor__h3">6️⃣ График TradingView</h3><div class="t-redactor__text">В нижней части терминала расположен <strong>живой график</strong>:</div><div class="t-redactor__text"><ul><li data-list="bullet">полностью синхронизирован с текущим рынком</li><li data-list="bullet">используется для визуального подтверждения аналитики</li><li data-list="bullet">позволяет самостоятельно проверить уровни и реакцию цены</li></ul></div><h3  class="t-redactor__h3">7️⃣ Важно помнить</h3><div class="t-redactor__text"><ul><li data-list="bullet">Терминал <strong>не даёт сигналов «купи / продай сейчас»</strong></li><li data-list="bullet">Аналитика обновляется <strong>только по тем инструментам, где есть активная работа</strong></li><li data-list="bullet">Решения принимаются <strong>только после подтверждения рынка</strong></li></ul></div><blockquote class="t-redactor__callout t-redactor__callout_fontSize_default" style="background: #EBEBEB; color: #000000;">
                                <div class="t-redactor__callout-icon" style="color: #ff0000">
                                    <svg width="24" height="24" role="img" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24">
                                        <circle cx="12.125" cy="12.125" r="12" style="fill:currentColor"/>
                                        <path d="M10.922 6.486c0-.728.406-1.091 1.217-1.091s1.215.363 1.215 1.091c0 .347-.102.617-.304.81-.202.193-.507.289-.911.289-.811 0-1.217-.366-1.217-1.099zm2.33 11.306h-2.234V9.604h2.234v8.188z" style="fill:#fff"/>
                                    </svg>
                                </div>
                                <div class="t-redactor__callout-text">
                                     <strong>Дисклеймер</strong><br />Аналитика носит информационный характер и не является инвестиционной рекомендацией.<br />Ответственность за торговые решения лежит на трейдере.
                                </div>
                            </blockquote>]]></turbo:content>
    </item>
  </channel>
</rss>
