function realtime_price(e,t){fetch("https://quote.cnbc.com/quote-html-webservice/quote.htm?noform=1&partnerId=2&fund=1&exthrs=0&output=json&requestMethod=quick&symbols="+e,{method:"GET",credentials:"same-origin"}).then(function(e){return e.json()}).then(function(e){let n=e.QuickQuoteResult.QuickQuote;n.hasOwnProperty("symbol")||(n=n[0]),document.getElementById("symbol_"+t).innerHTML=n.symbol,document.getElementById("name_"+t).innerHTML=name_sub[t].slice(0,30),price=parseFloat(n.last),price_chg=parseFloat(n.change),price_pct_chg=parseFloat(n.change_pct),n.change>0?(document.getElementById("price_"+t).style.color="#ccff33",document.getElementById("chg_"+t).style.color="#ccff33",document.getElementById("pct_chg_"+t).style.color="#ccff33"):(document.getElementById("price_"+t).style.color="#ff9933",document.getElementById("chg_"+t).style.color="#ff9933",document.getElementById("pct_chg_"+t).style.color="#ff9933"),document.getElementById("price_"+t).innerHTML=add_commas(price,dec=2),document.getElementById("chg_"+t).innerHTML=add_commas(price_chg,dec=2),document.getElementById("pct_chg_"+t).innerHTML="("+add_commas(price_pct_chg,dec=2)+"%)"}).catch(function(e){console.log(e)})}function realtime_signals(e,t){document.getElementById("red_"+t).style.backgroundColor="#1a0000",document.getElementById("orange_"+t).style.backgroundColor="#1a1400",document.getElementById("green_"+t).style.backgroundColor="#051405",fetch("https://ts-api.cnbc.com/harmony/app/charts/3M.json?symbol="+e,{method:"GET",credentials:"same-origin"}).then(function(e){return e.json()}).then(function(n){let o=n.barData.priceBars,c=o.map(e=>parseFloat(e.close)),r;fetch("https://quote.cnbc.com/quote-html-webservice/quote.htm?noform=1&partnerId=2&fund=1&exthrs=0&output=json&requestMethod=quick&symbols="+e,{method:"GET",credentials:"same-origin"}).then(function(e){return e.json()}).then(function(e){r=parseFloat(e.QuickQuoteResult.QuickQuote.last),c.push(r);let n=make_signal_last(c);document.getElementById("red_"+t).style.backgroundColor=n.red,document.getElementById("orange_"+t).style.backgroundColor=n.orange,document.getElementById("green_"+t).style.backgroundColor=n.green})}).catch(function(e){console.log(e)})}function dashboard_spike(e){for(i=0;iparseFloat(e[4]));document.getElementById(t).innerHTML=draw_spike_chart(n)}).catch(function(e){console.log(e)})}