list
fun list(accountIdKey: String, marker: String? = null, count: Int? = null, status: OrderStatus? = null, fromDate: GregorianCalendar? = null, toDate: GregorianCalendar? = null, symbol: String? = null, securityType: SecurityType? = null, transactionType: OrderTransactionType? = null, marketSession: MarketSession? = null): OrdersResponse?
Content copied to clipboard
List orders for an account
Samples
import com.seansoper.batil.OptionsCalendar
import com.seansoper.batil.brokers.etrade.auth.Authorization
import com.seansoper.batil.brokers.etrade.services.Accounts
import com.seansoper.batil.brokers.etrade.services.Alerts
import com.seansoper.batil.brokers.etrade.services.Market
import com.seansoper.batil.brokers.etrade.services.Orders
import com.seansoper.batil.brokers.etrade.services.TransactionSortOrder
import com.seansoper.batil.brokers.etrade.services.orderPreview.buyButterflyCalls
import com.seansoper.batil.brokers.etrade.services.orderPreview.buyBuyWrite
import com.seansoper.batil.brokers.etrade.services.orderPreview.buyCallOptionMarket
import com.seansoper.batil.brokers.etrade.services.orderPreview.buyCallSpread
import com.seansoper.batil.brokers.etrade.services.orderPreview.buyCondorPuts
import com.seansoper.batil.brokers.etrade.services.orderPreview.buyEquityLimit
import com.seansoper.batil.brokers.etrade.services.orderPreview.sellCallOptionMarket
import com.seansoper.batil.brokers.etrade.services.orderPreview.sellEquityLimit
import com.seansoper.batil.brokers.etrade.services.orderPreview.sellIronCondor
import com.seansoper.batil.config.ClientConfig
import com.seansoper.batil.config.GlobalConfig
import java.time.LocalDate
import java.time.LocalTime
import java.time.ZoneId
import java.time.ZonedDateTime
import java.util.GregorianCalendar
fun main() {
//sampleStart
val configuration = GlobalConfig.parse(runtime)
val client = Authorization(configuration, runtime.production, runtime.verbose)
val session = client.renewSession() ?: client.createSession()
val accounts = Accounts(session, runtime.production, runtime.verbose)
accounts.list()?.let {
it.first().accountIdKey.let { accountIdKey ->
val service = Orders(session, runtime.production, runtime.verbose)
service.list(accountIdKey)?.let {
println("Orders for account $accountIdKey")
println(it)
}
}
}
//sampleEnd
}
Parameters
accountIdKey
The unique account key
marker
Specifies the desired starting point of the set of items to return, used for paging
count
Number of transactions to return in the response, defaults to 25, max is 100, used for paging
status
Filter by status
fromDate
The earliest date to include in the date range, history is available for two years
toDate
The latest date to include in the date range, both fromDate and toDate should be provided andtoDate should be greater than fromDate
symbol
Market symbol for the security being bought or sold
securityType
The security type
transactionType
Type of transaction
marketSession
Session in which the equity order will have been placed
Sources
jvm source
Link copied to clipboard