Het wordt tijd dat alle TS functions in vestics beschikbaar komen. Ik knip en plak me een bult op de rug

{*******************************************************************
Description: This Function returns Next3rdFriday
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}
Inputs: Series(Numeric);
Variables: WorkDay(0), Month1(0), Year1(0), MonthTarget(0), DayTarget(0), YearTarget(0), FirstFriday(0), ThirdFriday(0), JulianTarget(0), julianNow(0), SZMonth(0), SZDay(0), SZYear(0), SeriesRotation(1);
SeriesRotation = Series - 1;
SZDay = DayOfMonth(Date);
SZMonth = Month(Date);
SZYear = Year(Date);
WorkDay = DayOfWeek((SZYear * 10000) + (100 * SZMonth) + 1);
If WorkDay = 0 Then
FirstFriday = 6;
If WorkDay = 1 Then
FirstFriday = 5;
If WorkDay = 2 Then
FirstFriday = 4;
If WorkDay = 3 Then
FirstFriday = 3;
If WorkDay = 4 Then
FirstFriday = 2;
If WorkDay = 5 Then
FirstFriday = 1;
If WorkDay = 6 Then
FirstFriday = 7;
ThirdFriday = FirstFriday + 14;
If ThirdFriday > SZDay Then Begin
Month1 = SZMonth;
Year1 = SZYear;
End
Else Begin
Month1 = SZMonth + 1;
If Month1 = 13 Then Begin
Month1 = 1;
Year1 = SZYear + 1;
End
Else Begin
Year1 = SZYear;
End;
End;
MonthTarget = Month1+SeriesRotation;
If MonthTarget > 12 Then Begin
MonthTarget = MonthTarget - 12;
YearTarget = Year1 + 1;
End
Else Begin
YearTarget = Year1;
End;
WorkDay = DayOfWeek((YearTarget * 10000) + (100 * MonthTarget) + 1);
If WorkDay = 0 Then
FirstFriday = 6;
If WorkDay = 1 Then
FirstFriday = 5;
If WorkDay = 2 Then
FirstFriday = 4;
If WorkDay = 3 Then
FirstFriday = 3;
If WorkDay = 4 Then
FirstFriday = 2;
If WorkDay = 5 Then
FirstFriday = 1;
If WorkDay = 6 Then
FirstFriday = 7;
DayTarget = FirstFriday + 14;
julianNow = DateToJulian((10000 * SZYear) + (100 * SZMonth) + SZDay);
JulianTarget = DateToJulian((10000 * YearTarget) + (100 * MonthTarget) + DayTarget);
Next3rdFriday = JulianTarget-JulianNow;
{*******************************************************************
Description: This type paints the bar of expiration
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}
If Next3rdFriday(1)[1] = 1 Then Begin
PlotPaintBar(High, Low, "Expiration");
Alert("Alert on Expiration bar");
End;