TRENDSENSE INDICATOR
HA · MM7 / Tenkan-9
Recherchez un actif
En attente
Tapez un actif pour commencer Manitou, LVMH, Bitcoin, AAPL...
MM7
Tenkan-9
MM7
MM20
MM50
MM100
MM200
Signal HA — MM7 / Tenkan-9
Sélectionnez un actif
HA Clôture
MM7
Tenkan-9
Variation
Derniers signaux
Moyennes Mobiles
MM7
MM20
MM50
MM100
MM200
Prix
Clôture
Variation
/* ==================================================== MODULE RIZE — Graphique temps réel via Kraken WebSocket ==================================================== */ var rizeChart=null, rizeSer=null, rizeWS=null, rizeData=[], rizeInited=false; function initRize(){ if(rizeInited) return; rizeInited=true; /* Créer le mini graphique Lightweight Charts */ var el=document.getElementById('rize-chart'); if(!el||rizeChart) return; rizeChart=LightweightCharts.createChart(el,{ width:el.clientWidth, height:160, layout:{background:{color:'#0d1117'},textColor:'#8b949e',fontSize:10}, grid:{vertLines:{color:'rgba(255,255,255,.04)'},horzLines:{color:'rgba(255,255,255,.04)'}}, rightPriceScale:{borderColor:'rgba(255,255,255,.08)',scaleMargins:{top:0.1,bottom:0.1}}, timeScale:{borderColor:'rgba(255,255,255,.08)',timeVisible:true,secondsVisible:false}, crosshair:{mode:LightweightCharts.CrosshairMode.Normal}, handleScroll:false,handleScale:false }); rizeSer=rizeChart.addLineSeries({color:'#6366f1',lineWidth:2,priceLineVisible:false,lastValueVisible:true}); new ResizeObserver(function(){if(rizeChart)rizeChart.applyOptions({width:el.clientWidth});}).observe(el); /* Charger l'historique RIZE/USD via Kraken REST */ fetch('https://api.kraken.com/0/public/OHLC?pair=RIZEUSD&interval=60&since='+(Math.floor(Date.now()/1000)-86400)) .then(function(r){return r.json();}) .then(function(d){ var pairs=Object.keys(d.result||{}).filter(function(k){return k!=='last';}); if(!pairs.length) throw new Error('no pair'); var candles=d.result[pairs[0]]; rizeData=candles.map(function(c){return{time:c[0],value:parseFloat(c[4])};}); if(rizeData.length){ rizeSer.setData(rizeData); rizeChart.timeScale().fitContent(); var last=rizeData[rizeData.length-1].value; var first=rizeData[0].value; document.getElementById('rize-price').textContent='$'+last.toFixed(6); var chg=((last-first)/first*100); var chgEl=document.getElementById('rize-chg'); chgEl.textContent=(chg>=0?'+':'')+chg.toFixed(2)+'%'; chgEl.style.color=chg>=0?'#39d353':'#f85149'; } }) .catch(function(e){ /* Fallback: essayer RIZE/EUR ou RIZEEUR */ fetch('https://api.kraken.com/0/public/OHLC?pair=RIZEEUR&interval=60') .then(function(r){return r.json();}) .then(function(d){ var pairs=Object.keys(d.result||{}).filter(function(k){return k!=='last';}); if(!pairs.length){ document.getElementById('rize-price').textContent='Paire non trouvée sur Kraken'; return; } var candles=d.result[pairs[0]]; rizeData=candles.map(function(c){return{time:c[0],value:parseFloat(c[4])};}); if(rizeData.length){ rizeSer.setData(rizeData); rizeChart.timeScale().fitContent(); var last=rizeData[rizeData.length-1].value; document.getElementById('rize-price').textContent='€'+last.toFixed(6); } }).catch(function(){ document.getElementById('rize-price').textContent='Non disponible'; }); }); /* WebSocket Kraken pour le prix en temps réel */ connectRizeWS(); } function connectRizeWS(){ if(rizeWS) return; try{ rizeWS=new WebSocket('wss://ws.kraken.com/v2'); rizeWS.onopen=function(){ rizeWS.send(JSON.stringify({method:'subscribe',params:{channel:'ticker',symbol:['RIZE/USD']}})); }; rizeWS.onmessage=function(ev){ try{ var msg=JSON.parse(ev.data); if(msg.channel==='ticker'&&msg.data&&msg.data[0]){ var price=parseFloat(msg.data[0].last); if(!isNaN(price)){ document.getElementById('rize-price').textContent='$'+price.toFixed(6); /* Mettre à jour le graphique */ var now=Math.floor(Date.now()/1000); if(rizeSer){ try{ rizeSer.update({time:now,value:price}); }catch(e){} } } } }catch(e){} }; rizeWS.onerror=function(){}; rizeWS.onclose=function(){rizeWS=null;}; }catch(e){} } function escHtml(s){ if(!s) return ''; return String(s).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"'); } /* Init au chargement */ window.addEventListener('load',function(){ initChart(); });