thinkScript Code: def openPrice = if SecondsTillTime(930) == 0 then open else openPrice[1]; def pctChangeFromOpen = (close - OpenPrice) / OpenPrice; AddLabel(yes, AsPercent(pctChangeFromOpen), color.black); AssignBackgroundColor(if pctChangeFromOpen > 0 then color.green else color.red);
@richfree5365 Жыл бұрын
Thank you! 👍 How about if you want to see what they call the Absolute % change from the open in order to see what's moving the most regardless if the asset is up or down?
@richfree5365 Жыл бұрын
Is this correct for absolute change? Based on my math research. Absolute change equation is (final - initial). So, I'm assuming the (close - openprice) without dividing. thinkScript Code: def openPrice = if SecondsTillTime(930) == 0 then open else openPrice[1]; def pctAbsoluteChangeFromOpen = (close - OpenPrice); AddLabel(yes, AsPercent(pctAbsoluteChangeFromOpen), color.black); AssignBackgroundColor(if pctAbsoluteChangeFromOpen > 0 then color.green else color.red);
@TOSIndicators Жыл бұрын
I think you would want to use the abs value function: tlc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/AbsValue
@chezblunts5 ай бұрын
Do you put (930) regardless for what time zone you're in, or should you adjust for your time zone?
@AtomicHorror1352 жыл бұрын
THANK YOU SO MUCH!!! BEEN LOOKING FOR THIS FOR A LONG TIME, ITS VERY USEFUL!
@beachbum42322 жыл бұрын
Very kind of you to put this code out for free. Much appreciated
@TOSIndicators2 жыл бұрын
My pleasure. Happy New Year!
@baritony87632 ай бұрын
I can't tell you how happy I am to find this video. Most %'s include premarket & it can be misleading as to what is truly rising most after open. But isn't there any alternate adjustment you can make on TOS to achieve this---just out of curiosity? I've been searching to no avail. And also, I think you mentioned a different way(when you jotted the word "OPEN") before you brought up the steps (chart, watchlist ,settings gear, customize,etc) . I learned so much just from this. Thank you very much!
@TOSIndicators2 ай бұрын
That makes me happy to hear... I'm glad it was helpful!
@jnrbond289 ай бұрын
This is Excellent!!! Just what I was looking for. Thank You.
@jamesfoster75953 жыл бұрын
Thanks for all your videos. Really like them.
@TOSIndicators3 жыл бұрын
Thanks James :-) Appreciate your support!
@vamsee172 жыл бұрын
Thank you for sharing this code.. was looking for this for sometime.. very useful tool to have
@TOSIndicators2 жыл бұрын
My pleasure, Vamsee!
@TheWinghochui Жыл бұрын
Thanks for your sharing!
@TOSIndicators Жыл бұрын
My pleasure!
@dduhnut Жыл бұрын
FWIW, I just learned why the column does not sort properly. AddLabel uses alphanumeric sort so you need to use plot instead. def openPrice = if SecondsTillTime(930) == 0 then open else openPrice[1]; plot pctChangeFromOpen = (close - OpenPrice) / OpenPrice *100; pctChangeFromOpen.AssignValueColor(color.Black); AssignBackgroundColor(if pctChangeFromOpen > 0 then color.green else color.red);
@andrewf2204 Жыл бұрын
Thank you!
@TonioXenon7 ай бұрын
Here is the simple version: def openPrice = open; def closePrice = close; def percentChange = (closePrice - openPrice) / openPrice * 100; plot PercentChangeFromOpen = percentChange;
@MichaelMeettomarry2 жыл бұрын
Very helpful. Would Love to see a video on creating Volume Buz
@GB-kl2pd5 ай бұрын
Hello. I really appreciate this indicator. Would you say that this is better than the built in percent change indicator in TOS? Thanks.
@TOSIndicators5 ай бұрын
I think so.
@neoshred2 жыл бұрын
This is really helpful. Im trying to do the same thing but on a TOS scanner instead of a watchlist but the code doesnt seem to work there. Any suggestions?
@TOSIndicators2 жыл бұрын
You'll need to tweak the code from outputting via a label to a plot variable instead, which becomes your scan condition. Some of our scan tutorials should help, with showing you how to do this: www.tosindicators.com/scans
@neoshred2 жыл бұрын
@@TOSIndicators I watched a bunch of the videos and tried to tweak it but Im new at thinkscript so I still couldn't get it. Any help would be appreciated. Id be willing to pay if need be.
@TOSIndicators2 жыл бұрын
No worries... feel free to send an email at contact@tosindicators.com, and I can do my best to help you out.
@victorabdelmalek7530 Жыл бұрын
I'm looking to do the same thing. Did you ever figure this out?
@ki5ngau8 ай бұрын
Brilliant!
@cornellm2985Ай бұрын
Thanks man
@BlackViperOfDorne2 ай бұрын
Is there a way to start the time frame at 4am pre-market trading start? I tried changing 930 to 400 in the code and it gave me the same results.
@huckaflowco77772 жыл бұрын
I need a label that will compare the charts percentage from the open to the spy's percent from the open, can you please make a video for this? I found a label like this but it doesn't start from the open it starts from the beginning of the day but that just doesn't work for me it has to be from bell ring.
@matthewhunter69382 жыл бұрын
Solid bro
@srinip825 Жыл бұрын
Very nice. Is it possible to use this against multiple watch list list and count number of stocks positive close and negative close ? Watchlist1 ,number of stocks close by open,close of open Watchlist2, Watchlist3, Apply this as a study with label to any stock chart? Thamks
@TOSIndicators Жыл бұрын
Hi Srini - I don't believe what you've described is currently possible using thinkScript.
@darckfire3 жыл бұрын
Awesome.
@PEOdysseus2 жыл бұрын
very cool - I would like something similar with volume - I would like to know the 2 min and 5 mins volumes for the current day and what about it is higher than the previous day and what amount is it is higher than the previous 5 days on their opening 2 min and 5 min timeframes. similar thing in the last hour of the trade - how does the volume compare in percentage. can you help me with this?
@TOSIndicators2 жыл бұрын
You should be able to follow a similar process as we did for price, but scale it to the appropriate time frame's volume you're looking for, and output that in a watchlist.
@FloydCheong Жыл бұрын
thks for this ! u are super nice ! now my % from open have too many digit , like 4.9596% , how can I make all this only 2 digit after dot ? i use script from ur web , cos i think that s latest ? appreciate all the help , wish u best !
@TOSIndicators Жыл бұрын
Glad it helped! You can use the Round function to round to 2 digits after the decimal. Documentation here: tlc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/Round
@FloydCheong Жыл бұрын
@@TOSIndicators thks , just right now , my open % sorting , if there s 16% , it sort as 1% , sort group as 1% , after 5%4%3%2%16% can i fix this ?
@vastaction2 жыл бұрын
Are those buy and sell ticks, arrows on your chart. I've been pulling my hair out trying to make that happen. Is it possible to script that. I just want a simple arrow/tick showing where I buy and sell. Seems so simple. I enter them manually after each trading day using the notes. Ahhh, please tell me that's possible and how to make that happen.
@technow45143 жыл бұрын
Very helpful
@TOSIndicators3 жыл бұрын
Glad to hear it!
@richardaron50953 жыл бұрын
Thanks! How to add this as a label to the chart?
@TOSIndicators3 жыл бұрын
Hi Richard - you should be able to use the same code, and paste as a study, instead of a watchlist custom quote column. You may need to modify the formatting (ie. eliminate AssignBackgroundColor() and incorporate color logic into the AddLabel() function instead).
@richardaron50953 жыл бұрын
@@TOSIndicators Cool, thank you very much! Love your channel.
@rcook9243 жыл бұрын
I didn't see the code pasted anywhere in the comments (unless I missed it). I can get the code from the video but usually your final version is usually slightly different.
@TOSIndicators3 жыл бұрын
Hi Richard - sorry about that, just posted & pinned the comment. Thanks for catching that!
@shwe72113 жыл бұрын
Thanks a lot.
@healthyblend20482 жыл бұрын
Whenever I input the code, the “change from open” says “infinity.” Any suggestions? Thank you for the tutorial!
@windcarve3 жыл бұрын
Is there a way to get the % change from open values to correctly sort by increasing or decreasing values? Once the value exceeds 10% or 20%, things don't sort correctly. For instance, I'm looks at a ground of stocks in (supposed to be) decending order: 9.51%, 8.4%, 5.45% 27.78%, 16.02%, 14.91%, 1.6%, 0.43%... then similar for a group of negative values. All the % change from open codes I've come across seem to have this problem (incorrectly sorting percentage values). Thank You - enjoying your content very much.
@TOSIndicators3 жыл бұрын
Hi windcarve - that's strange... I haven't encountered that issue, but I'll take a look and let you know if I can find any easy solutions.
@jnrbond289 ай бұрын
Is there away to see the "Dollar" amount instead of "Percentage"?
@TOSIndicators9 ай бұрын
Yep - you can adjust the formula calculation to output the $ amount, instead of dividing to achieve the percentage.
@jnrbond289 ай бұрын
@@TOSIndicators Nice one thank you!
@elitanug2892 жыл бұрын
It is possible to have different colors if the % keep increasing, like from 3-5% yellow, 5-10% orange, 10-15% purple, etc
@TOSIndicators2 жыл бұрын
Hi Elitanu - yes, it should be. You would need to 'spell out' the different tiers in the color section of the code (or create separate boolean variables outside of the label function, and plug them in).
@elitanug2892 жыл бұрын
@@TOSIndicators can you show me how or copy the keys?
@krahsloop2 жыл бұрын
Thanks so much for sharing this! Maybe an odd question here, but is there a way to modify this code so that it tracks percentage change starting from the day's closing bell (4:00pm) up until the end of after hours/calendar day? I tried using 1600 instead of 0930 but that does not seem to yield anything. Thanks again!
@TOSIndicators2 жыл бұрын
Hi Scott - Try using something like a 5m chart, with the 'Incl extended hours" checkbox turned on. I tested with /ES, and it tracks the correct open, used in the calculation.
@krahsloop2 жыл бұрын
@@TOSIndicators That did the trick, thank you again!
@markgoodman6199 Жыл бұрын
Is there any way to just change the color of the actual number to red and green instead of the background???
@TOSIndicators Жыл бұрын
Hi Mark - You can use the AddLabel() function if you'd like to change only the color of the number, and not the background.
@KimYeoman2 жыл бұрын
This is exactly what I was seeking, thank you so much! I am trying to change the code so that the text is red/green, not the background. I was able to get rid of the background colour, but the text is stuck on white. How do I get the actual text to change red/green? Thanks again! def openPrice = if SecondsTillTime(930) == 0 then open else openPrice[1]; def pctChangeFromOpen = (close - OpenPrice) / OpenPrice; AddLabel(yes, AsPercent(pctChangeFromOpen)); AssignPriceColor(if pctChangeFromOpen > 0 then color.green else color.red);
@TOSIndicators2 жыл бұрын
Hi Kim - glad the video helped. It looks like you're missing the color parameter from the AddLabel code, which is what you can change to whatever color you would like. Example: AddLabel(yes, AsPercent(pctChangeFromOpen), if pctChangeFromOpen >= 0 then color.green else color.red);
@KimYeoman2 жыл бұрын
Perfect! Thanks so much!
@alkeshshah17772 жыл бұрын
how we find change in open interest ?
@TOSIndicators2 жыл бұрын
You'll need to create a separate custom quote, that tracks the open interest change over a specified strike.