Fundamentals Scan

sherkhane

New member
Hello Everyone,

Can someone help me create this scan to match all the following?

Market Cap < 100m
Price to Sales Ration < 2
( rank of( change of close over 200 days ) across true where true) > 150
Piotroski F-Score T12M > 1
( average ( volume x Close ) within 7 days ) > 100000

Thanks in advance
 
Solution
ToS platform provides us with the following Fundamentals:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Stock-Fundamentals
To add them to the Scan Hacker, Click on +AddFilter, click on Fundamentals, click on the default, choose which ones you want.
The ToS platform does not provide for the use of fundamentals in a custom conditions.
B19V3u2.png
Last edited:
Solution

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

ToS platform provides us with the following Fundamentals:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Stock-Fundamentals
To add them to the Scan Hacker, Click on +AddFilter, click on Fundamentals, click on the default, choose which ones you want:
B19V3u2.png
Is it possible to make a custom scan script that references fundamentals? For example, to scan for stocks whose book value per share is at least 100% higher than the close price. I tried to do this earlier and got an error, so it seems that it's not possible.

To clarify, I wanted to make a scan like this as a custom condition (paraphrased - I made sure when I actually did it that the syntax was correct):

plot scan = close<=(BookValue*2);

When I do this kind of script as a scan condition, I get an error. It seems that it's not possible to reference the fundamentals in scans this way.
 
Last edited by a moderator:
Is it possible to make a custom scan script that references fundamentals? For example, to scan for stocks whose book value per share is at least 100% higher than the close price. I tried to do this earlier and got an error, so it seems that it's not possible.

To clarify, I wanted to make a scan like this as a custom condition (paraphrased - I made sure when I actually did it that the syntax was correct):

plot scan = close<=(BookValue*2);

When I do this kind of script as a scan condition, I get an error. It seems that it's not possible to reference the fundamentals in scans this way.
The ToS platform does not provide for the use of fundamentals in a custom conditions.
The only scan for fundamentals is shown above.
 
I Have a failed CH GPT failed script I would like help on for a scan
Code:
# Define the scan
# Weighted matrix of indicators
def weight_PS = 1;
def weight_PB = 2;
def weight_DIV_YIELD = 3;
def weight_ROE = 6;
def weight_EARNINGS_GROWTH = 5;
def weight_DEBT_TO_EQUITY = 3;
def weight_FCF = 3;
def weight_OPERATING_MARGIN = 4;
def weight_P_OCF = 2;
def weight_MARKET_CAP = 5;

# Calculate weighted score for each stock
def weighted_score = weight_PS * Fundamental(priceType = PriceType.SALES) +
weight_PB * Fundamental(priceType = PriceType.BOOK_VALUE_PER_SHARE) +
weight_DIV_YIELD * Fundamental(priceType = PriceType.DIVIDEND_YIELD) +
weight_ROE * Fundamental(priceType = PriceType.RETURN_ON_EQUITY) +
weight_EARNINGS_GROWTH * Fundamental(priceType = PriceType.EARNINGS_GROWTH_RATE) +
weight_DEBT_TO_EQUITY * Fundamental(priceType = PriceType.DEBT_TO_EQUITY) +
weight_FCF * Fundamental(priceType = PriceType.FREE_CASH_FLOW) +
weight_OPERATING_MARGIN * Fundamental(priceType = PriceType.OPERATING_MARGIN) +
weight_P_OCF * Fundamental(priceType = PriceType.PRICE_TO_OPERATING_CASH_FLOW) +
weight_MARKET_CAP * Fundamental(priceType = PriceType.MARKET_CAPITALIZATION);

# Scan condition for highest weighted score
plot scan_condition = weighted_score > Highest(weighted_score, 34);
 
Last edited by a moderator:
I Have a failed CH GPT failed script I would like help on for a scan
# Define the scan
# Weighted matrix of indicators
def weight_PS = 1;
def weight_PB = 2;
def weight_DIV_YIELD = 3;
def weight_ROE = 6;
def weight_EARNINGS_GROWTH = 5;
def weight_DEBT_TO_EQUITY = 3;
def weight_FCF = 3;
def weight_OPERATING_MARGIN = 4;
def weight_P_OCF = 2;
def weight_MARKET_CAP = 5;

No. It is not possible to scan for a weighted score based on fundamentals. As the ToS platform does not provide for the use of fundamentals in a custom scan scripts. No, there are no workarounds.

While weighted-scripts cannot be used in the scanner, here is an example of how to set the default scan fields for the fundamentals that are available:
https://usethinkscript.com/threads/fundamentals-scan.10719/#post-94494

You can create a weighted score to display in a label, but the script is significantly more complicated than what was provided by chatGPT. Here is a script that creates a weighted fundamental score:
https://usethinkscript.com/threads/financial-fundamentals-labels-for-thinkorswim.5308/
You can change the weights to meet your needs.

FYI, the script in the link above can ONLY be used as a label on a chart.
Fundamentals are not available for custom scripting in any of the ToS widgets such as watchlists, scanners, conditional orders, etc...
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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