Runtime Error: thinkscript.runtime.TooComplexException

Thayanidhi

New member
Hi All,

I am completely new to Think script platform, I am trying to learn and creating custom code but i am getting the below error when i tried to add multiple conditions.

com.devexperts.tos.thinkscript.runtime.TooComplexException: The complexity of the expression suggests that it may not be reliable with real-time data.

Is there any limitations in think script or am i missed anything in my code?

Regards,
Thaya
 
Last edited by a moderator:
Hi Thaya,

I'm new here, but maybe I can help. Are you able to link the study you are attempting to run?

***In my experience a long series if 'IF statements' can cause this in TOS. Also, if you're attempting to convert a study to a watchlist column, make sure to take out unnecessary code that pertains to the chart.
 

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

The error says it all. The script you're working on may be too complicated for certain tasks (ex: using a scanner with it). Post the script or the exact feature that you're using.
 
The error says it all. The script you're working on may be too complicated for certain tasks (ex: using a scanner with it). Post the script or the exact feature that you're using.
Thanks Ben Ten, Yes, We are using some scanner in that scripts and try to get values from scanners. The script with scanner is working if we need to get 1 or 2 value but if we need to get multiple values then we are getting the runtime or complex exceptions.
 
Unfortunately there are some scans that are too complex for TOS, so you get that error. It happens when I try to turn some of my complex studies into scans. Nothing you can do about it unfortunately.
 
Does anyone have any more information on this error message? I see some that have answered replied with "The error says it all..." but unfortunately it doesn't. I can preview a study-based conditional order just fine after saving a conditional order, but after a couple previews using the same symbol and same code, I then begin to get this error message. To circumvent this, I don't preview the study-based order on the same stock more than once and the trigger works just fine. There is more to this error message than meets the eye.....
 
Does anyone have any more information on this error message? I see some that have answered replied with "The error says it all..." but unfortunately it doesn't. I can preview a study-based conditional order just fine after saving a conditional order, but after a couple previews using the same symbol and same code, I then begin to get this error message. To circumvent this, I don't preview the study-based order on the same stock more than once and the trigger works just fine. There is more to this error message than meets the eye.....
https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-57834
 
Unfortunately your post does not answer my question, it just illustrates why I'm asking it.

I understand the workarounds and the "best practices" to use to try and avoid the the topic in question, but when the workaround or best practices no longer work (Ex: Code cannot be shortened any further in length or process, etc..), I figured I'd ask if anyone found an actual way to use more complex scripts than TOS allows by default, or found an actual workaround that solves my issue. It doesn't matter now, though; I found a way to bypass that message regardless of length or complexity -- a bug, but a welcomed one for once. If I had known all the limitations and secrets TOS has, when I first started, I would have moved to tradestation a long time ago.

On a different note.... Thank you for putting that forum together. It was very helpful when I first started playing with thinkScript. I originally tried posting this message in your forum but you no longer allow replies.

JD
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
417 Online
Create Post

Similar threads

Similar threads

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