Label with bid-ask spread on daily chart

raj2ras

New member
I am new to thinkScript. Is it possible to get the bid ask spread as a label on a daily chart?

Thank you in advance
 
Solution
@raj2ras The following is a snippet of code from one of my regularly used Studies, edited to your request...

Ruby:
def bid = close(priceType = PriceType.BID);
def ask = close(priceType = PriceType.ASK);

AddLabel(yes, "Bid: " + Round(bid, 2), Color.GRAY);
AddLabel(yes, "Ask: " + Round(ask, 2), Color.GRAY);
AddLabel(yes, "BA/2: " + Round((bid + ask) / 2, 2), Color.GRAY);

rad14733

Well-known member
VIP
@raj2ras The following is a snippet of code from one of my regularly used Studies, edited to your request...

Ruby:
def bid = close(priceType = PriceType.BID);
def ask = close(priceType = PriceType.ASK);

AddLabel(yes, "Bid: " + Round(bid, 2), Color.GRAY);
AddLabel(yes, "Ask: " + Round(ask, 2), Color.GRAY);
AddLabel(yes, "BA/2: " + Round((bid + ask) / 2, 2), Color.GRAY);
 
Solution

Similar threads

Top