list Transactions
fun listTransactions(accountIdKey: String, startDate: GregorianCalendar? = null, endDate: GregorianCalendar? = null, sortOrder: TransactionSortOrder? = null, startAt: TransactionId? = null, count: Int? = null): TransactionResponse?
Content copied to clipboard
List transactions 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 service = Accounts(session, runtime.production, runtime.verbose)
service.list()?.let {
it.first().accountIdKey.let { accountIdKey ->
service.listTransactions(accountIdKey, sortOrder = TransactionSortOrder.DESC, count = 5)?.let {
println("List five most recent transactions")
println(it)
}
}
}
//sampleEnd
}
Parameters
accountIdKey
The unique account key
startDate
The earliest date to include in the date range, history is available for two years
endDate
The latest date to include in the date range
sortOrder
Sort order for results
startAt
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 50, used for paging
Sources
jvm source
Link copied to clipboard