Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Can you write a strategy to trade multiple markets with the same strategy?
I would like to develop a strategy that trades multiple markets.
For example I would like to survey a handful of futures contracts, select one, and trade that market until the strategy switches to another contract in another market.
To illustrate, let's say that the strategy determines that gold is developing the strongest trend. The strategy would enter in the direction of that trend. Eventually, the strategy determines that crude is developing the strongest trend, so we'd exit gold and enter crude.
If this is possible in TradeStation, can someone please point me in the right direction? I've tried searching to no avail.
Could you place an order on "data2" for example?
If not, maybe you can load multiple charts with the primary contract as "data1"?
Any help at all would be much appreciated!
Thanks for taking the time to read this!
Can you help answer these questions from other members on NexusFi?
Sure you could, there are a bunch of ways it can be done, here is one simple way:
1. Calculate the 50 bar $ per contract move for 4 different markets:
Data2: ES
Data3: CL
Data4: GC
Data5: KC
Whichever one has the greatest trend, trade that in the direction of that trend.
I just used $ per contract move for the trend. You could instead use point value move, percentage move, or whatever you want to use to define trend.
You'd have 4 charts, and data1 would vary on each of them. You can only trade data1.
Here is example code and workspace. I did only a bit of checking, but it looks like it enters and exits correctly, and is in only 1 market at a time.
So, make sure you check everything I have done.
I just tried this with a 50 bar trend (2.5 months of daily data), and surprisingly it is not too bad (although it loses overall in ES and GC).
Once you see what I did, you could easily expand this to more markets and customize all you wish. I just wanted to show one possible way it could be done.
GOOD LUCK!
Kevin
Please let me know if you see any mistakes. I have been up since 3 AM, so I might have some errors...
10:30 AM - Fixed a code error, uploaded new ELD and equity curve