Syntax
bid
Description
Returns current value of bid price for current symbol. This function is only available in thinkScript® integration features: Custom Quotes, Study Alerts, and Conditional Orders.
Example
plot "Diff, %" = round(100 * ((bid + ask) / 2 - close) / close, 2);
AssignBackgroundColor(if "Diff, %" > 0 then Color.UPTICK else if "Diff, %" < 0 then Color.DOWNTICK else Color.GRAY);
This example script is used as a custom quote. It calculates percentage difference between mark and last prices and assigns colors according to its sign.
Note that you cannot reference historical data using this function, e.g. bid[1]
is an invalid expression.