Sei sulla pagina 1di 9

5/19/2020 Learning Center — OptionPrice

This is Google's cache of https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Option-Related/OptionPrice.html. It is a snapshot of the page


as it appeared on Apr 11, 2020 20:18:59 GMT. The current page could have changed in the meantime. Learn more.

Full version Text-only version View source


Tip: To quickly find your search term on this page, press Ctrl+F or ⌘ -F (Mac) and use the find bar.

thinkorswim by TD AmeritradeLearning Center


Search Go

Advanced Search

Log Out

Thinkpipes Tutorial Videos


Overview
Learning History
Queue
Charting
Introduction
Charts
Studies
thinkScript®
Trading Services Blog
Release Notes
Events
Glossary and Strategies
Glossary
Quiz Central
faq
Product Info
Futures
Option Strategies
Forex
publications

Charting
thinkScript®

Expand All | Collapse All


Contents filter

thinkScript® Tutorials
Chapter 1. Overview
Chapter 2. Defining Variables
Chapter 3. Mathematical Functions
Chapter 4. Defining Inputs
Chapter 5. Using Averages
Chapter 6. Conditional Expressions
Chapter 7. Human-Readable Syntax
Chapter 8. Creating Strategies
Chapter 9. Formatting Output: Part I
Chapter 10. Formatting Output: Part II
Chapter 11. Referencing Historical Data
Chapter 12. Referencing Secondary Aggregation
Chapter 13. Past/Future Offset and Prefetch
Chapter 14. Referencing Other Data
Chapter 15. Concatenating Strings
Chapter 16. Conclusion
Appendix A. Creating Local Alerts
Appendix B. Using Profiles
Appendix C. Customizing Study Hints
Appendix D. Using NaN and Infinity Constants
Reference upd
+ Reserved Words
above
https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 1/9
5/19/2020 Learning Center — OptionPrice
ago
and
bar
bars
below
between
case
crosses
declare
def
default
do
else
equal
equals
false
fold
from
greater
if
+ input
boolean
constant
enum
float
integer
price
string
is
less
no
not
or
plot
profile
rec
reference
script
switch
than
then
to
true
while
with
within
yes
+ Declarations
hide_on_daily
hide_on_intraday
lower
on_volume
once_per_bar
real_size
upper
weak_volume_dependency
zerobase
− Functions upd
+ Fundamentals
ask
bid
close
high
hl2
hlc3
imp_volatility
low
ohlc4
open
open_interest
tick_count
volume
https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 2/9
5/19/2020 Learning Center — OptionPrice
vwap
− Option Related
Delta
Gamma
GetATMOption
GetDaysToExpiration
GetNextExpirationOption
GetNextITMOption
GetNextOTMOption
GetStrike
GetUnderlyingSymbol
IsEuropean
IsOptionable
IsPut
OptionPrice
Rho
Theta
Vega
+ Technical Analysis
AccumDist
Average
BodyHeight
EMA2
ExpAverage
FastKCustom
GetMarketMakerMove
GetMaxValueOffset
GetMinValueOffset
Highest
HighestAll
HighestWeighted
IsAscending
IsDescending
IsDoji
IsLongBlack
IsLongWhite
Lowest
LowestAll
LowestWeighted
Median
MidBodyVal
MoneyFlow
MovingAverage
TrueRange
Ulcer
WildersAverage
WMA
+ Mathematical and Trigonometric
AbsValue
ACos
ASin
ATan
Ceil
Cos
Crosses
Exp
Floor
IsInfinite
IsNaN
Lg
Log
Max
Min
Power
Random
Round
RoundDown
RoundUp
Sign
Sin
Sqr
Sqrt
https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 3/9
5/19/2020 Learning Center — OptionPrice
Sum
Tan
TotalSum
+ Statistical
Correlation
Covariance
Inertia
InertiaAll
LinDev
StDev
StDevAll
StErr
StErrAll
+ Date and Time
CountTradingDays
DaysFromDate
DaysTillDate
GetDay
GetDayOfMonth
GetDayOfWeek
GetLastDay
GetLastMonth
GetLastWeek
GetLastYear
GetMonth
GetTime
GetWeek
GetYear
GetYYYYMMDD
RegularTradingEnd
RegularTradingStart
SecondsFromTime
SecondsTillTime
+ Corporate Actions
GetActualEarnings
GetDividend
GetEstimatedEarnings
GetEventOffset
GetSplitDenominator
GetSplitNumerator
HasConferenceCall
HasEarnings
+ Look and Feel upd
AddChartBubble
AddCloud upd
AddLabel
AddVerticalLine
AssignBackgroundColor
AssignNormGradientColor
AssignPriceColor
AssignValueColor
Color
CreateColor
DefineColor
DefineGlobalColor
EnableApproximation
GetColor
GlobalColor
Hide
HideBubble
HidePricePlot
HideTitle
SetChartType
SetDefaultColor
SetHiding
SetLineWeight
SetPaintingStrategy
SetStyle
TakeValueColor
+ Portfolio
GetAveragePrice
GetOpenPL
https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 4/9
5/19/2020 Learning Center — OptionPrice
GetQuantity
GetTotalCash
+ Profiles
GetHighest
GetHighestValueArea
GetLowest
GetLowestValueArea
GetPointOfControl
MonkeyBars
Show
TimeProfile
VolumeProfile
+ Others
AddOrder
Alert
AsDollars
AsPercent
AsPrice
Assert
AsText
BarNumber
Between
CompoundValue
Concat
EntryPrice
First
FPL
Fundamental
GetAggregationPeriod
GetInterestRate
GetPriceType
GetSymbol
GetSymbolPart
GetValue
GetYield
HasContractChangeEvent
If
TickSize
TickValue
+ Constants
+ AggregationPeriod
MIN
TWO_MIN
THREE_MIN
FOUR_MIN
FIVE_MIN
TEN_MIN
FIFTEEN_MIN
TWENTY_MIN
THIRTY_MIN
HOUR
TWO_HOURS
FOUR_HOURS
DAY
TWO_DAYS
THREE_DAYS
FOUR_DAYS
WEEK
MONTH
OPT_EXP
+ Alert
BAR
ONCE
TICK
+ AverageType
EXPONENTIAL
HULL
SIMPLE
WEIGHTED
WILDERS
+ ChartType
BAR
https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 5/9
5/19/2020 Learning Center — OptionPrice
CANDLE
CANDLE_TREND
HEIKIN_ASHI
EQUIVOLUME
LINE
AREA
+ Color
BLACK
BLUE
CURRENT
CYAN
DARK_GRAY
DARK_GREEN
DARK_ORANGE
DARK_RED
DOWNTICK
GRAY
GREEN
LIGHT_GRAY
LIGHT_GREEN
LIGHT_ORANGE
LIGHT_RED
LIME
MAGENTA
ORANGE
PINK
PLUM
RED
UPTICK
VIOLET
WHITE
YELLOW
+ CrossingDirection
ABOVE
BELOW
ANY
+ Curve
FIRM
LONG_DASH
MEDIUM_DASH
SHORT_DASH
POINTS
+ Double
E
NaN
NEGATIVE_INFINITY
Pi
POSITIVE_INFINITY
+ EarningTime
ANY
BEFORE_MARKET
AFTER_MARKET
+ Events
CONFERENCE_CALL
DIVIDEND
EARNINGS
SPLIT
+ FundamentalType
HIGH
LOW
CLOSE
OPEN
HL2
HLC3
OHLC4
VWAP
VOLUME
OPEN_INTEREST
IMP_VOLATILITY
TICK_COUNT
+ MonkeyVolumeShowStyle
ALL
https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 6/9
5/19/2020 Learning Center — OptionPrice
LAST
NONE
+ NumberFormat
DOLLAR
THREE_DECIMAL_PLACES
TWO_DECIMAL_PLACES
+ OptionClass
CALL
PUT
+ OrderType
BUY_AUTO
BUY_TO_CLOSE
BUY_TO_OPEN
SELL_AUTO
SELL_TO_CLOSE
SELL_TO_OPEN
+ PaintingStrategy
ARROW_DOWN
ARROW_UP
BOOLEAN_ARROW_DOWN
BOOLEAN_ARROW_UP
BOOLEAN_POINTS
BOOLEAN_WEDGE_DOWN
BOOLEAN_WEDGE_UP
DASHES
HISTOGRAM
HORIZONTAL
LINE
LINE_VS_POINTS
LINE_VS_SQUARES
LINE_VS_TRIANGLES
POINTS
SQUARED_HISTOGRAM
SQUARES
TRIANGLES
VALUES_ABOVE
VALUES_BELOW
+ PricePerRow
AUTOMATIC
TICKSIZE
+ PriceType
ASK
BID
LAST
MARK
+ Sound
NoSound
Bell
Ding
Ring
Chimes
+ Data Types
Any
boolean
CustomColor
double
IDataHolder
int
String
Symbol
Data Conversion
+ Operators
Arithmetic
Comparison
Conditional
Indexing
Logical
Operator Precedence
thinkScript® Integration
Conditional Orders
Custom Quotes
Study Alerts
https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 7/9
5/19/2020 Learning Center — OptionPrice
Study Filters

OptionPrice
Profile: Studies and Strategies

Syntax

OptionPrice(IDataHolder strike, IDataHolder isPut, IDataHolder daysToExpiration, IDataHolder underlyingPrice, IDataHolder Volatility,
double isEuropean, double yield, double interestRate);

Default values:

strike: getStrike()
isPut: isPut()
daysToExpiration: getDaysToExpiration()
underlyingPrice: close(getUnderlyingSymbol())
Volatility: imp_volatility(getUnderlyingSymbol())
isEuropean: isEuropean()
yield: getYield()
interestRate: getInterestRate()

Description

Calculates the theoretical option price. By default, this function uses implied volatility averaged over different options for the underlying, so the returned
result is approximate.

Input parameters

Parameter Default value Description


strike - Defines the strike price for the option.
isPut - Defines whether or not the current is Put.
daysToExpiration - Defines the number of days till the expiration of the option.
underlyingPrice close(getUnderlyingSymbol()) Defines the price of underlying symbol.
Volatility imp_volatility(getUnderlyingSymbol()) Defines the volatility with which the theoretical price is calculated.
isEuropean - Defines whether or not the oprion is European.
yield - Defines the yield of the underlying symbol for the option.
interestRate - Defines the global interest rate.

Example

input underlying = "GOOG";


input strike = 700.0;
input expiration_date = 20140118;
input is_put = no;
input interest_rate = 0.06;
input yield = 0.0;
input is_european = no;

def iv;
if GetAggregationPeriod() < AggregationPeriod.DAY {
iv = imp_volatility(underlying, AggregationPeriod.DAY);
} else {
iv = imp_volatility(underlying);
}

plot TheoOptPrice = OptionPrice(strike, is_put, DaysTillDate(expiration_date), close(underlying), iv, is_european, yield, interest_rate);

This script plots the theoretical price of Google January 2014 call option with $700 strike and interest rate of 6%.

Usage in:

TheoreticalOptionPrice.

Market volatility, volume and system availability may delay account access and trade executions.

Past performance of a security or strategy is no guarantee of future results or investing success.

https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 8/9
5/19/2020 Learning Center — OptionPrice
Options are not suitable for all investors as the special risks inherent to options trading may expose investors to potentially rapid and substantial losses.
Prior to trading options, you should carefully read Characteristics and Risks of Standardized Options. Spreads, Straddles, and other multiple-leg option
strategies can entail substantial transaction costs, including multiple commissions, which may impact any potential return. Trading stocks, options,
futures and forex involves speculation, and the risk of loss can be substantial. Clients must consider all relevant risk factors, including their own
personal financial situation, before trading.

Trading foreign exchange on margin carries a high level of risk, as well as its own unique risk factors. Forex investments are subject to counter-party
risk, as there is no central clearing organization for these transactions. Please read the following risk disclosure before considering the trading of this
product: Forex Risk Disclosure

Access to real-time market data is conditioned on acceptance of the exchange agreements. Professional access differs and subscription fees may apply.
For details, see our Professional Rates & Fees.

Supporting documentation for any claims, comparison, statistics, or other technical data will be supplied upon request.

TD Ameritrade Institutional does not make recommendations or determine the suitability of any security, strategy or course of action for you through
your use of our trading tools. Any investment decision you make in your self-directed account is solely your responsibility.

TD Ameritrade Institutional, Division of TD Ameritrade, Inc., member FINRA/SIPC/NFA.

TD Ameritrade is a trademark jointly owned by TD Ameritrade IP Company, Inc. and The Toronto-Dominion Bank. © 2014 TD Ameritrade IP
Company, Inc. All rights reserved. Used with permission.

Powered by Magnolia - Intuitive CMS Software

Select Theme

Light
Dark

Feedback +

Learning Center

Rate Your Experience


Like
Tell us what you
think

If you have questions regarding a response or technical issue, please call 800-669-3900

ERROR for site owner:


Invalid domain for site key reCAPTCHA
Privacy - Terms

Cancel Submit

https://webcache.googleusercontent.com/search?q=cache:s9-9gKrxTfsJ:https://tlc.thinkpipes.com/center/charting/thinkscript/reference/Functions/Opti… 9/9

Potrebbero piacerti anche