Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Correct use of EXP() function? Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
stanaction
Posted : Monday, February 27, 2006 10:19:20 AM
Registered User
Joined: 3/25/2005
Posts: 22
How do you correctly use the exp() function?
I want to write a stop PCF. Let's suppose the stop is based on 0.3% return compounded per trading day on a stock purchased at the close 30 days ago.
I think the PCF would be something like c30*(1.003exp(30)) but it is returning extremely high figures. What's wrong with the syntax?
bustermu
Posted : Monday, February 27, 2006 11:33:12 AM
Registered User
Joined: 1/1/2005
Posts: 2,645
stanaction,

The function EXP is not the two place exponent function:

( x )exp( y ) = x^y

It is the single place exponential function:

EXP( y ) = 2.718...^y

Thus, the result you want is:

C30*1.003^30

or, equivalently:

C30*EXP(30*LOG(1.003))

as you please.

Thanks,
Jim Murphy
stanaction
Posted : Monday, February 27, 2006 11:41:10 AM
Registered User
Joined: 3/25/2005
Posts: 22
Thank you Jim, that's exactly what I needed.
All is bright and clear now!
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.