Package com.seansoper.batil.brokers.etrade.services.orderPreview

Helper methods to support creating both simple and complex orders.

Functions

buyButterflyCalls
Link copied to clipboard
fun buyButterflyCalls(symbol: String, strikes: Triple<Float, Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a butterfly with calls
buyButterflyPuts
Link copied to clipboard
fun buyButterflyPuts(symbol: String, strikes: Triple<Float, Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a butterfly with puts
buyBuyWrite
Link copied to clipboard
fun buyBuyWrite(symbol: String, strike: Float, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a buy-write
buyCallOptionLimit
Link copied to clipboard
fun buyCallOptionLimit(symbol: String, limitPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a call option using a limit price
buyCallOptionMarket
Link copied to clipboard
fun buyCallOptionMarket(symbol: String, limitPrice: Float, stopPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a call option using the market price.
buyCallSpread
Link copied to clipboard
fun buyCallSpread(symbol: String, limitPrice: Float, buyStrike: Float, sellStrike: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a call spread aka call debit spread aka bull call spread
buyCondorCalls
Link copied to clipboard
fun buyCondorCalls(symbol: String, lowerWing: Pair<Float, Float>, upperWing: Pair<Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a condor with calls
buyCondorPuts
Link copied to clipboard
fun buyCondorPuts(symbol: String, lowerWing: Pair<Float, Float>, upperWing: Pair<Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a condor with puts
buyEquityLimit
Link copied to clipboard
fun buyEquityLimit(symbol: String, limitPrice: Float, quantity: Int, clientOrderId: String = randomString()): PreviewRequest
Buy shares using a limit price
buyEquityMarket
Link copied to clipboard
fun buyEquityMarket(symbol: String, limitPrice: Float, stopPrice: Float, quantity: Int, clientOrderId: String = randomString()): PreviewRequest
Buy shares using the market price.
buyIronButterfly
Link copied to clipboard
fun buyIronButterfly(symbol: String, strikes: Triple<Float, Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy an iron butterfly
buyIronCondor
Link copied to clipboard
fun buyIronCondor(symbol: String, lowerWing: Pair<Float, Float>, upperWing: Pair<Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy an iron condor
buyPutOptionLimit
Link copied to clipboard
fun buyPutOptionLimit(symbol: String, limitPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a put option using a limit price
buyPutOptionMarket
Link copied to clipboard
fun buyPutOptionMarket(symbol: String, limitPrice: Float, stopPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a put option using the market price.
buyPutSpread
Link copied to clipboard
fun buyPutSpread(symbol: String, limitPrice: Float, buyStrike: Float, sellStrike: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Buy a put spread aka put debit spread aka bear put spread
sellButterflyCalls
Link copied to clipboard
fun sellButterflyCalls(symbol: String, strikes: Triple<Float, Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a butterfly with calls
sellButterflyPuts
Link copied to clipboard
fun sellButterflyPuts(symbol: String, strikes: Triple<Float, Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a butterfly with puts
sellCallOptionLimit
Link copied to clipboard
fun sellCallOptionLimit(symbol: String, limitPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a call option using a limit price.
sellCallOptionMarket
Link copied to clipboard
fun sellCallOptionMarket(symbol: String, limitPrice: Float, stopPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a call option using the market price.
sellCallSpread
Link copied to clipboard
fun sellCallSpread(symbol: String, limitPrice: Float, buyStrike: Float, sellStrike: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a call spread aka call credit spread aka bear call spread
sellCondorCalls
Link copied to clipboard
fun sellCondorCalls(symbol: String, lowerWing: Pair<Float, Float>, upperWing: Pair<Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a condor with calls
sellCondorPuts
Link copied to clipboard
fun sellCondorPuts(symbol: String, lowerWing: Pair<Float, Float>, upperWing: Pair<Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a condor with puts
sellEquityLimit
Link copied to clipboard
fun sellEquityLimit(symbol: String, limitPrice: Float, quantity: Int, clientOrderId: String = randomString()): PreviewRequest
Sell shares using a limit price.
sellEquityMarket
Link copied to clipboard
fun sellEquityMarket(symbol: String, limitPrice: Float, stopPrice: Float, quantity: Int, clientOrderId: String = randomString()): PreviewRequest
Sell shares using the market price.
sellIronButterfly
Link copied to clipboard
fun sellIronButterfly(symbol: String, strikes: Triple<Float, Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell an iron butterfly
sellIronCondor
Link copied to clipboard
fun sellIronCondor(symbol: String, lowerWing: Pair<Float, Float>, upperWing: Pair<Float, Float>, limitPrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell an iron condor
sellPutOptionLimit
Link copied to clipboard
fun sellPutOptionLimit(symbol: String, limitPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a put option using a limit price.
sellPutOptionMarket
Link copied to clipboard
fun sellPutOptionMarket(symbol: String, limitPrice: Float, stopPrice: Float, strikePrice: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a put option using the market price.
sellPutSpread
Link copied to clipboard
fun sellPutSpread(symbol: String, limitPrice: Float, buyStrike: Float, sellStrike: Float, quantity: Int, expiry: ZonedDateTime = OptionsCalendar.nextMonthly(), clientOrderId: String = randomString()): PreviewRequest
Sell a put spread aka put credit spread aka bull put spread