Implied Volatility

Vragen en suggesties over Vesticode

Moderator: Perry

Implied Volatility

Berichtdoor geert udema » za 18 okt 2003, 23:46

Ik heb geen I.V. functie in Vesticode kunnen vinden.
Wie kan mij er aan helpen ?
Groetend, Geert Udema
geert udema
 
Berichten: 114
Geregistreerd op: ma 31 dec 2001, 11:45

Implied Volatility

Berichtdoor geert udema » za 18 okt 2003, 23:48

Ik bedoel I.V. = Implied Volatility,
Groetend, Geert.
geert udema
 
Berichten: 114
Geregistreerd op: ma 31 dec 2001, 11:45

Implied Volatility

Berichtdoor GMe » zo 19 okt 2003, 9:30

Hier de Functie uit TS, geen idee of het in vestics werkt.



{ *******************************************************************
Description: This Function returns ImpliedVolatility
Provided By: Omega Research, Inc. (c) Copyright 1999
*********************************************************************}

Inputs: ExMonth(Numeric), ExYear(Numeric), Strike(Numeric), Rate(Numeric), OptPrice(Numeric), Type(Numeric), Asset(Numeric);
Variables: ModelOptionPrice(0), TestVolatility(0), MaxIts(0), Guess(0), ExitFlag(True);

If ExMonth > 0 AND ExMonth <13 AND Strike <> 0 AND Rate <> 0 AND OptPrice <> 0 AND Asset <> 0 Then Begin
MaxIts = 0;
ExitFlag = True;
ModelOptionPrice = 0;
TestVolatility = 0;
While ModelOptionPrice < OptPrice AND ExitFlag Begin
TestVolatility = TestVolatility + 1;
If Category = 1 Then
ModelOptionPrice = BlackModel(DaysToExpiration(ExMonth, ExYear), Strike, Asset, Rate, TestVolatility, Type)
Else
ModelOptionPrice = BlackScholes(DaysToExpiration(ExMonth, ExYear), Strike, Asset, Rate, TestVolatility, Type);
MaxIts = MaxIts + 1;
If MaxIts > 100 Then Begin
ImpliedVolatility = 0;
ExitFlag = False;
End;
End;

MaxIts = 0;
ExitFlag = True;
While ModelOptionPrice > OptPrice AND ExitFlag Begin
TestVolatility = TestVolatility - .1;
If Category = 1 Then
ModelOptionPrice = BlackModel(DaysToExpiration(ExMonth, ExYear), Strike, Asset, Rate, TestVolatility, Type)
Else
ModelOptionPrice = BlackScholes(DaysToExpiration(ExMonth, ExYear), Strike, Asset, Rate, TestVolatility, Type);
MaxIts = MaxIts + 1;
If MaxIts > 100 Then Begin
ImpliedVolatility = 0;
ExitFlag = False;
End;
End;

ImpliedVolatility = TestVolatility;
End
Else
ImpliedVolatility = 0;
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Implied Volatility

Berichtdoor zjostwee » za 01 nov 2003, 23:57

Is er iemand die deze TS code kan omzetten in VESTICODE ....?? ? ?Graag hulp
zjostwee
 
Berichten: 53
Geregistreerd op: zo 24 aug 2003, 12:10

Implied Volatility

Berichtdoor GMe » zo 02 nov 2003, 16:32

Deze functie doet het nu in Vestics. Het stukje code om de ModelOptionPrice te bereken voor Catagory = 1 is eruit gehaald. ?Category is een 'Reserved Word' in TS om te kijken of je met een aandeel, future, optie, ...... van doen hebt.
Of het ding nu nog precies doet wat het moet doen weet ik niet :)


{ *******************************************************************
Description: This Function returns ImpliedVolatility
Provided By: Omega Research, Inc. (c) Copyright 1999
*********************************************************************}

Inputs: ExMonth(Numeric), ExYear(Numeric), Strike(Numeric), Rate(Numeric), OptPrice(Numeric), Type(Numeric), Asset(Numeric);
Variables: ModelOptionPrice(0), TestVolatility(0), MaxIts(0), Guess(0), ExitFlag(True);

If ExMonth > 0 AND ExMonth <13 AND Strike <> 0 AND Rate <> 0 AND OptPrice <> 0 AND Asset <> 0 Then Begin
MaxIts = 0;
ExitFlag = True;
ModelOptionPrice = 0;
TestVolatility = 0;
While ModelOptionPrice < OptPrice AND ExitFlag Begin
TestVolatility = TestVolatility + 1;
ModelOptionPrice = BlackScholes(DaysToExpiration(ExMonth, ExYear), Strike, Asset, Rate, TestVolatility, Type);
MaxIts = MaxIts + 1;
If MaxIts > 100 Then Begin
ImpliedVolatility = 0;
ExitFlag = False;
End;
End;

MaxIts = 0;
ExitFlag = True;
While ModelOptionPrice > OptPrice AND ExitFlag Begin
TestVolatility = TestVolatility - .1;
ModelOptionPrice = BlackScholes(DaysToExpiration(ExMonth, ExYear), Strike, Asset, Rate, TestVolatility, Type);
MaxIts = MaxIts + 1;
If MaxIts > 100 Then Begin
ImpliedVolatility = 0;
ExitFlag = False;
End;
End;

ImpliedVolatility = TestVolatility;
End
Else
ImpliedVolatility = 0;
GMe
 
Berichten: 145
Geregistreerd op: zo 07 okt 2001, 16:16

Implied Volatility

Berichtdoor zjostwee » ma 03 nov 2003, 22:12

Dank je Geert
jos
zjostwee
 
Berichten: 53
Geregistreerd op: zo 24 aug 2003, 12:10


Keer terug naar Vesticode

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers en 18 gasten

cron