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.
input priceType = PriceType.MARK;
plot MarkPrice = close(
priceType = priceType);
MarkPrice.SetDefaultColor(Color.CYAN);- 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 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 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.
| PriceType | Description | Common use |
|---|---|---|
| PriceType.MARK | Estimated fair value based on bid and ask | Futures and options pricing |
| PriceType.LAST | Most recent traded price | Equities and general charting |
| PriceType.BID | Highest current buy order price | Selling and spread analysis |
| PriceType.ASK | Lowest current sell order price | Buying and spread analysis |
Primary sources
Official thinkScript references used here
- PriceType.MARKOfficial constant reference with the chart limitation note.
- PriceType constantsFull list of PriceType constants for the close function.
- close functionFundamental function that accepts a priceType parameter.
- Custom Quotes documentationNotes on using AddLabel and AsText for formatted price output.
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.
This page is for educational and informational purposes. It does not provide investment advice, predict future prices, or guarantee trading results.