DEV Community

Cover image for #FOSS Fintech In Python: Generating Trade Ideas With The OpenBB Terminal
Danglewood
Danglewood

Posted on • Updated on

#FOSS Fintech In Python: Generating Trade Ideas With The OpenBB Terminal

Sometimes you need a little inspiration while turning over stones, hunting for that winning trade. Little hints can go a long way when you know what to look for. Flow is one of the more popular types of momentum indicators today. It suggests that heavy volume in one particular option and expiry is a leading indicator of future price expectations.

One of the fastest ways to discover where the money is flowing is to look at the unusual options activity. The OpenBB Terminal is a fast, efficient, and free tool that provides an ad-free experience. Below is a short video that shows how to quickly retrieve a list of unusual options activity.

Here's the list for closer inspection:

┏━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━┓
┃ Ticker ┃ Exp        ┃ Strike ┃ Type ┃ Vol/OI ┃ Vol      ┃ OI      ┃ Bid  ┃ Ask  ┃
┡━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━┩
│ OXY    │ 2022-05-20 │ 85.00  │ Call │ 24.50  │ 5316.00  │ 217.00  │ 0.87 │ 0.89 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ ADBE   │ 2022-03-25 │ 360.00 │ Put  │ 14.30  │ 1658.00  │ 116.00  │ 0.00 │ 0.00 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ DISH   │ 2022-09-16 │ 40.00  │ Call │ 11.30  │ 2141.00  │ 190.00  │ 1.25 │ 1.51 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ ADBE   │ 2022-03-18 │ 385.00 │ Put  │ 9.10   │ 1643.00  │ 181.00  │ 0.00 │ 0.00 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ PFE    │ 2022-03-18 │ 53.00  │ Call │ 7.90   │ 10391.00 │ 1319.00 │ 0.37 │ 0.38 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ EL     │ 2022-03-18 │ 290.00 │ Call │ 5.50   │ 640.00   │ 116.00  │ 0.35 │ 0.65 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ WU     │ 2022-08-19 │ 19.00  │ Call │ 5.10   │ 801.00   │ 158.00  │ 0.70 │ 0.85 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ T      │ 2022-03-25 │ 20.00  │ Put  │ 5.10   │ 1000.00  │ 197.00  │ 0.04 │ 0.05 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ OXY    │ 2022-03-18 │ 48.50  │ Put  │ 5.10   │ 518.00   │ 101.00  │ 0.44 │ 0.48 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ BWA    │ 2022-04-14 │ 42.50  │ Call │ 5.00   │ 1157.00  │ 230.00  │ 0.20 │ 0.35 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ CCI    │ 2022-04-14 │ 190.00 │ Call │ 4.60   │ 2027.00  │ 445.00  │ 0.60 │ 1.00 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ D      │ 2023-01-20 │ 82.50  │ Call │ 4.50   │ 2187.00  │ 487.00  │ 6.50 │ 7.40 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ RL     │ 2022-07-15 │ 90.00  │ Put  │ 4.40   │ 515.00   │ 118.00  │ 4.80 │ 6.30 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ VIAC   │ 2022-05-20 │ 25.00  │ Put  │ 4.40   │ 1985.00  │ 447.00  │ 1.09 │ 1.16 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ VIAC   │ 2022-04-14 │ 25.00  │ Put  │ 4.20   │ 1485.00  │ 355.00  │ 0.66 │ 0.70 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ VIAC   │ 2022-04-14 │ 30.00  │ Call │ 4.10   │ 4214.00  │ 1028.00 │ 1.83 │ 1.94 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ LYB    │ 2022-04-14 │ 110.00 │ Call │ 3.90   │ 2889.00  │ 746.00  │ 2.05 │ 2.35 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ NLSN   │ 2022-03-18 │ 18.00  │ Call │ 3.60   │ 518.00   │ 145.00  │ 0.00 │ 0.45 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ MCD    │ 2022-03-18 │ 227.50 │ Call │ 3.60   │ 1961.00  │ 548.00  │ 3.25 │ 3.45 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ VIAC   │ 2022-03-18 │ 30.00  │ Call │ 3.60   │ 21859.00 │ 6146.00 │ 1.42 │ 1.45 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ MMC    │ 2022-04-14 │ 140.00 │ Put  │ 3.20   │ 651.00   │ 204.00  │ 1.90 │ 2.30 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ VIAC   │ 2022-03-18 │ 22.50  │ Put  │ 3.10   │ 2023.00  │ 644.00  │ 0.10 │ 0.16 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ MDLZ   │ 2022-03-18 │ 62.00  │ Call │ 2.80   │ 300.00   │ 108.00  │ 0.10 │ 0.20 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ PWR    │ 2022-04-14 │ 135.00 │ Call │ 2.80   │ 806.00   │ 292.00  │ 2.15 │ 2.45 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ VIAC   │ 2022-03-18 │ 25.00  │ Put  │ 2.70   │ 3982.00  │ 1453.00 │ 0.35 │ 0.39 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ BAC    │ 2022-03-18 │ 39.50  │ Put  │ 2.70   │ 2867.00  │ 1060.00 │ 0.31 │ 0.33 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ AAPL   │ 2022-04-22 │ 160.00 │ Call │ 2.70   │ 3264.00  │ 1203.00 │ 3.45 │ 3.60 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ SLB    │ 2022-03-25 │ 47.00  │ Call │ 2.60   │ 360.00   │ 138.00  │ 0.00 │ 0.00 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ ADBE   │ 2022-03-18 │ 460.00 │ Call │ 2.60   │ 1335.00  │ 506.00  │ 0.00 │ 0.00 │
├────────┼────────────┼────────┼──────┼────────┼──────────┼─────────┼──────┼──────┤
│ WM     │ 2022-04-14 │ 150.00 │ Put  │ 2.60   │ 1012.00  │ 384.00  │ 4.20 │ 4.40 │
└────────┴────────────┴────────┴──────┴────────┴──────────┴─────────┴──────┴──────┘

Enter fullscreen mode Exit fullscreen mode

With 24.5 times the amount of volume as open interest, Occidental Petroleum Corporation calls at the $85 strike expiring on May 20 is somewhat intriguing. Let's look at the underlying for a moment.

A 60 minute interval candle chart of OXY over two years. (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/candle/)

At $85, the calls are nearly 50% OTM with 60 DTE. That represents a big move; why so deep? Maybe the market maker knows something we don't. We do know that the price of oil has exploded and that domestic producers are likely to benefit from the changing world order. To investigate, fundamentals are a good place to start. The earnings schedule is a way to frame the expectations of the option in question.

Past quarterly earnings results of Occidental Petroleum Corporation (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/fundamental_analysis/earnings/)

We can also see that Q1 2022 earnings will be reported the week prior to the option expiring. It is possible these calls are a hedge against an earnings surprise to the upside. There must be more to the story. Checking the lobbying history, OXY has been up to the regular stuff that the Oil & Gas Industry does in Washington - taxes and the agenda of domestic production and exports.

A sample of OXY's lobbying history (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/government/lobbying/)

Analyst price targets don't exceed the strike price of the call we are looking at, not bullish on the calls.

Analyst ratings and price targets (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/due_diligence/analyst/)

History of price targets and price over time:

Historical price targets over time (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/due_diligence/pt/)

Forward earnings estimates tells a story showing a company in decline. Expectations are for 2022 to be the peak of earning power for this commodity producer.

2022 Mar 14, 12:42 (✨) /stocks/dd/ $ est
                           Annual Earnings Estimates                           
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
┃                                ┃ 2022   ┃ 2023   ┃ 2024   ┃ 2025   ┃ 2026   ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
│ Revenue                        │ 28,668 │ 27,050 │ 26,155 │ 23,673 │ 23,044 │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Dividend                       │ 0.31   │ 0.31   │ 0.57   │ 0.26   │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Dividend Yield (in %)          │ 0.54 % │ 0.53 % │ 0.99 % │ 0.45 % │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ EPS                            │ 5.07   │ 3.50   │ 2.18   │ 1.99   │ 2.04   │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ P/E Ratio                      │ 11.43  │ 16.58  │ 26.56  │ 29.15  │ 28.40  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ EBIT                           │ 9,374  │ 7,314  │ 5,357  │ 4,859  │ 4,650  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ EBITDA                         │ 16,869 │ 14,514 │ 12,936 │ 12,180 │ 11,513 │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Net Profit                     │ 4,795  │ 3,286  │ 2,489  │ 2,774  │ 2,140  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Net Profit Adjusted            │ 4,795  │ 3,286  │ 2,489  │ 2,774  │ 2,140  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Pre-Tax Profit                 │ 7,920  │ 5,916  │ 4,879  │ 4,588  │ 3,611  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Net Profit (Adjusted)          │ 8,451  │ 6,836  │ 2,764  │ -      │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ EPS (Non-GAAP) ex. SOE         │ 5.07   │ 3.50   │ 2.18   │ 1.99   │ 2.04   │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ EPS (GAAP)                     │ 5.41   │ 3.35   │ 1.79   │ 2.43   │ 2.04   │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Gross Income                   │ -      │ -      │ -      │ -      │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Cash Flow from Investing       │ -3,888 │ -4,224 │ -4,429 │ -4,465 │ -4,332 │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Cash Flow from Operations      │ 13,676 │ 11,809 │ 10,534 │ 9,679  │ 9,100  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Cash Flow from Financing       │ -3,276 │ -2,443 │ -4,220 │ -5,124 │ -4,731 │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Cash Flow per Share            │ 14.32  │ 12.46  │ 10.95  │ 10.98  │ 10.74  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Free Cash Flow                 │ 9,906  │ 6,950  │ 4,569  │ 5,301  │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Free Cash Flow per Share       │ 10.89  │ 4.52   │ 4.39   │ 4.00   │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Book Value per Share           │ 18.08  │ 19.90  │ 20.66  │ -      │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Net Debt                       │ 19,256 │ 14,263 │ 13,886 │ 5,957  │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Research & Development Exp.    │ -      │ -      │ -      │ -      │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Capital Expenditure            │ 3,842  │ 4,046  │ 4,172  │ 4,074  │ 4,032  │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Selling, General & Admin. Exp. │ 1,436  │ 1,314  │ 1,930  │ -      │ -      │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Shareholder’s Equity           │ -      │ 21,999 │ 24,961 │ 23,905 │ 17,185 │
├────────────────────────────────┼────────┼────────┼────────┼────────┼────────┤
│ Total Assets                   │ 78,149 │ 79,927 │ 83,263 │ 77,463 │ 76,234 │
└────────────────────────────────┴────────┴────────┴────────┴────────┴────────┘

Enter fullscreen mode Exit fullscreen mode

Not very hot so far, and taking a look at the binomial option valuation, the probability of this call expiring in the money is slim. The valuation of $0.31 suggests this option is overpriced by more than double. Selling naked calls here is likely a safe bet, but writing naked options is almost never recommended.

Binomial options valuation (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/options/binom/)

A visual representation of the volume and open interest for the May 20 expiration.

Volume and open interest for OXY, May 20 expiration.(https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/options/voi/)

After a few minutes, it will become apparent if there is an opportunity. It can take time to find the right setup, so be quick to give up. Another option that stands out from the unusual activity list is Western Union. Expiration dates over 90 days are notable and this activity is more telling than something expiring in a day or two.

┃ Ticker ┃ Exp        ┃ Strike ┃ Type ┃ Vol/OI ┃ Vol      ┃ OI      ┃ Bid  ┃ Ask  ┃
│ WU     │ 2022-08-19 │ 19.00  │ Call │ 5.10   │ 801.00   │ 158.00  │ 0.70 │ 0.85 │
Enter fullscreen mode Exit fullscreen mode

A quote from the Terminal shows it is bouncing off its 52 week low and the strike is < 10% OTM.

2022 Mar 14, 13:34 (✨) /stocks/ $ load wu

Loading Daily WU stock with starting period 2019-03-11 for analysis.

Datetime: 2022 Mar 14 13:34
Timezone: America/New_York
Currency: USD
Market:   OPEN

2022 Mar 14, 13:34 (✨) /stocks/ $ quote
                  Ticker Quote                  
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                ┃ WU                          ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Name           │ Western Union Company (The) │
├────────────────┼─────────────────────────────┤
│ Price          │ 17.44                       │
├────────────────┼─────────────────────────────┤
│ Open           │ 17.36                       │
├────────────────┼─────────────────────────────┤
│ High           │ 17.61                       │
├────────────────┼─────────────────────────────┤
│ Low            │ 17.18                       │
├────────────────┼─────────────────────────────┤
│ Previous Close │ 17.21                       │
├────────────────┼─────────────────────────────┤
│ Volume         │ 2,271,326                   │
├────────────────┼─────────────────────────────┤
│ 52 Week High   │ 26.61                       │
├────────────────┼─────────────────────────────┤
│ 52 Week Low    │ 15.69                       │
├────────────────┼─────────────────────────────┤
│ Change         │ 0.23                        │
├────────────────┼─────────────────────────────┤
│ Change %       │ 1.34%                       │
└────────────────┴─────────────────────────────┘

Enter fullscreen mode Exit fullscreen mode

A daily chart with 50, 100 & 200 day moving averages:

A daily chart with 50, 100 & 200 day moving averages (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/candle/)

Probability distribution of the $19 call expiring August 19:

Probability distribution of the $19 call expiring August 19 (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/options/binom/)

Historical premium and underlying stock price:

Historical premium and underlying stock price (https://gamestonkterminal.github.io/GamestonkTerminal/terminal/stocks/options/grhist/)

The process can be repeated quickly, eliminating choices until something stands out as an outlier. This software is 100% MIT Open-Source Licensed, free to everyone. You can support the project by downloading it from GitHub and giving it a star!

https://github.com/GamestonkTerminal/GamestonkTerminal/

Join the community Discord server and try the amazing and interactive stock bot:

https://discord.com/invite/Up2QGbMKHY

Read the documentation here:

https://gamestonkterminal.github.io/GamestonkTerminal/

Top comments (1)

Collapse
 
visirex profile image
Visirex

Really good application.....just curious as to why OpenBB chose to develop terminal as a desktop app vs. web-based app? Is there still a need for desktop apps...specifically with finance or investing companies? let me know your thoughts...