logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
MS Support  
#1 Posted : Wednesday, June 15, 2022 5:34:18 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,834

Thanks: 79 times
Was thanked: 148 time(s) in 144 post(s)

Note: .VIX is not available with DataLink. You can replace any .VIX references in the formulas below with VXc1 as needed.

Markos Katsanos’ article, “Stock Market Seasonality”, explained a method for trading the market with a hybrid seasonal system. His system employs the VFI indicator Mr. Katsanos introduced in 2004. The formulas below include the code for the VFI.  You must create that indicator first and name it “VFI” and then create the system test. 

VFI Indicator:

name: VFI

formula:

Code:
VFIPeriod := 130;
Coef:= 0.2;
VCoef:= 2.5;
inter:= Log( Typical() ) - Log( Ref( Typical(), -1 ) );
Vinter:= Stdev(inter, 30 );
Cutoff:= Coef * Vinter * CLOSE;
Vave := Ref( Mov( V, VFIPeriod, S ), -1 );
Vmax := Vave * Vcoef;
Vc := Min( V, Vmax );
MF := Typical() - Ref( Typical(), -1 );
VCP := If( MF > Cutoff, VC, If( MF < -Cutoff, -VC, 0 ) );
VFIa := Sum( VCP , VFIPeriod )/Vave;
If(BarsSince(Cum(1)>268)>=0, Mov( VFIa, 3, E),0);

Seasonal Hybrid System:

Buy Order:

Code:
vix:= security("ONLINE:.VIX", C);
VFI:= Fml("VFI");
{Optimizations}
sellmonth:= opt1; {5 - 8, step 1}
vixupmax:= opt2; {50 or 60}
crit:= opt3; {15 or 20}
k:= opt4; {1.3 - 1.7, step 0.2)}
{system calculations}
vixdn:= (vix/ref(hhv(vix,25),-1)-1)*100;
vixup:= (vix/ref(llv(vix,25),-1)-1)*100;
atrdn:= (atr(15)/ref(hhv(atr(15),25),-1)-1)*100;
atrup:= (atr(15)/ref(llv(atr(15),25),-1)-1)*100;
{buy signal}
volcond:= (vixup < vixupmax OR atrup< k*vixupmax) and vfi>crit;
(month() >= 10 or month()<sellmonth) and ref(volcond, -1);

Sell Order:

Code:
vix:= security("ONLINE:.VIX", C);
VFI:= Fml("VFI");
{Optimizations}
sellmonth:= opt1; {5 - 8, step 1}
vixupmax:= opt2; {50 or 60}
crit:= opt3; {15 or 20}
k:= opt4; {1.3 - 1.7, step 0.2)}
{system calculations}
vixdn:= (vix/ref(hhv(vix,25),-1)-1)*100;
vixup:= (vix/ref(llv(vix,25),-1)-1)*100;
atrdn:= (atr(15)/ref(hhv(atr(15),25),-1)-1)*100;
atrup:= (atr(15)/ref(llv(atr(15),25),-1)-1)*100;
{sell signal}
sellseason:= Month() = sellmonth;
sellvol:= vixup> 2*vixupmax;
sellmf:= cross(crit, vfi) and mov(vfi,10,s)<Ref(mov(vfi,10,s),-1);
sellseason or ref(sellvol or sellmf, -1);

Optimization Variables:

OPT1:

Description: Sell Month

Minimum: 5

Maximum: 8

Step: 1

OPT2:

Description: Vix Up Max

Minimum: 50

Maximum: 60

Step: 10

OPT3:

Description: VFI Sell

Minimum: 15

Maximum: 20

Step: 5

OPT4:

Description: ATR VIX Ratio

Minimum: 1.3

Maximum: 1.7

Step: 0.2

Edited by user Thursday, November 10, 2022 7:45:22 PM(UTC)  | Reason: Not specified

Users browsing this topic
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.