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