Plotting Lines, Shapes, Boxes, etc... In ThinkOrSwim

Reverse

New member
Hi, I was wondering if anybody knew a way to make a think script indicator to highlight attach a horizontal ray, and write text after seeing a certain pattern (such as 2 green up 1 red down )on a candle. I do this manually, but I think it could be automated, but there isn't much documentation on how to do this. It is basically trying to identify supply and demand zones where the stock pivots and putting zones and tag on the zone to remember what time frame it came from. Another important aspect is having it be able to inspect all significant time frames such as 3 hours, daily, etc for these zones to mark them. As long as someone can point me in the right direction on how to do this I would be grateful. The part I am most confused about is making rays that can attach to a candle and using if-else statements to reference a candle pattern. I attached an image to show what I mean by marking a candle.
18ID61L.png
 
Hi, I was wondering if anybody knew a way to make a think script indicator to highlight attach a horizontal ray, and write text after seeing a certain pattern (such as 2 green up 1 red down )on a candle. I do this manually, but I think it could be automated, but there isn't much documentation on how to do this. It is basically trying to identify supply and demand zones where the stock pivots and putting zones and tag on the zone to remember what time frame it came from. Another important aspect is having it be able to inspect all significant time frames such as 3 hours, daily, etc for these zones to mark them. As long as someone can point me in the right direction on how to do this I would be grateful. The part I am most confused about is making rays that can attach to a candle and using if-else statements to reference a candle pattern. I attached an image to show what I mean by marking a candle.
18ID61L.png
I've been looking for something like this as well, at the minimum be able to find and plot S&D zones to not do them manually. Don't think it exists, found one but it was 300.00😅
 
Hi, I was wondering if anybody knew a way to make a think script indicator to highlight attach a horizontal ray, and write text after seeing a certain pattern (such as 2 green up 1 red down )on a candle. I do this manually, but I think it could be automated, but there isn't much documentation on how to do this. It is basically trying to identify supply and demand zones where the stock pivots and putting zones and tag on the zone to remember what time frame it came from. Another important aspect is having it be able to inspect all significant time frames such as 3 hours, daily, etc for these zones to mark them. As long as someone can point me in the right direction on how to do this I would be grateful. The part I am most confused about is making rays that can attach to a candle and using if-else statements to reference a candle pattern. I attached an image to show what I mean by marking a candle.
18ID61L.png

hello and welcome.
it is admirable that you want to learn how to program. unfortunetely, no one can tell someone how to create a program, to do a task, when they have little knowledge of the language. there are no modules to pick from and put together, it will have to be created from scratch ( except for copying what i'm guessing, will be some strat code).

it would help others if you studied some of the drawing functions and learned the correct terms for things, to better describe what you want.

look over these links, to get familiar with the basics.

draw a shaded area, defined by 2 price levels
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddCloud

plot lines and shapes
https://tlc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/plot
types of plots
https://tlc.thinkorswim.com/center/reference/thinkScript/Constants/PaintingStrategy
plotting a number above the candle
https://tlc.thinkorswim.com/center/...aintingStrategy/PaintingStrategy-VALUES-ABOVE

put a text box at the top of the chart
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel

put a text box anywhere on the chart
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble

if then
a true false condition or variable (1st parameter), determines which value to assign, the 2nd or 3rd parameter.
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Others/If
https://tlc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/if

switch case
use the value of 1 variable to determine the values of 1 or more other variables.
https://tlc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/switch

----------------

thinkscript tutorials
https://tlc.thinkorswim.com/center/reference/thinkScript/tutorials

https://tlc.thinkorswim.com/center/reference/thinkScript/tutorials/Overview

https://tlc.thinkorswim.com/center/reference/thinkScript/tutorials/Basic

https://tlc.thinkorswim.com/center/reference/thinkScript/tutorials/Advanced

-----------------

can you describe your rules for determining when you want something to appear? line, shading, text,...

1. what defines these terms?
2 green up, 1 red down
are they strat conditions? what formulas define them?

2. in geometry, a ray is a line with an arrow. do you want a horizontal line to appear at some price level?
or do you want a shaded rectangle to appear after a peak?

3. 3 hours isn't a standard time frame. that may be tricky to compile data for.
why do you think 3 is significant, instead of using 2 or 4 hours?

4. addchartbubble() could be used to draw a bubble somewhere on the chart, and put text or numbers in it.

-----------------

start the programming process by making a short outline, describing what to look for and what to draw. over time, you will expand on it and ecentually write code for each small part.

A. find a peak
some combination of strat numbers

B. draw a cloud from the peak


strat studies
https://usethinkscript.com/threads/rob-smiths-the-strat-indicator-for-thinkorswim.3312/
maybe you can start by copying one of these and modifying it.


here is an example study. it draws clouds after a gap. this keeps track of data for 4 gaps, in order to plot 4 clouds at a time.
https://usethinkscript.com/threads/...-price-crosses-into-it-for-thinkorswim.11186/

....

i have spent 100s of hours, experimenting with codes from many sources. what helps me learn is hands on. loading a study, and seeing what happens, then change it, try many values for the input parameters, to learn what is permissable. i don't just read the TD info page on a function.
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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