PureBytes Links
Trading Reference Links
|
Here what I've used.
-----
hvLen = Param("hv",100,20,200,10);
function hv(period)
{
return StDev(log(C/Ref(C,-1)),period)*100*16;
}
hv100 = hv(100); hv6 = hv(6);
Plot(Hv6/Hv100,"s/lv",4);
Plot(Hv6/Hv100,"hvs/hvl",7);
Plot(1,"",7,4);
Plot(Hv100,"hv100",5,styleOwnScale);
Filter = Hv100 > 50 AND ADX(14) > 30;
AddColumn(Hv100," hv ",2.1);
AddColumn(Hv6/Hv100,"hv ratio",2.1);
AddColumn(ADX(14),"ADX14");
AddColumn(PDI(14) - MDI(14),"dir");
/*Connors and Raschke NR4 Historical Volatility System. Compares the 6
day volatility to the 100 day volatility. When this ratio drops below
50%, a buy stop and sell stop bracket the current price, expecting
historical volatility to revert to the mean. Four day Narrow-Range (NR4)
and Inside Day patterns are used to filter the trades to increase
probabilities. For further explanation, refer to "Street Smarts" from
Connors and Raschke.
Formula:
Connors and Raschke Historical Volatility System
For further explanation, refer to "Street Smarts" by Connors and
Raschke.
Ported from Metastock code by Daniel Ervi
NumColumns = 5;
VolRatio = StDev(log(C/Ref(C,-1)),5) / StDev(log(C/Ref(C,-1)),99);
Column0 = VolRatio;
Column0Name = "VolRatio";
NR4Day = (H - L) < Ref(LLV(H-L,3),-1);
Column1 = NR4Day;
Column1Name = "Nr4Day";
InsideDay = H < Ref(High,-1) AND Low > Ref(Low,-1);
Column2 = InsideDay;
Column2Name = "Inside Day";
Column3 = High + 0.125;
Column3Name = "Buy Stop";
Column4 = Low - 0.125;
Column4Name = "Sell Stop";
Filter = VolRatio < 0.5 AND (NR4Day == 1 AND InsideDay == 1);
Buy = Filter;
*/
-----Original Message-----
From: gosub283 [mailto:gosub283@xxxxxxxxx]
Sent: Friday, September 10, 2004 10:20 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Historical Volatility - OPTIONS
Hi,
Does anyone have some chart/indicator code
to display the "nDays historical volatility" for
a stock ?
I am experimenting with options trading.
When I look at the formula for 30 day
historical volatility, it is a bit beyond
my AFL abilities to program.
Anyone plotted this before.??
Much appreciated,
Gosub283
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|