I am looking for a way to obtain dates and amounts of each cashflow in a leg, without having to pop the cashflows out of the leg, like this
for i in range(leg.size()):
x=leg.pop()
print(x.date(), x.amount())
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It only takes a minute to sign up.
Sign up to join this communityI am looking for a way to obtain dates and amounts of each cashflow in a leg, without having to pop the cashflows out of the leg, like this
for i in range(leg.size()):
x=leg.pop()
print(x.date(), x.amount())
A leg is just a list of cashflows:
for c in leg:
print(c.date(), c.amount())