Number of shares after split.

decoder

New member
Hi, is there an indicator that calculates the number of shares that i have after the stock has split or reverse split? Thank you for your time.
 
Solution
Hi, is there an indicator that calculates the number of shares that i have after the stock has split or reverse split? Thank you for your time.

i looked and found 2 split functions that i didn't know existed.
maybe this can be used, to make something?
i modified one of the examples

https://tlc.thinkorswim.com/center/...Functions/Corporate-Actions/GetSplitNumerator
https://tlc.thinkorswim.com/center/...nctions/Corporate-Actions/GetSplitDenominator

Code:
#split_ratio

#https://usethinkscript.com/threads/number-of-shares-after-split.17266/
#Number of shares after split.

def na = double.nan;
def bn = barnumber();

#GetSplitDenominator()
#Returns the split denominator for the...
Scheduled splits aren't locked to a specific predictable ratio like 2:1, and there's no way to access that type of information from thinkscript. After the fact though, I suppose you could just use GetQuantity(). I would need more information on what you intend to do with this to give you a better answer.
Hi Joshua, what I am looking for is an indicator with an input for the number of shares that divides by the split ratio. hopefully that makes sense. TIA
 
Hi, is there an indicator that calculates the number of shares that i have after the stock has split or reverse split? Thank you for your time.

i looked and found 2 split functions that i didn't know existed.
maybe this can be used, to make something?
i modified one of the examples

https://tlc.thinkorswim.com/center/...Functions/Corporate-Actions/GetSplitNumerator
https://tlc.thinkorswim.com/center/...nctions/Corporate-Actions/GetSplitDenominator

Code:
#split_ratio

#https://usethinkscript.com/threads/number-of-shares-after-split.17266/
#Number of shares after split.

def na = double.nan;
def bn = barnumber();

#GetSplitDenominator()
#Returns the split denominator for the current symbol.
AddVerticalLine(!IsNaN(GetSplitDenominator()), if GetSplitNumerator() > GetSplitDenominator()
    then "Split!"
    else "Reverse Split!", Color.cyan);

# example
# Returns a split numerator for the current symbol.
input initialPosition = 100;
def position = CompoundValue(1, if !IsNaN(GetSplitDenominator()) then (position[1] * GetSplitNumerator() / GetSplitDenominator()) 
    else position[1], initialPosition);
#plot CurrentPosition = position;

addchartbubble(bn > 1 and position[1] != position[0], high*1.01,
(GetSplitNumerator() + " / " + GetSplitDenominator()) + "\n" +
(GetSplitNumerator() / GetSplitDenominator())
, color.yellow, yes);
#

GVP day split on 10/30
AlY8dA2.jpg


split calendar
https://www.investing.com/stock-split-calendar/
 
Solution
i looked and found 2 split functions that i didn't know existed.
maybe this can be used, to make something?
i modified one of the examples

https://tlc.thinkorswim.com/center/...Functions/Corporate-Actions/GetSplitNumerator
https://tlc.thinkorswim.com/center/...nctions/Corporate-Actions/GetSplitDenominator

Code:
#split_ratio

#https://usethinkscript.com/threads/number-of-shares-after-split.17266/
#Number of shares after split.

def na = double.nan;
def bn = barnumber();

#GetSplitDenominator()
#Returns the split denominator for the current symbol.
AddVerticalLine(!IsNaN(GetSplitDenominator()), if GetSplitNumerator() > GetSplitDenominator()
    then "Split!"
    else "Reverse Split!", Color.cyan);

# example
# Returns a split numerator for the current symbol.
input initialPosition = 100;
def position = CompoundValue(1, if !IsNaN(GetSplitDenominator()) then (position[1] * GetSplitNumerator() / GetSplitDenominator())
    else position[1], initialPosition);
#plot CurrentPosition = position;

addchartbubble(bn > 1 and position[1] != position[0], high*1.01,
(GetSplitNumerator() + " / " + GetSplitDenominator()) + "\n" +
(GetSplitNumerator() / GetSplitDenominator())
, color.yellow, yes);
#

GVP day split on 10/30
AlY8dA2.jpg


split calendar
https://www.investing.com/stock-split-calenda

thanks! halcyonguy the second example its exactly what i was looking for, is there any way you guys could add a cumulative split ratio to that? for instance TOPS had 2 splits in the last 2 years 1-20 and 1-12 that will be a total of 240 split ratio, thanks for your help.
 
Last edited by a moderator:

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