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

Notification

Icon
Error

Options
Go to last post Go to first unread
menage  
#1 Posted : Sunday, November 7, 2010 11:05:27 PM(UTC)
menage

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/15/2010(UTC)
Posts: 3

I am trying to undertake/develop/find an exploration to search for stocks that have a 20 day SV within a percentile band. Typically I would look for 20 day SV above 70 to sell option contracts against & 20 day SV below 30 to buy options against an underlying. The percentile would usually be over a minum look back period of between 250 & 400 days.

Is anybody able to assist with a suitable exploration.

Thanks
johnl  
#2 Posted : Monday, November 8, 2010 6:42:38 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

I would define the "statistical volatility" in an indicator first before jumping into the exploration. What formula are you going to use for the probability distribution?
menage  
#3 Posted : Monday, November 8, 2010 9:15:01 PM(UTC)
menage

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/15/2010(UTC)
Posts: 3

Here is the code for the SV I use----Std(Log(C/Ref(C,-1)),20)*Sqrt(365)*100-----

To get the Percentile my simplified understanding is we need to determine the High & the low over a specified period to determine the range. Next step is to rank in order how may readings are under/over todays SV & from from here put it into a percentile. I know in Amibroker they have a function being:
percentile ( array, period )---Does something similiar exist is Metastock? If it does I can use the Fml function with my SV however if a percentile function does not exist in MS I fear the math/coding may be beyond me. Any advice would be appreciated
johnl  
#4 Posted : Wednesday, November 10, 2010 8:55:34 AM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

How about something like this:

p1:=Std(Log(C/Ref(C,-1)),20)*Sqrt(365)*100;
{------------------------------------}
a0:=(p1-Ref(p1,-1));
a1:=(C-Ref(C,-1))/Ref(a0,-1);
a2:=If(a1>50,50,If(a1<-50,-50,a1));
{------------------------------------}
b1:=Std(a2*(a2>0),20);
b2:=Std(a2*(a2<0),20);
b1;-b2;
c1:=Mov(C,20,S);
c2:=(C-c1);
c2

Plot with 3 different colors.


menage  
#5 Posted : Thursday, November 11, 2010 12:44:53 AM(UTC)
menage

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/15/2010(UTC)
Posts: 3

John

Thanks for your help however I am a little confused as relates to how I load this into metastock & plot with 3 colours etc. I am learning to write basic code however this has lost me a little, I will have a good look to ascertain the math behind your code and hopefully from there gain a greater understanding of what you have put forward.

Thanks
Users browsing this topic
Guest (Hidden)
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.