lll

© All Rights Reserved

3 views

lll

© All Rights Reserved

- 262585680 Abe Cofnas Sentiment Indicators Renko Price Break Kagi Point and Figure 2010 292 Pages.85
- 262585680 Abe Cofnas Sentiment Indicators Renko Price Break Kagi Point and Figure 2010 292 Pages.1
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..131
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..121
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..127
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..233
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..200
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..257
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..312
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..11
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..302
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..189
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..149
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..58
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..192
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..270
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..310
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..311
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..315
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..181

You are on page 1of 1

class Fixed(Mortgage):

def __init__(self, loan, r, months):

Mortgage.__init__(self, loan, r, months)

self.legend = 'Fixed, ' + str(r*100) + '%'

class FixedWithPts(Mortgage):

def __init__(self, loan, r, months, pts):

Mortgage.__init__(self, loan, r, months)

self.pts = pts

self.paid = [loan*(pts/100.0)]

self.legend = 'Fixed, ' + str(r*100) + '%, '\

+ str(pts) + ' points'

class TwoRate(Mortgage):

def __init__(self, loan, r, months, teaserRate, teaserMonths):

Mortgage.__init__(self, loan, teaserRate, months)

self.teaserMonths = teaserMonths

self.teaserRate = teaserRate

self.nextRate = r/12.0

self.legend = str(teaserRate*100)\

+ '% for ' + str(self.teaserMonths)\

+ ' months, then ' + str(r*100) + '%'

def makePayment(self):

if len(self.paid) == self.teaserMonths + 1:

self.rate = self.nextRate

self.payment = findPayment(self.owed[-1], self.rate,

self.months - self.teaserMonths)

Mortgage.makePayment(self)

Figure 11.3 contain functions that can be used to generate plots intended to

provide insight about the different kinds of mortgages.

The function plotMortgages generates appropriate titles and axis labels for each

plot, and then uses the methods in MortgagePlots to produce the actual plots. It

uses calls to pylab.figure to ensure that the appropriate plots appear in a given

figure. It uses the index i to select elements from the lists morts and styles in a

way that ensures that different kinds of mortgages are represented in a consistent

way across figures. For example, since the third element in morts is a variablerate mortgage and the third element in styles is 'b:', the variable-rate mortgage

is always plotted using a blue dotted line.

The function compareMortgages generates a list of different mortgages, and

simulates making a series of payments on each, as it did in Chapter 8. It then

calls plotMortgages to produce the plots.

149

- 262585680 Abe Cofnas Sentiment Indicators Renko Price Break Kagi Point and Figure 2010 292 Pages.85Uploaded byZhichaoWang
- 262585680 Abe Cofnas Sentiment Indicators Renko Price Break Kagi Point and Figure 2010 292 Pages.1Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..131Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..121Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..127Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..233Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..200Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..257Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..312Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..11Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..302Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..189Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..149Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..58Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..192Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..270Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..310Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..311Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..315Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..181Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..162Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..123Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..223Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..293Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..160Uploaded byZhichaoWang
- Introduction to Computation and Programming Using Python%2C Revised - Guttag%2C John v..126Uploaded byZhichaoWang