Using two datasets in a strategy
Author: dankimel
Creation Date: 6/7/2013 10:05 AM
profile picture

dankimel

#1
I believe I've seen that you can use two different datasets in the same strategy.

For example, you might use dataset1 for going long in your strategy, while using dataset2 for going short.

Can you tell me how to do this, or show me where the directions are?

Thanks.
profile picture

Eugene

#2
One can't use multiple DataSets in one Strategy. What we can do instead is:

* Use external symbols' data from other DataSets
* Combine symbols from multiple DataSets into one using the Watchlist provider
* Treat subset of symbols from real DataSets as virtual "DataSets" for going long/short (by coding a simple routine)
* Add two copies of a strategy to a new Combination Strategy, and assign two DataSets - one for going long and another for going short
profile picture

sedelstein

#3
Hello Eugene

Can you point to an example of
QUOTE:
Treat subset of symbols from real DataSets as virtual "DataSets" for going long/short (by coding a simple routine)
if possible.

Searching I found this http://www.wealth-lab.com/Forum/Posts/How-to-create-a-DataSet-with-subset-of-symbols-from-another-DataSet-32701 but isn't quite the same as what you mention above.

Thank you
profile picture

Eugene

#4
Steve,

The logic behind it is so evident that there's no example. Suppose you have a combined big DataSet that includes symbols for going long/short. By querying the Bars.Symbol property and comparing it against a list (either inline or in external file etc.), your strategy decides whether to go long or go short on current symbol.
profile picture

sedelstein

#5
Okay

No worries. I actually discovered I could use alert.Type which works as well. and that the canned "Weak-stock rotation" might be helpful as well

Thanks
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).