Is it possible to create a composite symbol with division?

Zac

New member
Trying to show a composite symbol in a chart:
SPY/IWM

Division does not seem possible, probably because the character / is used for futures. You can only divide by a constant: SPY/2 + IWM/3

This is not a study, it's a symbol definition (like in a watchlist): https://tlc.thinkorswim.com/center/howToTos/thinkManual/charts/Useful-Tools/Composite-Symbols

Hacks like SPY * (1/IWM) or SPY * (IWM ^ -1) also do not work. Logs also not possible (at least I can't find it).

This was asked before, with no definite answer. The question was mistaken with a study. Again, this is not a study.

Is this possible?
 
Solution
First... TOS literally has a Pairs Trader built into it that handles this for two symbols, including ratios. May be worth checking out if you're trying to arbitrage similar securities. BTW, if your computer isn't literally connected to the exchange in the absolute closest room, you're out of luck. Lots of firms doing this already.

If you're pair trading and not arbitraging, that's cool... there's money to be made there for medium to long term trades.

Also, here's the answer you're (not) looking for. It's not possible.
Wr3DnZ3.jpg


Finally... Straight from the documentation page in the 2nd sentence!!!
Only two mathematical operations are available between the components: addition and subtraction.

Here's the...
Trying to show a composite symbol in a chart:
SPY/IWM

Division does not seem possible, probably because the character / is used for futures. You can only divide by a constant: SPY/2 + IWM/3

This is not a study, it's a symbol definition (like in a watchlist): https://tlc.thinkorswim.com/center/howToTos/thinkManual/charts/Useful-Tools/Composite-Symbols

Hacks like SPY * (1/IWM) or SPY * (IWM ^ -1) also do not work. Logs also not possible (at least I can't find it).

This was asked before, with no definite answer. The question was mistaken with a study. Again, this is not a study.

Is this possible?

I can't even attempt to guess what you are trying to do.
So I will supply the syntax to get you started on your quest:
Ruby:
def ESclose = close("/ES");
def SPYclose = close("SPX");
def x = (ESclose + SPYclose) /2;
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

I can't even attempt to guess what you are trying to do.
So I will supply the syntax to get you started on your quest:
Ruby:
def ESclose = close("/ES");
def SPYclose = close("SPX");
def x = (ESclose + SPYclose) /2;

instead of typing a symbol in the symbol darlta field box, he wants to enter a formula, that evaluates several stocks prices, into 1 combined price.

away from comp... i can't think of an answer . might have to be a study if division is desired ?
 
Last edited:
instead of typing a symbol in the symbol darlta field box, he wants to enter a formula, that evaluates several stocks prices, into 1 combined price.

away from comp... i can't think of an answer . might have to be a study if division is desired ?
Thanks, you are correct.

I am trying to avoid a study. I have a few of those on a watch list. I watch them daily and occasionally bring them on a chart to see changes and trends.
 
First... TOS literally has a Pairs Trader built into it that handles this for two symbols, including ratios. May be worth checking out if you're trying to arbitrage similar securities. BTW, if your computer isn't literally connected to the exchange in the absolute closest room, you're out of luck. Lots of firms doing this already.

If you're pair trading and not arbitraging, that's cool... there's money to be made there for medium to long term trades.

Also, here's the answer you're (not) looking for. It's not possible.
Wr3DnZ3.jpg


Finally... Straight from the documentation page in the 2nd sentence!!!
Only two mathematical operations are available between the components: addition and subtraction.

Here's the documentation link for composite symbols.
https://tlc.thinkorswim.com/center/howToTos/thinkManual/charts/Useful-Tools/Composite-Symbols
 
Solution
Also, here's the answer you're (not) looking for. It's not possible.
Wr3DnZ3.jpg


Finally... Straight from the documentation page in the 2nd sentence!!!
Only two mathematical operations are available between the components: addition and subtraction.

Here's the documentation link for composite symbols.
https://tlc.thinkorswim.com/center/howToTos/thinkManual/charts/Useful-Tools/Composite-Symbols
Thanks.
Marking it as the correct answer.

Even though TOS is not limited to addition and subtraction, it allows you to multiply in a scalar, such as:
SPY/2+IWM*3
The above works, you can use it in watch lists and charts.
 
Thanks.
Marking it as the correct answer.

Even though TOS is not limited to addition and subtraction, it allows you to multiply in a scalar, such as:
SPY/2+IWM*3
The above works, you can use it in watch lists and charts.

Agreed. I discovered you can use constants too, but anything dynamic it won't allow. And if you consider how they would match those up, it gets really tricky, so it's probably why they just don't allow it.

Seems like it would be possible for time based charts at least, but I can't imagine there's a huge demand for that either.
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
429 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top