thinkScript price types
Mark Price in thinkScript
PriceType.MARK requests the platform mark quotation. 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
- Non-Forex: intraday, up to 15 days
Direct answer
What the mark price is and when to use it
The mark series is a platform quotation reference. The API reference does not specify one universal mark formula for all instruments. It does not prove intrinsic value, freshness, or an available execution price.
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 | Platform-provided mark quotation, not a guaranteed fill | 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
What is the mark price in thinkorswim?
PriceType.MARK requests the platform-provided mark series. The API reference does not establish a universal calculation formula for every instrument. Treat mark as a quotation reference, not intrinsic value or a guaranteed execution price.
How do I reference the mark price in thinkScript?
Use PriceType.MARK with the close function. For example, close(priceType = PriceType.MARK) returns the mark price. You can also make it configurable with an input: input priceType = PriceType.MARK, then close(priceType = priceType).
What are the chart limitations for PriceType.MARK?
According to the thinkorswim Learning Center, PriceType.MARK is only supported on intraday charts with a time interval not greater than 15 days for non-Forex symbols. On daily or longer charts, or on charts with a longer intraday range, the mark price may not be available.
How does mark price differ from last price?
LAST requests trade-based prices; MARK requests the mark series. Either can be unavailable or stale depending on the feed and chart context. A difference does not establish an executable arbitrage.
Can I use PriceType.MARK for options?
Yes, but be aware of the chart limitation. For non-Forex symbols, PriceType.MARK only works on intraday charts with a time interval of 15 days or less. BID and ASK share the same documented non-Forex chart restriction, so averaging them does not bypass it.
Can Pineify generate a thinkScript study that uses the mark price?
Yes. Describe what you want to display in plain English. The Pineify thinkorswim AI Coding Agent can draft the source, but does not compile it in thinkorswim or establish data availability. Check the function calls and test the output on a supported chart.
Build a mark price study with AI
Describe what you want to display in plain English. The Pineify thinkorswim AI Coding Agent can draft the source. Check the syntax in thinkorswim and inspect whether your chart actually supplies MARK data.
This page is for educational and informational purposes. It does not provide investment advice, predict future prices, or guarantee trading results.