Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    Coding the Earnings Gap & Go | thinkScript Studies on thinkorswim

    blog thumbnail

    Introduction

    Introduction

    Hey everybody, welcome back to thinkScripting. My name is Mike Fairborn. Today we'll discuss earnings season, which is already upon us again. Specifically, we want to talk about creating a script that can identify a "Gap and Go" scenario—an earnings gap followed by a run. We'll use thinkScript on the thinkorswim platform to do this.

    Cameron May joins us in the chat to help answer any questions or comments. Feel free to interact with us in the chat. Let's dive into it.

    Disclaimer

    • Options carry a high level of risk and are not suitable for all investors.
    • The information provided is for educational purposes only.
    • The paper money software application is for educational purposes only.
    • Investing involves risk including the loss of principal.

    Agenda

    1. Steps to Scripting: Identifying the goal of the script.
    2. Creating the Script: We will develop a script that identifies an earnings gap followed by a run.
    3. Testing the Script: We'll test it live and place a paper trade based on the results.
    4. Sharing the Script: Finally, we'll share the thinkScript link with you.

    Finding Earnings Data on thinkorswim

    Head to the Calendar tab on thinkorswim and set it to "Monthly" for a broader view. Configure it to show S&P 500 companies using the gear icon. You can see all earnings announcements in the S&P 500 over the selected period.

    Steps to Creating the Script

    Starting with the Earnings Scan

    The first step involves setting up a scan to identify companies that had earnings within a certain look-back period. Navigate to the "Scan" tab and add a filter, selecting "Study" and then "Corporate Actions". Set it to filter based on earnings within a certain number of days.

    input lookback = 20; # Checks for earnings in the last 20 bars (days)
    def hasEarnings = HasEarnings();
    plot data = hasEarnings[1] within lookback;
    

    Adding the Gap and Go Criteria

    We now need a second filter to identify stocks that had both a significant gap up and a subsequent run. Create a new scan:

    input gapPercent = 2; # Minimum 2% gap
    input intradayIncrease = 2; # Minimum 2% follow-through
    input lookback = 20;
    
    def gapUp = (open / close[1] - 1) * 100 >= gapPercent;
    def intraday = (high / open - 1) * 100 >= intradayIncrease;
    plot scan = gapUp and intraday within lookback;
    

    Combining the Two Criteria

    Combine the two scans to identify stocks that meet both criteria.

    input gapPercent = 2;
    input intradayIncrease = 2;
    input lookback = 20;
    
    def hasEarnings = HasEarnings();
    def gapUp = (open / close[1] - 1) * 100 >= gapPercent;
    def intraday = (high / open - 1) * 100 >= intradayIncrease;
    
    plot scan = hasEarnings[1] and gapUp and intraday within lookback;
    

    Test the Script

    Test it live on the platform to see if it filters out the desired stocks, including applying any additional technical indicators you may find useful for further filtering.

    Paper Trade

    For the test, I chose Discover Financial Services (DFS). I placed a paper trade of 50 shares with an alert set to notify me for a potential extra buy if the stock breaks out above a certain level.

    Sharing the Script

    After verifying that the script works, I will add the link in the "more" section of YouTube and post it on X (formerly Twitter).

    Keywords

    • Earnings Gap
    • thinkScript
    • thinkorswim
    • S&P 500
    • Gap and Go
    • Earnings Season

    FAQ

    Q1: What is the "Gap and Go" strategy? A1: The Gap and Go strategy focuses on identifying stocks that have gapped up after an earnings announcement and continued to rise intraday.

    Q2: Why is it important to look at volume in a Gap and Go strategy? A2: Volume can confirm the strength of the move. For future improvements, you can add volume-based conditions to the script.

    Q3: Can this script be used for downward gaps as well? A3: Yes, with slight modifications, this script can be adjusted to look for downward gaps.

    Q4: How do you adjust the lookback period in the script? A4: The lookback period is defined by the variable input lookback, which you can easily change as needed.

    Q5: Where can I find the shared script link? A5: The script link will be available in the "more" section under the description of the YouTube video.

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like