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, and Pivots are all repainting indicators.

Repainting is when an indicator triggers (prints an arrow, shows up on a scan/watchlist, sends an alert, buy & sells on back testing, etc) because at that moment it is at a High or Low. But as the price goes down (or up), it erases that signal and puts the high/low signal on the next candle. And so on and on. Showing no history of the many false signals. It only leaves the one perfect high/low signal, long after the trend has finished.

The Negative: Repainting is problematic especially for newer traders. Many of these indicators provide triggers promising that a stock has hit a low (or high) and is indicating NOW NOW NOW is the time to make entry and it can be right, reinforcing their belief that this is a good strategy. But it can also be wrong, it erases that 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.

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

Positive Side of these Indicators:
  • Savvy scalpers, who are also using other strategic elements and have expertise in reading price action /candle patterns are known to make use of some repainting indicators because they trigger MUCH faster than the non-repainting. They factor the cost of losses due to phantom signals into their strategy.
  • Swing Traders and Scalpers will sometimes use these indicators to analyze overall trendlines as opposed to looking for specific entry or exit. The caveat being that even if the bar is many many candles past is can STILL REPAINT, the trendline can go from up to down based on new data points. But this is true even when drawing manual trendlines. So I can see the use for utilizing these types of indicators to get a general idea of historical trends.
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 buy and sell 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, etc... then most likely that indicator repaints. Looks great for backtesting because all the false signals and bad buy/sells are erased.

Multi-Timeframe REPAINTING-type Behavior
Aetfs.png


Other REPAINTING-type Behavior:
In TOS, an indicator can be triggered and signal prematurely during the formation of a candle because the conditions are met but the signal can disappear by the close of the candle if the conditions for the signal do not hold true. A workaround would be to be scan/alert/paint the arrow on the prior candle and/or do not trigger your scan/watchlist/alert/arrow/signal based on just one study. This holds true for reducing many types of false signals.

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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
In order to troubleshoot the issues. We need to be able to see what you are seeing. So we need you to post the following:
  1. What code did you copy&paste? Even if you think it is the same as the one on the forum. We need to see yours. Maybe the issue is that you missed part of the code when you created the study.
  2. Provide a screen grab of the wonky results. Make sure to grab the whole chart or scan or watchlist, etc.. so we can see the aggregations, what stock, and all your settings so we can try to replicate your results and correct them.
After you post the above information, I am sure someone will be able to point you toward possible solutions.
Unsure of how to upload screenshots to the forum, Here are directions.
 
Last edited:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
The Infamous "Too Complex" Error

'Generally' too complex scanner / order messages means that the study is not scannable and can not be used in a conditional order, watchlists, etc… 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 or in your watchlist. 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 in parts. Do some calculations, save results to a watchlist and then run the rest in the next scan.

However, a majority of the time, the problem is built into the complex logic of the study 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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Commonly Asked Questions about Alerts:
There are Three Types of Alerts:
There are alerts written into studies. They only alert when the chart w/ the study is open on your screen​
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 on.​
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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 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.
  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. Not a link to a YouTube video or to some other site. 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.
QNUw9Yh.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. HTH
 
Last edited:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Last edited:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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 Search feature in the upper right corner of the page...
  2. Enter the term "scan" .... or alert or watchlist or arrow. whatever you need.
  3. Select "This thread" from the dropdown on the right where it is defaulted to "Everywhere"
  4. 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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
'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.​
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
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:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
ToS Platform Limitations

ToS studies can be referenced in custom studies. Custom studies cannot be referenced in another script.
There is not a work_around. :(

The ToS platform does not allow backtesting of anything other than strategies. The Strategy script needs to contain all the conditions necessary to create the AddOrder statement.
 
Last edited:

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
When there is no reply to your question, perhaps it is because it is not clear what you are asking.

Help us help you:
Provide a detail explanation of what you are trying to accomplish.
Provide a marked-up screenshot of what a chart that meets all your conditions would look like.
Unsure of how to upload screenshots to the forum, Here are directions.

When you are posting your question, please follow the guidelines found here:
https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-58016
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
J007RMC Pre-Market Questions & Answers Questions 18
MerryDay @cabe1332 Commonly Used Chart Indicators For ThinkOrSwim Custom 3

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.
Top