Search any U.S. ticker traded through major U.S. venues. The page builds a Yahoo Finance-style ticker view with charting, related Stockmarketloop news, and a signed-in Stocktwits-style stream layer.
';
}
var replyParentId = 0;
function drawComments(comments){
var box = document.querySelector("[data-comment-list]");
var status = document.querySelector("[data-stream-status]");
box.innerHTML = comments.length ? comments.map(renderComment).join("") : '
Stockmarketloop
No posts yet for $'+symbol+'. Start the stream with a ticker take.
';
if(status) status.textContent = "Stored ticker stream refreshes every 20 seconds. Last refresh: " + new Date().toLocaleTimeString();
}
function loadCoreComments(){
var box = document.querySelector("[data-comment-list]");
var status = document.querySelector("[data-stream-status]");
return fetch("/wp-json/wp/v2/comments?post="+STORE+"&per_page=100&orderby=date&order=desc&_="+Date.now(),{credentials:"same-origin",cache:"no-store"})
.then(function(r){return r.ok?r.json():[];})
.then(function(rows){
var comments=rows.map(parseStoredComment).filter(Boolean).filter(function(c){return c.tickers.indexOf(symbol)>=0;}).slice(0,60);
drawComments(comments);
}).catch(function(){
box.innerHTML = 'Stockmarketloop
Could not load the ticker stream. Try the refresh button.
';
if(status) status.textContent = "Stream unavailable. Try refreshing.";
});
}
function loadComments(){
var box = document.querySelector("[data-comment-list]");
var status = document.querySelector("[data-stream-status]");
if(!loggedIn()){
box.innerHTML = 'Stockmarketloop
Sign in to view the stored $'+symbol+' ticker stream.
';
return;
}
if(status) status.textContent = "Refreshing stored $" + symbol + " stream...";
fetch("/wp-json/sml-members/v1/stream?symbol="+encodeURIComponent(symbol)+"&_="+Date.now(),{credentials:"same-origin",cache:"no-store",headers:{"X-WP-Nonce":restNonce()}})
.then(function(r){ if(!r.ok) throw new Error("member stream unavailable"); return r.json(); })
.then(function(data){ drawComments((data.comments||[]).map(normalizeApiComment)); })
.catch(loadCoreComments);
}
function renderMoomooPost(post){
var avatar = post.avatar_url || "";
var name = post.moomoo_name || "Moomoo member";
var when = post.date ? new Date(post.date).toLocaleString() : "Live";
var profile = post.profile_url || "#";
return '
';
}
function loadMoomooFeed(){
var box = document.querySelector("[data-moomoo-feed]");
var status = document.querySelector("[data-moomoo-status]");
if(!box)return;
if(status)status.textContent="Refreshing Moomoo feed for $"+symbol+"...";
fetch("/wp-json/sml-members/v1/moomoo-feed?symbol="+encodeURIComponent(symbol)+"&_="+Date.now(),{credentials:"same-origin",cache:"no-store"})
.then(function(r){return r.ok?r.json():Promise.reject();})
.then(function(data){
var posts=data.posts||[];
box.innerHTML=posts.length?posts.map(renderMoomooPost).join(""):'
Moomoo feed readySource pending | $'+symbol+'
'+escapeHtml(data.message||"Connect an approved Moomoo source to populate live posts.")+'
';
if(status)status.textContent="Moomoo feed refreshes every "+(data.refresh_seconds||10)+" seconds. Last refresh: "+new Date().toLocaleTimeString();
})
.catch(function(){
box.innerHTML='
Moomoo feed unavailable$'+symbol+'
Try refreshing again after the approved feed source is connected.
';
if(status)status.textContent="Moomoo feed unavailable.";
});
}
function renderMiniTrader(t){
return '
';
}
function drawSentiment(data){
var fill=document.querySelector("[data-sentiment-fill]");
var score=document.querySelector("[data-sentiment-score]");
var date=document.querySelector("[data-sentiment-date]");
var status=document.querySelector("[data-sentiment-status]");
var board=document.querySelector("[data-sentiment-board]");
var thoughts=document.querySelector("[data-top-thoughts]");
var bull=data.bullish_pct||0, bear=data.bearish_pct||0, total=data.total||0;
if(fill)fill.style.width=Math.max(0,Math.min(100,bull))+"%";
if(score)score.textContent=bull+"% bull / "+bear+"% bear";
if(date)date.textContent=data.date||"Today";
document.querySelectorAll("[data-sentiment-vote]").forEach(function(btn){btn.dataset.active=(data.user_vote===btn.dataset.vote)?"1":"0";});
if(status)status.textContent=loggedIn()?(data.user_vote?"Your vote: "+data.user_vote+". "+total+" total votes today.":"Choose today's direction for $"+symbol+". "+total+" total votes. "):"Sign in to vote on today's direction for $"+symbol+". "+total+" votes so far.";
if(board)board.innerHTML=(data.leaderboard&&data.leaderboard.length)?data.leaderboard.slice(0,5).map(renderMiniTrader).join(""):'
No ranked voters yetVote to start the leaderboard.
No top trader thoughts yetTop 10 leaderboard posts for $'+symbol+' will appear here.
';
}
function loadSentiment(){
fetch("/wp-json/sml-members/v1/sentiment?symbol="+encodeURIComponent(symbol)+"&_="+Date.now(),{credentials:"same-origin",cache:"no-store",headers:{"X-WP-Nonce":restNonce()}})
.then(function(r){return r.ok?r.json():Promise.reject();})
.then(drawSentiment)
.catch(function(){
var status=document.querySelector("[data-sentiment-status]");
if(status)status.textContent="Sentiment could not load. Try refreshing the page.";
});
}
function voteSentiment(vote){
var status=document.querySelector("[data-sentiment-status]");
if(!loggedIn()){
if(status)status.textContent="Must sign in to vote in daily sentiment.";
return;
}
if(status)status.textContent="Saving your "+vote+" call for $"+symbol+"...";
fetch("/wp-json/sml-members/v1/sentiment",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":restNonce()},body:JSON.stringify({symbol:symbol,vote:vote})})
.then(function(r){return r.ok?r.json():Promise.reject();})
.then(drawSentiment)
.catch(function(){if(status)status.textContent="Vote could not be saved. Make sure you are signed in.";});
}
function saveCoreComment(text){
var tags=streamTags(text);
var payload=new URLSearchParams();
payload.set("comment_post_ID",String(STORE));
payload.set("comment_parent",String(replyParentId||0));
payload.set("comment",MARK+tags.join(",")+"|"+signedUser()+"|"+text.replace(/[|<>]/g," ").replace(/\s+/g," ").slice(0,900));
return fetch("/wp-comments-post.php",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:payload.toString(),redirect:"manual"});
}
function saveComment(text){
return fetch("/wp-json/sml-members/v1/stream",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":restNonce()},body:JSON.stringify({symbol:symbol,text:text,parent_id:replyParentId||0})})
.then(function(r){ if(!r.ok) throw new Error("member stream post unavailable"); return r.json(); })
.catch(function(){ return saveCoreComment(text); });
}
document.querySelector("[data-symbol-form]").addEventListener("submit",function(e){
e.preventDefault();
var next = sanitize(input.value);
location.href = "/stock-chart/?symbol=" + encodeURIComponent(next);
});
document.querySelector("[data-chat-form]").addEventListener("submit",function(e){
e.preventDefault();
var area = document.querySelector("[data-chat-input]");
var text = area.value.trim();
if(!text) return;
var status = document.querySelector("[data-stream-status]");
if(status) status.textContent = "Posting to $" + symbol + "...";
saveComment(text).then(function(){
replyParentId = 0;
area.value = "";
area.placeholder = "Post to this ticker stream. Use $NVDA or $TSLA to cross-tag symbols. YouTube links embed automatically.";
loadComments();
}).catch(function(){
if(status) status.textContent = "Post could not be saved. Make sure you are signed in.";
});
});
document.querySelector("[data-stream-refresh]").addEventListener("click",loadComments);
document.querySelector("[data-comment-list]").addEventListener("click",function(e){
var btn = e.target.closest("[data-reply-id]");
if(!btn)return;
replyParentId = parseInt(btn.dataset.replyId,10) || 0;
var area = document.querySelector("[data-chat-input]");
area.placeholder = "Replying to " + (btn.dataset.replyHandle || "member") + "...";
area.focus();
});
document.querySelectorAll("[data-sentiment-vote]").forEach(function(btn){
btn.addEventListener("click",function(){voteSentiment(btn.dataset.vote);});
});
document.querySelector("[data-moomoo-refresh]").addEventListener("click",loadMoomooFeed);
var grid = document.querySelector("[data-watch-grid]");
grid.innerHTML = popular.slice(0,16).map(function(t){ return '$'+t+''; }).join("");
updateLabels();
loadChart();
loadNews();
loadProfileWidget();
loadComments();
loadMoomooFeed();
loadSentiment();
setInterval(loadComments, 20000);
setInterval(loadMoomooFeed, 10000);
setInterval(loadSentiment, 30000);
})();
Join the market loop before you post.Create a verified profile, save watchlists, vote sentiment, follow traders, earn badges, and keep your session active on this device.
By continuing, you agree to use Stockmarketloop for market discussion and watchlist tools. Financial posts are not investment advice.
2 responses to “StockMarketLoop Ticker Terminal”
SMLTICKER|AMD|258456543|Whos hold $AMD
SMLTICKER|PLTR|258456543|YOOO [Trade proof pending: Moomoo]