Answers to Commonly Asked Questions

Status
Not open for further replies.

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Everything you wanted to know about REPAINTING and were afraid to ask
ZigZags, Swings, Waves, Reversals, Pivots, Order Books, Fair Value Gaps and all Higher Highs-Lower Lows are all repainting indicators.
Repainting indicators paint on a signal or condition, then go back and erase it, then repaint it sometime later, so on and so on...

Forward-looking scripts using future bars also repaint.
Future bars wait for a signal or a condition. Then go back, many bars ago and paint the perfect-looking signal on a long-ago candle. Making it appear that it was there the whole time.


No, repainting indicators can not be rewritten to not repaint. Repainting is part of their DNA.

The Positive: Repainters are the fastest tool for identifying trends making them an integral part of a trader's toolbox.
The biggest and costliest mistake that new retail traders make is using repainters for trade entry.
Repainters can not be relied upon for entry or exit signals.

Repainters serve as a visual aid to spot trends, but other indicators and analysis need to be used to determine entry and exit points.
Use repainters in correlation with price action, candlestick patterns, a disciplined stop-loss plan.

The Negative: Repainting is problematic especially for newer traders using them for entry signals. Repainting arrows are ONLY signaling that a stock has moved lower. NOT THAT IT HAS REVERSED!
But n00bs tend to read those arrows as entry signals. Thinking that the stock has hit a low (or high) and that it is indicating NOW NOW NOW is the time to make entry,
That is NOT what repainters tell us, it is just saying that the stock is lower. As the stock continues to plummet, it erases the signal, continues to drop like a rock, and crushes previous profits. Just the potential of that possibility causes traders to lack confidence, to leave trades early at the smallest sign of trouble, creating a feedback loop of ever-smaller profits and ever-larger losses.

Positive Side of these Indicators:
They are written specifically to repaint.
Repainter's proper use, by most traders, is not for entry but for analyzing trendlines and support & resistance on a higher timeframe.
They purposely repaint when trends change and when support or resistance are broken through thus providing up-to-date data as to the state of our trend.


When using repainting studies:
Never use a repainting arrows for entry!

Both up and down signals will repaint.
You will see more low arrow repainting when the instrument has a strong bearish trend. As it makes new lows, the previous low signals will be erased.
You will see more high arrow repainting when the instrument has a bullish trend. As it makes new highs the previous high signals will be erased.

How do you know if an indicator is a repainting indicator?
If you look at a script and if there is a fold operation using highest and/or lowest that is the indication that it repaints.
Fold is a recursive operation that keeps redefining the highest and lowest and redrawing them.

Generally, if you have an indicator that shows low and high signals on your chart and every single signal works out perfectly, such as: Trend Reversals, Zigzags, Swing High, Swing Low, COG, Hurst indicators, some Pivot Points. all Waves, etc... then most likely that indicator repaints. Looks great for backtesting because all the intermediate signals are erased.

It's important to note that repainted signals are not recommended for entry, which is why the Forum adds the prefix "repaints" to those indicators.

Be careful with your coding, folks!
Another type of repainting occurs when you trade on the current bar, a common mistake of n00b traders.
When you write triggers on the current bar, obviously repainting will occur since the current bar doesn't know what the final close, high, and low is going to be until it's finished forming. Therefore, by definition, you are asking it to repaint with new information on every tick.

To avoid repainting, ToS recommends using the open of the next bar open[-1] for entry in strategies,
and use of the previous bar [1] for studies. Thereby, never experiencing repainting again!


Multi-Timeframe REPAINTING-type Behavior
Aetfs.png


This information was compiled from the various posts written about repainting. A search of this forum will provide the detail from which these statements were derived.
HTH
 
Last edited:
Scans, Watchlists, Chart Alerts, Conditional Orders Requests:
* The ToS platform does not support the use of multiple timeframes in Scans, Watchlists, Chart Alerts, Conditional Orders.
and
* Some studies can not be used in Scans, Watchlists, Chart Alerts, Conditional Orders due to being too complex.

Other than that, Scans, Watchlists, Chart Alerts, Conditional Orders can usually be easily adapted from existing studies.
To optimize an existing script for use in conditional orders, scans, and chart alerts, all formatting statements need to be removed, along with any other coding not directly related to creating the signal.

If you do not have an existing script and want to create one, your greatest hurdle is that Scans, Watchlists, Chart Alerts, Conditional Orders require well-defined logic.

Your ability to define the mathematical-precise conditions that will result in what you are looking for, is key to a great script.
Provide a marked-up screenshot of a chart that displays what are all the conditions that determine the desired results.
Explain how you want the results formatted: what words, what colors, what result should be shown and what criteria should cause formatting changes.
Unsure of how to upload screenshots to the forum, Here are directions.


Caveat: Scripts that repaint should NOT be used in Backtesting Strategies, Conditional Orders or Scans, Watchlists, Alerts.
a. The script will fire on a false signal. The signal will then disappear. You will think the script is broken.
b. The script didn't fire on the signal. That is because it wasn't there at that time! It was painted on afterward. You will think the script is broken.
Workaround: adding "within x bars" to your signal, might sometimes go back in time and find repainted signals, but as warned, you really don't want to do this. A backtested P&L will show as hugely profitable. It does not account for the fact that you had to wait x-bars to get the signal.
Given that repainters are used by scalpers, that lag of x bars makes it unprofitable.
Also, you will possibly end up running into the "Too Complex" error. Or you will time out; Or get squirrelly results.
 
Last edited:
Debugging Scans, Watchlists, Chart Alerts, Conditional Orders:
Did you know that the widget for conditional orders is identical to the scan hacker and the chart alert widgets?

To test / debug the signal for a conditional order:
  1. Create the filters in the scan hacker to verify that you have correctly defined the conditions you want to make entry on and that it runs without errors and finds signals.
  2. Create the custom filters for the chart alert. Verify that it runs without errors and generates an alert. This has the added benefit that is saves this alert. Conditional orders are once and done, and they are not saved. It is a PITA to have to manually enter them each time. However, conditional orders have access to saved alerts. So cool!
  3. You can now create your conditional order
It should be noted that the ToS condition wizard has limited capabilities, many scripts time out and / or are too complex, or cannot be used.
Most studies are formatted to be used on charts. To optimize an existing script for use in conditional orders, scans, and chart alerts, all formatting statements need to be removed, along with any other coding not directly related to creating the signal.
 
Last edited:
The Infamous "Too Complex" Error

'Generally' too complex watchlist / scanner / order messages means that the script cannot be used in ToS widgets; as TDA purposely throttles any script that require a high use of TDA resources:
It can ONLY be plotted on a chart.

However, 'sometimes', the problem is that there are just too many extraneous statements which are not related to the logic needed for the scan /watchlist /order. Writing a separate study with the extraneous removed puts less strain on resources and will then sometimes run successfully.

Another work-around that posters have sometimes had success with is to limit the data pool that you are scanning against. Scanning the Universe of Stocks is never recommended. Scanning a watch list of your preferred equities, scanning the DJIA or NASDAQ 100, or limit on volume, market cap, etc... Anything that will require a considerable less amount of TD's resources will occasionally get around the too complex error.

Yet another, work-a-round is to re-write the one study and break it into multiple studies. Then run the scan or order in parts or create multiple watchlists columns.

However, a majority of the time, the problem is built into the complex logic of the study.
The widget which is utilized as part of the scanner, watchlists, and conditional orders is designed purposely to only handle limited code in order to conserve TDA resources and then there is no work-around.

Supertrend, the Trend Reversal Indicators, and Repainting Indicators are generally too complex to utilize the TOS scanner or to use as watchlists.

Read more: https://jshingler.github.io/TOS-and-Thinkscript-Snippet-Collection/TOS & Thinkscript Collection.html#t-the-dreaded-too-complex-error
 
Last edited:
Watchlist Column "loading" errors
1. if sporadic, they are most likely due to an overload on the TDA servers. To test this, see if the "loading" errors are also occurring at night and/or weekends.
2. if consistently seeing "loading" errors even at nights and weekends, it is most likely pointing to a computer setup issue:
https://topratedfirms.com/trading/system/td-ameritrade-thinkorswim-system-requirements.aspx

"If you meet Ameritrade’s definition of a power user (i.e. viewing multiple charts at once or running advanced technical studies) they recommend your machine have more robust specs. They recommend a Windows 10 operating system (10.10.5 for Mac users), and Intel Core i7 processor, 16 gigabytes of RAM, and one gigabyte of free hard drive space. In terms of graphics, they recommend having a full high definition monitor with 1920x1080 resolution, a dedicated video card, and hardwired Ethernet with a download speed of at least 15 megabytes per second."

Watchlist Column "custom expression subscription limit exceeded"
TDA purposely throttles any of your scripts that require a high use of TDA resources:
https://usethinkscript.com/threads/thinkorswim-custom-expression-subscription-limit-exceeded.1441/
 
Last edited:
Commonly Asked Questions about Alerts:
https://tlc.thinkorswim.com/center/howToTos/thinkManual/MarketWatch/Alerts


There are Three Types of Alerts:
There are alerts written into studies. They alert for all charts / grids currently populating your app whether they are minimized or not.​
They cannot be sent to phone/email. They cannot have custom sounds.​
There are alerts created on a chart for one specific stock that you want to alert​
Right-click on your chart and choose alerts.​
There are scanned watchlist alerts which alert whenever the results of the scan changes.​
These alerts can be 3min delayed. They can have custom sounds, they can be sent to phone/email, if you have notifications turned on in the app setup.​
Alerts blinking by too fast? To see all alerts: click on the message center
Want to see a list of alerts all the time? detach the message center
TeXjiwC.png
 
Last edited:
Guidelines For Posting To The UseThinkScript Forum
  1. Many questions asked have answers already posted. I did a search of one question recently, and it had been answered over 100 times. All these duplicate posts clutter the forum, making it difficult for you and all of us to find what we are looking for. PLEASE search the forum for possible answers, before posting!
  2. Here is a Great Hack For Searching Those Huge Threads for your answer.
  3. Provide the link for the study you are asking about. Frequently, threads will have multiple script versions, so click on the post# to get a direct URL link.
  4. Tell us what aggregations you are trading on.
  5. Provide a marked-up screenshot of what you are attempting to accomplish w/ your question or to illustrate the issue you are having. Provide at least one screenshot of the whole chart (or scan, watchlist, etc.) and then any close-up screenshots. Don't know how to upload screenshots to the forum? Here are directions.
If no thread exists for the indicator you are referencing. YOU MUST PROVIDE THE CODE. If you don't have code, then provide the logic that will form the framework for the code. Not a link to a YouTube video or to some other site.

Keep in mind, nobody can help modify an existing code unless the code is provided. To share code in your post, click on this icon at the top of your post and then paste the code.
05OXNve.png


Lastly, be concise and complete in your query. "It's broken" isn't a detailed enough explanation. What aggregations have you tested?
Which equities? etc.. Pictures are worth 1000 words. Not providing screenshots severely limits the type of assistance that can be given.

Hope This Helps
 
Last edited:
TOS Mobile App
The TOS built-in mobile indicators work on the TOS mobile app.
ToS Mobile does not support study formatting elements such as vertical lines, labels, bubbles, clouds, color changes for slopes and lines, renko, or multiple timeframes.

Formatting is the biggest showstopper w/ the mobile app. A majority of the custom studies on this forum are into lipstick: vertical lines or labels or bubbles or clouds or color changes for slopes and lines; all of which tend to make the mobile app vomit.

@markos put together this post --> https://usethinkscript.com/threads/indicators-not-working-in-thinkorswim-mobile-app.232/
Here are some ToS Mobile Friendly Indicators --> https://usethinkscript.com/threads/tos-mobile-friendly-indicators.1071/
 
Last edited:
Multiple Time Frames

The ToS platform does not allow multiple timeframes to be used in the scan hacker, watchlists, conditional orders, etc...
This code is only for plotting on a chart.

Using MTFs on a chart:
  1. Use of multiple time frames in a strategy can be integral to success. Plotting the higher time frame on the time-frame that you are trading on, eliminates the need to have multiple charts open.
  2. MTF indicators should ONLY be used for the overall analysis.
  3. MTF indicators should NOT be used to analyze the current candle for entry or exit due to repainting behavior which causes phantom signals to appear and disappear until the candle closes on the higher aggregation.
Having Problems? Does the MTF indicator appear to be not working or partially working when you load the study onto your chart?
A common error when using MTF indicators is trying to use a time frame that is lower than the chart you are posting it on. On the TOS platform, you can display data from a higher timeframe onto a lower timeframe but not the other way around.
https://tlc.thinkorswim.com/center/...hapter-11---Referencing-Secondary-Aggregation

HTH
 
Last edited:
How To Search Long Threads
Don't want to read all 30 pages of a post? Just want to find the scan, an alert, a watchlist for the study, you are looking for?
Here is how:
  1. Go to the thread you want to search.
  2. Go to the Search feature in the upper right corner of the page...
  3. Enter the term "scan" .... or alert or watchlist or arrow. whatever you need.
  4. Select "This thread" from the dropdown on the right where it is defaulted to "Everywhere"
  5. Press Enter or click on the word "Search"...

If you press the "G" part of the "Search" button you'll get an even longer list of Google Search results, so start with the standard "Search" first and if you're not satisfied then try the "G"...
Thanks to @rad14733 for this tip.
 
Last edited:
The Basics for Developing a Good Strategy
  1. Never trade just one indicator. Additional indicator(s) give confirmation that improves your odds of being right as long as those indicators do not have multicollinearity. Mobius says that three indicators is the perfect number: Support&Resistance, Trend/Momentum, and Volume. Here is his example.
  2. Never trade on just one timeframe. Analyze multiple-time frames for a broader picture of what is happening w/ an asset. Higher aggregations provide a warning where there is no long-term trend or momentum to provide support to your entry. Whether scalper or swing trader, countertrend, or trend, the likelihood of success increases when trades go with strong long-term uptrends.
  3. Never enter into a trade without a strategy of when you are getting out. Studies have consistently shown that it is not poor entry points that are causing retail investors to lose money; it is poor exits. Use of the above, will improve exits and reduce false signals.
  4. This advice from @Pensar: Any trading strategy, no matter how simple or complicated, will have losses. There is no way to avoid them. That's why its critical to use stops, regardless of your indicators or method. Research and understand position sizing, probabilities, and risk-to-reward - these are highly important to successful trading. Remember that indicators only indicate, not predict - 99% of indicators are based on price or volume, so understanding the market structure is critical. Look for areas of price consolidation to capture the moves of price expansion.
Are there traders that make money and don't follow these basic tenets of Technical Analysis? Absolutely! But if you are not one of them, incorporating these concepts into your strategy could help.

You can google the basics of a good strategy for more information. This Technical Analysis Cheat Sheet link has a whole set of articles, I found informative in helping me develop successful strategies. Do not be put off by the word 'dummies' in the title. These articles are comprehensive but understandable. HTH
 
Last edited:
How to take perfect screenshots:
  1. Click on the upper-most hamburger icon
    HIKwnjU.png
    at the top right-hand side of the TOS chart.
  2. Click on take a screenshot.
  3. Click save.
Mark up your screenshot using an image editor so we can understand what you want us to look at.
Then to upload your screenshot to this forum, follow this tutorial:
https://usethinkscript.com/threads/how-to-insert-image-in-a-post-thread.277/
HTH
 
Last edited:
'custom expression subscription limit exceeded'

WatchLists

There may only be 1,100 - 1,500 Custom Watchlist Fields displayed in the TOS app at one time. It is necessary to either have fewer results populate the watchlists or have less watchlists. There is no work-around for this limitation.​
 
Adjust the distance of the Arrows to the Candles
The following snippet controls the placement of candles by using a percentage of the bar range.
The higher to value, the candle is further away from the candle. Smaller the value closer.
Ruby:
# ########################################################
# Adjust the distance of the Arrows to the Candles
# This plots arrows at a percentage of bar range above the bar high/low
def prange = high – low;
def plotHigh = high + prange * .3;
def plotLow  = low  - prange * 1.0;
plot BuyCriteria = if BuyTrigger then plotLow else double.NaN ;
plot SellCriteria = if SellTrigger then plotHigh else double.NaN ;
# ########################################################
Example of a Study Using Arrow Placement Script
Ruby:
# TOS MovingAverage Strategy
input price = close;
input averageType = AverageType.EXPONENTIAL;

plot FastMA = MovingAverage(averageType, price, 20);
plot SlowMA = MovingAverage(averageType, price, 50);
AddCloud(FastMA, SlowMA, Color.green, Color.orange);
# ########################################################
def BuyTrigger = FastMA crosses above SlowMA ;
def SellTrigger = FastMA crosses below SlowMA ;
# ########################################################
# Adjust the distance of the Arrows to the Candles 
# This plots arrows at a percentage of bar range above the bar high/low
def prange = high – low;
def plotHigh = high + prange * .3;
def plotLow  = low  - prange * 1.0;
plot BuyCriteria = if BuyTrigger then plotLow else double.NaN ;
plot SellCriteria = if SellTrigger then plotHigh else double.NaN ;
# ########################################################
BuyCriteria.SetPaintingStrategy(PaintingStrategy.ARROW_UP) ;
BuyCriteria.SetDefaultColor(color.plum);
BuyCriteria.SetLineWeight(2);
SellCriteria.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN) ;
SellCriteria.SetDefaultColor(color.blue);
SellCriteria.SetLineWeight(2);
DxjFhs6.png
 
How To Color Your Clouds
Make cloud colors modifiable and/or change the opaqueness to lighten the clouds so they don't overwhelm the candle color.

kH0PSm4.png


The following code snippet is an EXAMPLE of how to use GlobalColor.
To use the example in your code, you would add DefineGlobalColor statements for each color you want and then you put those GlobalColors in your AddCloud statement in place of the color. variables.

Code:
DefineGlobalColor("Bullish", Color.light_green);
DefineGlobalColor("Bearish", Color.light_RED);
AddCloud(YourVariable1,  YourVariable2,  GlobalColor("Bullish"),  GlobalColor("Bearish"));

Once GlobalColors are defined, click on the gear icon, next to the study and change the opaqueness

AbTky1E.png

HTH
 
Last edited:
How To Add A Watchlist Column
click on the gear to the right of your watchlist​
click on Customize​
CDIZ9nc.png
If you click on the drop-down arrow, you will see all the indicators available to populate a watchlist​
If you know the indicator that you want, you can type it into the box​
click on Add Item​
click on OK​
xXxAqZd.png
 
Creating A Strategy From A Study
All you need to convert a study into a study is the following code snippet. It should be added to the bottom of your study and then the study needs to be cut&pasted under the Strategy Tab.
Ruby:
Ruby:
#Order Management
AddOrder(OrderType.BUY_AUTO, YOU_NEED_TO_FILL_THIS_IN_buy  , tickcolor = Color.YELLOW, arrowcolor = Color.BLACK, name = "Buy", tradeSize = 100);
AddOrder(OrderType.SELL_TO_CLOSE, YOU_NEED_TO_FILL_THIS_IN_sell , tickcolor = Color.PINK, arrowcolor = Color.RED, name = "sell", tradeSize = 100);

The field YOU_NEED_TO_FILL_THIS_IN_buy must be replaced with whatever the field name is for the buy arrow. The field YOU_NEED_TO_FILL_THIS_IN_sell must be replaced with whatever the field name is for the sell arrow.

Read more about it here:
https://usethinkscript.com/threads/addorder-thinkscript-backtest-auto-buy-sell-in-thinkorswim.741/
 
Last edited:
Creating Arrow Plots

When creating plots in thinkscript you not only have to define the logic of what you want plotted but you must also state WHERE on the candle or line that you want it plotted. (IE the low, high, open, close, of the candle).
An example of the syntax is if mycondition is true then low else double.Nan (print nothing)
 
Last edited:
Combining Two or More Indicators
The easiest method to see signals from two or more studies is to set up a scan for the various study triggers. The results will only be those candidates that have met all your conditions. This method can even eliminate the need to have those studies on your chart if you are in need of real estate. This method is favored over attempting to create a kitchen sink indicator as it is much easier to change out indicators as your strategy develops.

Combining multiple indicators into the same lower section is not recommended due to scaling issue. When you zoom in and out, it shows different values.. It's like mixing oil with water :D
 
Last edited:
Status
Not open for further replies.

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

Thread starter Similar threads Forum Replies Date
J007RMC Pre-Market Questions & Answers Questions 20

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
409 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