Is there a way to trade a symbol other than primary?
Author: rdevolde
Creation Date: 11/15/2010 7:28 PM
profile picture

rdevolde

#1
I'm not sure how to best explain this, however, I would like to be running a script on one symbol (say AAPL) and if a certain set of criteria are met, I would like buy a different symbol (say ABC).

I admit I haven't done a lot of research and I apologize if this question has been answered elsewhere (I did a quick search but really wasn't sure what terminology I should be searching for).

I am only familiar with the commands listed below at this time:

BuyAtMarket(int bar, "string symbolName"); (all the buy and short commands use these two arguments)

The cover and sell commands have an additional argument where you can select which symbol to sell. This is what I am looking for only on the buy and short commands. Please help! :)
profile picture

Eugene

#2
Sure it's possible. Check out this chapter from the WealthScript Programming Guide: Programming Trading Strategies > Multi-Symbol Strategies, then SetContext/RestoreContext in the QuickRef (hit F11).
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).