Message-ID: <6A437605-918B-4E2C-A154-A0782C5AA67A@gmail.com>
Date: 2007-05-08T04:28:22Z
From: James
Subject: Plotting 2 option value lines
In-Reply-To: <8ed68eed0705072113r22d3d22do64041928dd00baed@mail.gmail.com>
Good morning to you too. You must be on the other side of the globe,
since I'm actually thinking about heading off to bed soon. Thanks
for your help. I tried out your suggestion and it works great.
Thank you. I also managed to get it to work using:
> points(x, c2, type="l", col="blue")
Again, thank you, and I'll keep reading Chapter 12 in "An
Introduction to R".
James
On May 7, 2007, at 10:13 PM, Sean O'Riordain wrote:
> Good morning James,
>
> You need to use lines() for the second "over-plot" with a different
> line type so you'd say something like...
>
> library(fOptions )
> x <- (50:80)
> c1 <- GBSOption(TypeFlag="c", S=x, X=65, Time=1/4, r=.08, b=.08,
> sigma=.3)@price
> c2 <- GBSOption(TypeFlag="c", S=x, X=65, Time=0.000000001, r=.08,
> b=.08, sigma=.3)@price
> plot(x,c1, type="l")
> lines(x,c2, lty=3)
>
> Then you might add something like...
> legend("top",c("Expiration","3 Months"),lty=c(1,3))
>
> For more information on the basics of plotting have a really slow read
> of section 12 of "An Introduction to R" which should have come with
> your install of R. Then go through the manual pages for things like
> "lines", "legend", "plot", "plot.default" etc...
>
> On the options pricing question, I'm afraid I can't help you.
>
> Best Regards,
> Sean