How to create ratio chart or call such function in strategy?
Author: Harapa
Creation Date: 9/20/2014 9:08 AM
profile picture

Harapa

#1
I like to use SPY:VIX ratio in strategy tester but doesn't know how to do this . Any help will be appreciated.
TIA.
profile picture

Eugene

#2
Here's how:
CODE:
Please log in to see this code.


And if you intend to use that in a trading strategy, there's a number of market-neutral systems already coded which can be downloaded (Open Strategy > Download...) - for example: Pairs Trading
profile picture

Harapa

#3
Thanks for your help. Now, I need to learn how to include this in a strategy. I have been looking into published strategies but haven't found one that fits the need. I will check again.
profile picture

Eugene

#4
In addition to the example strategy above, you can type in GetExternalSymbol (or SetContext) in Wealth-Lab's "Open Strategy" dialog > Search > Strategy Code. And performing "Download..." with "Published since" cleared will result in much more hits.

Further reading:

1. WealthScript Programming Guide > DataSeries > Accessing Secondary Symbols
2. QuickRef, Wiki
3. Full-text search the forum using Google by appending "site:wealth-lab.com/Forum/Posts/" to your search query.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).