Strategy To Profit From Earnings In ThinkOrSwim

UpTwoBucks

EDUCATOR

In the fast-paced world of investing, keeping up with the latest financial news and reports is crucial to making informed decisions. Earnings reports, in particular, play a significant role in influencing stock prices and investor sentiment. But how can you leverage these reports to maximize your profits? Join us in this informative video as we delve into the fascinating world of earnings reports and unlock the secrets to profiting from them. Whether you're a seasoned investor or just starting your journey, this video is packed with valuable insights and practical strategies to help you navigate the earnings season like a pro.
This is a shared link off my system. https://tos.mx/OhrDaqn
Code:
#Has Earnings in next 2 days

Input length = 2;
input choice = {default "Has", "Does Not Have" };
input Choice2 = {default "Any time", "Before the Market", "After the Market"};

def earnings = hasearnings();
def when;

switch (Choice2){
case "Any time": when = hasearnings();

case "Before the Market": when = HasEarnings(type = EarningTime.BEFORE_MARKET);

case "After the Market": when = HasEarnings(type = EarningTime.AFTER_MARKET);

}  

#NO earnings

plot scan;
switch (Choice){

case "Has":
scan = sum(when,length)[-length +1] > 0;

case "Does Not Have":
scan = sum(when,length)[-length +1] == 0;

}

This is the volume spike code. In a watch list, click the gear icon on the right, select customize, Then type custom on the left, move it over to the right. Click the tablet and paste the code. Make sure 1 minute timeframe and extended hours is checked. If you prefer the shared link: https://tos.mx/WY8iqLI
Code:
input vol_change_pct_threshold_up = 100.0;
input vol_change_pct_threshold_down = 100.0;

# Volume Spike Indicator
def rel_vol = volume / Average(volume, 50);
def vol_change_pct = (rel_vol - 1.0) * 100.0;
def is_spike = vol_change_pct >= vol_change_pct_threshold_up;
def is_spike_down = vol_change_pct >= vol_change_pct_threshold_down;
def is_bullish = close > open;
def is_bearish = close < open;


AddLabel(yes,
         if is_spike and is_bullish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bullish" + "   ")
         else if is_spike and is_bearish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bearish" + "   ")
         else "",
         if is_spike and is_bullish then Color.GREEN
         else if is_spike and is_bearish then Color.LIGHT_RED
         else Color.BLACK);
 
Last edited by a moderator:

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


In the fast-paced world of investing, keeping up with the latest financial news and reports is crucial to making informed decisions. Earnings reports, in particular, play a significant role in influencing stock prices and investor sentiment. But how can you leverage these reports to maximize your profits? Join us in this informative video as we delve into the fascinating world of earnings reports and unlock the secrets to profiting from them. Whether you're a seasoned investor or just starting your journey, this video is packed with valuable insights and practical strategies to help you navigate the earnings season like a pro.

Code:
#Has Earnings in next 2 days
Input length = 2;
input choice = {default "Has", "Does Not Have" };
input Choice2 = {default "Any time", "Before the Market", "After the Market"};
def earnings = hasearnings();
def when;
switch (Choice2){
case "Any time":
      when = hasearnings();
case "Before the Market":
    when = HasEarnings(type = EarningTime.BEFORE_MARKET);
case "After the Market":
     when = HasEarnings(type = EarningTime.AFTER_MARKET);
}
#NO earnings

plot scan;
switch (Choice){

case "Has":
      scan = sum(when,length)[-length +1] > 0;
case "Does Not Have":
    scan = sum(when,length)[-length +1] == 0;

}

My DeskTop: https://tos.mx/OmUmKBC
Great video thank you! Maybe I'm missing something but how do you get the Volume spike %VSpike column? IS there another code for that? Thanks again.
 

In the fast-paced world of investing, keeping up with the latest financial news and reports is crucial to making informed decisions. Earnings reports, in particular, play a significant role in influencing stock prices and investor sentiment. But how can you leverage these reports to maximize your profits? Join us in this informative video as we delve into the fascinating world of earnings reports and unlock the secrets to profiting from them. Whether you're a seasoned investor or just starting your journey, this video is packed with valuable insights and practical strategies to help you navigate the earnings season like a pro.

Code:
#Has Earnings in next 2 days
Input length = 2;
input choice = {default "Has", "Does Not Have" };
input Choice2 = {default "Any time", "Before the Market", "After the Market"};
def earnings = hasearnings();
def when;
switch (Choice2){
case "Any time":
      when = hasearnings();
case "Before the Market":
    when = HasEarnings(type = EarningTime.BEFORE_MARKET);
case "After the Market":
     when = HasEarnings(type = EarningTime.AFTER_MARKET);
}
#NO earnings

plot scan;
switch (Choice){

case "Has":
      scan = sum(when,length)[-length +1] > 0;
case "Does Not Have":
    scan = sum(when,length)[-length +1] == 0;

}

My DeskTop: https://tos.mx/OmUmKBC
I have entered the format and am getting an error as follows
Invalid statement: switch at 18:1
Have you seen this before?
Thank you for posting the video, definitely saves alot of time.
Looking forward to hearing back
 
Last edited by a moderator:
T

This video will explain.
This is the volume spike code. In a watch list, click the gear icon on the right, select customize, Then type custom on the left, move it over to the right. Click the tablet and paste the code. Make sure 1 minute timeframe and extended hours is checked. If you prefer the shared link: https://tos.mx/WY8iqLI
Code:
input vol_change_pct_threshold_up = 100.0;
input vol_change_pct_threshold_down = 100.0;

# Volume Spike Indicator
def rel_vol = volume / Average(volume, 50);
def vol_change_pct = (rel_vol - 1.0) * 100.0;
def is_spike = vol_change_pct >= vol_change_pct_threshold_up;
def is_spike_down = vol_change_pct >= vol_change_pct_threshold_down;
def is_bullish = close > open;
def is_bearish = close < open;


AddLabel(yes,
         if is_spike and is_bullish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bullish" + "   ")
         else if is_spike and is_bearish then Concat(AsPercent(vol_change_pct / 10000.0), " - Bearish" + "   ")
         else "",
         if is_spike and is_bullish then Color.GREEN
         else if is_spike and is_bearish then Color.LIGHT_RED
         else Color.BLACK);
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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