How to Add Percent Change From Open on Thinkorswim
All good online financial resources will show the performance of securities over time and there are standard time frames that we all accept as the norm.
For example, year-to-date YTD, 1 year etc. and probably the most common one is the daily change, that is the percentage change since market close the previous trading day. This is what we will see on the ticker rushing along the bottom of the screen on TV channels such as Bloomberg, CNBC or any financial markets news shows around the world.
It is second nature to us. However sometimes we may want to know the change from open today, not from close of the previous day. You would think this would also be intuitive or standard but it actually isn’t. If you look at Google Finance or Yahoo Finance this data is not automatically available, instead you actually have to calculate this manually yourself.
Yahoo Finance does give you the open price as standard to make it slightly easier, but the main price move we see, that is the +4.36% for Netflix in the image below, calculates today's price compared to previous trading day's closing price.
The Math on How to Calculate Percent Change From Open
To calculate the percent change from the open of a security on Thinkorswim, you will first need to open the security's chart.
Then you can view the current price of the security and compare it to the price at the open of the day.
To calculate the percent change, you can use the following formula:
(Current Price - Open Price) / Open Price x 100
Using our Yahoo Finance example on Netflix above it will be:
Netflix opened at $341.71 and the current price, which is the closing price in this example is $357.42, the percent change would be:
(357.42 - 341.71) / 341.71 x 100
15.71 / 341.71 X 100
= 4.6%
This means that Netflix has increased in value by 4.6% from the open of the day, which is quite a bit more than the 4.36% change since previous close.
Of course the percent change from the open can change during the trading day, so it's important to check the current price and calculate the percent change at regular intervals. It can be affected by various market factors, such as economic news or company announcements.
Thinkorswim also provides some tools to help automate this process, such as custom watchlists and studies that can help you track the percent change from the open of a security.
This can be helpful for traders who want to quickly and easily see how a security is performing throughout the day without having to manually calculate the percent change.
To Implement Percent Change From Open on Thinkorswim
The users on usethinkscript forum have code which carries out the manual calculation we have done above:
Percent Change From Open on Thinkorswim Code
def o = if SecondsFromTime(0930) == 0 and SecondsTillTime(0930) == 0 then open else o[1];
def PercentChg = 100 * (close / o - 1);
AddLabel(1, " Percent Chg from open: " + close + " / " + o + " = " + PercentChg + "%", if close > o then Color.GREEN else Color.RED);
First create a custom column editor, then add the code and you can set preferences to whatever you wish, for example to get the percentage to decimal places, highlight changes in red/green etc
Another user posted this helpful code to create a script that scans for stocks above or x percent near the open on the daily.
input x = 98 ;
def o = if SecondsFromTime(0930) == 0 and SecondsTillTime(0930) == 0 then open else o[1];
def PercentChg = 100 * (close / o - 1);
plot scan = PercentChg > x ;
You read the full thread on usethinkscript here.
TOSIndicators also have this useful 8-minute video:
This video may help you understand the code better as they explain it as they go along and they have other useful tips. For example, you have a limited number of custom quotes, so you may have to overwrite one.
Summary of How to Add Percent Change From Open on Thinkorswim
Calculating the percent change from the open of a security on Thinkorswim can be a useful way to track the performance of a security. It is particularly useful for day traders.
The calculation can be done manually quite quickly by using the formula provided, but it is not efficient to do this several times a day. Instead we can create a custom watchlist on Thinkorswim, add a few lines of code and then we can monitor the security's performance throughout the trading day from a quick glance.
You might also be interested in how to use Donchian channels on Thinkorswim or the basics of Thinkorswim studies or how to use Supply and Demand indicator on Thinkorswim.