ask

Syntax

ask

Description

Returns current value of ask price for current symbol. This function is only available in thinkScript® integration features: Custom Quotes, Study Alerts, and Conditional Orders.

Example

plot spread = ask - bid;
AssignBackgroundColor(if spread < 0.05 then Color.GREEN else if spread < 0.25 then Color.YELLOW else Color.RED);

This example script is used as a custom quote. It calculates a bid-ask spread and assigns different colors according to its value.

Note that you cannot reference historical data using this function, e.g. ask[1] is an invalid expression.