Pagina 1 van 1

Implied Volatility

BerichtGeplaatst: za 18 okt 2003, 23:46
door geert udema
Ik heb geen I.V. functie in Vesticode kunnen vinden.
Wie kan mij er aan helpen ?
Groetend, Geert Udema

Implied Volatility

BerichtGeplaatst: za 18 okt 2003, 23:48
door geert udema
Ik bedoel I.V. = Implied Volatility,
Groetend, Geert.

Implied Volatility

BerichtGeplaatst: zo 19 okt 2003, 9:30
door GMe
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;

Implied Volatility

BerichtGeplaatst: za 01 nov 2003, 23:57
door zjostwee
Is er iemand die deze TS code kan omzetten in VESTICODE ....?? ? ?Graag hulp

Implied Volatility

BerichtGeplaatst: zo 02 nov 2003, 16:32
door GMe
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;

Implied Volatility

BerichtGeplaatst: ma 03 nov 2003, 22:12
door zjostwee
Dank je Geert
jos