StockFetcher Forums · Filter Exchange · VIX and backtesting a filter<< 1 2 >>Post Follow-up
einok
msg #91747
Ignore einok
4/28/2010 2:11:51 PM

Is it possible to add the VIX as a condition of entry on a filter for backtesting?

Such as VIX is a certain percentage above/below a specific moving average?

Thanks

Kevin_in_GA
4,599 posts
msg #91750
Ignore Kevin_in_GA
modified
4/28/2010 5:24:05 PM

Have you searched on this before posting your question? Or read the manual?

You asked this question back in January, and I thought it was answered then.

OK, one more time:

set{VIX, ind(^VIX, close)}
set{VIXMA, cma(vix,10)}
set{upperlimit, VIXMA * 1.1}
set{lowerlimit, VIXMA * 0.9}

set{BUYTRIGGER, count(VIX above upperlimit,1)}
set{SELLTRIGGER, count(VIX below lowerlimit,1)}

add column BUYTRIGGER
add column SELLTRIGGER

draw upperlimit on plot VIXMA
draw lowerlimit on plot VIXMA
draw VIX on plot VIXMA

NOTE: this general structure can be modified to use ANY stock or index, any moving average, and/or any percentage above/below as a trigger.

moby
314 posts
msg #91752
Ignore moby
modified
4/28/2010 6:05:17 PM

Fetcher[
set{VIX, ind(^VIX, close)}
set{VIXMA, cma(vix,10)}
set{upperlimit, VIXMA * 1.1}
set{lowerlimit, VIXMA * 0.9}

set{BUYTRIGGER, count(VIX above upperlimit,1)}
set{SELLTRIGGER, count(VIX below lowerlimit,1)}

and buytrigger above 0.5

add column BUYTRIGGER
add column SELLTRIGGER


set{ccDiff, close - close 1 day ago}
add column ccDiff

draw upperlimit on plot VIXMA
draw lowerlimit on plot VIXMA
draw VIX on plot VIXMA


price is between 1 and 50
volume > 300000

sort column 13 descending
]




chetron
2,817 posts
msg #91753
Ignore chetron
4/28/2010 6:24:45 PM

missing a ")"

Kevin_in_GA
4,599 posts
msg #91755
Ignore Kevin_in_GA
4/28/2010 7:29:31 PM

You're right - I just fired this one off without checking. Thanks for the catch.

einok
msg #91756
Ignore einok
4/28/2010 8:02:02 PM

Kevin,

I didn't ask anything about adding it to a filter in January. Maybe I didn't make myself clear. What I am trying to do is to add VIX when I am backtesting a filter.

For instance with price, RSI makes a move below 20 AND the VIX is some % above a moving average. At that point, buy.

Hope this makes sense.



Kevin_in_GA
4,599 posts
msg #91758
Ignore Kevin_in_GA
4/28/2010 8:49:17 PM

This coding should allow you to do this. You had posted in January on the use of VIX above a certain percentage versus above its Bollinger Bands. Either approach should work.

einok
msg #91780
Ignore einok
4/29/2010 10:56:29 AM

HI Kevin,

I added this to my filter and backtested it. The results were the same as without. What I am trying to do in my back testing is have the filter buy only when the VIX is triggering a buy signal.

Thanks

Kevin_in_GA
4,599 posts
msg #91793
Ignore Kevin_in_GA
4/29/2010 4:36:34 PM

set{BUYTRIGGER, count(VIX above upperlimit,1)}
set{SELLTRIGGER, count(VIX below lowerlimit,1)}

add the line

buytrigger above 0.5

since buytrigger is by definition either 0 or 1, adding this filter will only provide stocks when the VIX is above your preset upper limit.

moby
314 posts
msg #91804
Ignore moby
4/29/2010 11:42:53 PM

Four: I added the line you said, not sure if I added it in the right place?

StockFetcher Forums · Filter Exchange · VIX and backtesting a filter<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.