#### eclipse00

##### New member
With my rudimentary skills on using thinkscript I was able to come up with this to give me the difference between bid and ask. I have two questions:

1. it appears that I can choose 'Close' or 'Open' for the ask and bid price type. What exactly is the difference? I thought there was only one number for the bid/ask price? I would assume it is the closing difference is what I want. or Would it be Open for Bid and Close for Ask?

2. My second question regarding the label. There are two ways to add the label. Which one is more efficient? meaning which one take less 'resources' or does it even matter/ Am I overthinking this?

Thank you!

Solution
With my rudimentary skills on using thinkscript I was able to come up with this to give me the difference between bid and ask. I have two questions:

1. it appears that I can choose 'Close' or 'Open' for the ask and bid price type. What exactly is the difference? I thought there was only one number for the bid/ask price? I would assume it is the closing difference is what I want. or Would it be Open for Bid and Close for Ask?

2. My second question regarding the label. There are two ways to add the label. Which one is more efficient? meaning which one take less 'resources' or does it even matter/ Am I overthinking this?

With my rudimentary skills on using thinkscript I was able to come up with this to give me the difference between bid and ask. I have two questions:

1. it appears that I can choose 'Close' or 'Open' for the ask and bid price type. What exactly is the difference? I thought there was only one number for the bid/ask price? I would assume it is the closing difference is what I want. or Would it be Open for Bid and Close for Ask?

2. My second question regarding the label. There are two ways to add the label. Which one is more efficient? meaning which one take less 'resources' or does it even matter/ Am I overthinking this?

Thank you!

for current prices, use close()

here is something to experiment with

Code:
``````declare lower;

def na = double.nan;
def bn = barnumber();

def bid1 = close(getsymbol(), priceType = PriceType.BID);
def sprd1 = ask1 - bid1;

addlabel(yes, "BID " + bid1, color.yellow);

plot spdupper = MidBodyVal() + (sprd1/2);
plot spdlower = MidBodyVal() - (sprd1/2);``````

https://tlc.thinkorswim.com/center/reference/thinkScript/Constants/PriceType/PriceType-BID

------------------

i imagine using a constant like yes, would be more efficient.
but i also think every drawn object slows down the chart just a little

spread is a number. if 0 then no label is shown. any other number and it is shown
i don't think i have tried negative numbers, so i did,..
and it showed a label with a -1

if you are not sure, just try some code and experiment with it. that's what i have done, 100s of times......

for current prices, use close()

here is something to experiment with

Code:
``````declare lower;

def na = double.nan;
def bn = barnumber();

def bid1 = close(getsymbol(), priceType = PriceType.BID);
def sprd1 = ask1 - bid1;

addlabel(yes, "BID " + bid1, color.yellow);

plot spdupper = MidBodyVal() + (sprd1/2);
plot spdlower = MidBodyVal() - (sprd1/2);``````

https://tlc.thinkorswim.com/center/reference/thinkScript/Constants/PriceType/PriceType-BID

------------------

i imagine using a constant like yes, would be more efficient.
but i also think every drawn object slows down the chart just a little

spread is a number. if 0 then no label is shown. any other number and it is shown
i don't think i have tried negative numbers, so i did,..
and it showed a label with a -1

if you are not sure, just try some code and experiment with it. that's what i have done, 100s of times......
Thank you So much!

Last edited by a moderator:
Bid / Ask watchlist Questions 1
Bid Ask Watchlist Column Questions 0
Bid Ask Lines & Labels Questions 1
Ask/Bid Volume Difference Displayed as Numbers Questions 1

87k+ Posts
435 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?