thinkScript price types

Mark Price in thinkScript

PriceType.MARK references the mark price, the estimated fair value based on bid and ask. Learn how to use it with the close function, its chart limitations, and how it differs from last, bid, and ask.

MarkPriceStudyexcerpt
input priceType = PriceType.MARK;

plot MarkPrice = close(
    priceType = priceType);
MarkPrice.SetDefaultColor(Color.CYAN);
PriceType.MARK
close()
intraday only
Constant
PriceType.MARK
Used with
close(priceType = ...)
Chart limit
Intraday, 15 days or less

Direct answer

What the mark price is and when to use it

The mark price is the estimated fair value of an instrument based on its current bid and ask. thinkorswim calculates it as the midpoint between bid and ask, adjusted for market conditions. It is useful for futures and options where the last traded price may be stale or unrepresentative.

In thinkScript, you reference it with PriceType.MARK and the close function. The Learning Center notes that for non-Forex symbols, this price type is only supported on intraday charts with a time interval not greater than 15 days.

Code examples

Plot and compare the mark price

Plot the mark price

Plot
# Plot the mark price with PriceType.MARK
input priceType = PriceType.MARK;

plot MarkPrice = close(priceType = priceType);
MarkPrice.SetDefaultColor(Color.CYAN);
MarkPrice.SetLineWeight(2);

AddLabel(yes,
    "Mark: " + AsText(MarkPrice),
    Color.WHITE);

Use an input for priceType so you can switch between mark, last, bid, and ask from the study settings without editing the source.

Compare all price types

Compare
# Compare price types
def markPrice = close(priceType = PriceType.MARK);
def lastPrice = close(priceType = PriceType.LAST);
def bidPrice = close(priceType = PriceType.BID);
def askPrice = close(priceType = PriceType.ASK);

AddLabel(yes, "Mark: " + AsText(markPrice), Color.CYAN);
AddLabel(yes, "Last: " + AsText(lastPrice), Color.WHITE);
AddLabel(yes, "Bid: " + AsText(bidPrice), Color.GREEN);
AddLabel(yes, "Ask: " + AsText(askPrice), Color.RED);

Display mark, last, bid, and ask side by side in chart labels. Useful for spread analysis on intraday charts.

Price type comparison

Mark vs. last, bid, and ask

thinkScript supports four PriceType constants. Each returns a different price quotation from the close function.

PriceTypeDescriptionCommon use
PriceType.MARKEstimated fair value based on bid and askFutures and options pricing
PriceType.LASTMost recent traded priceEquities and general charting
PriceType.BIDHighest current buy order priceSelling and spread analysis
PriceType.ASKLowest current sell order priceBuying and spread analysis

Frequently asked questions

Build a mark price study with AI

Describe what you want to display in plain English. The Pineify thinkorswim AI Coding Agent generates a complete thinkScript file with PriceType.MARK and the correct close function syntax. Review the source, then test it on an intraday chart in the Editor.

Open the thinkScript AI agent

This page is for educational and informational purposes. It does not provide investment advice, predict future prices, or guarantee trading results.