Coder Social home page Coder Social logo

thetatracker's Introduction

ThetaTracker

A terminal application for tracking options trading metrics. This application gets your list of stock tickers and based on your basic parameters displays the most profitable option trades within defined boundaries. See user config for more details.

The interface: theta-tracker-interface.png

Pre-requisites and configuration

The app relies on three main files in order to run effectively:

  • system config file theta_tracker_system.conf
  • user config file theta_tracker_user.conf
  • stock tickers list to track tickers2watch.txt

System config file consist of:

{"api_key": "YOUR_td_ameritrade_api_key", "finnhub_api_key": "YOUR_finnhub_api_key", "refresh_interval": 600}

In order to obtain your api keys for both portals please visit and register at: https://developer.tdameritrade.com/apis and https://finnhub.io/

User config file consist of:

{"max_delta": 0.3, "dte_range_min": 24, "dte_range_max": 45, "buying_power": 50000.0, "default_sorting_method": "arr"}

These are the example values and if you don't have this file, the app will ask for your values.

The meaning of the configuration options are:

max_delta - this is simply speaking a maximum risk you want to take into account when selling the option. The possible values are between 0.0 and 1.0. Don't bother with negative sign, just use the absolute value, it will work.

dte_range_min - this is a minimum number of days you want to consider when selling the option. Valid values are between 0 (today) and 365.

dte_range_max - this is a maximum number of days you want to consider when selling the option. In other words: second bracket of a time window for your trades. Valid values are between previously entered dte_range_min and 365.

buying_power - this is a buying power you want to take into account when trading. The minimum value is 1000USD. This might include your margin, but remember - trading on margin increases your risk! The general rule is that this is a hard limit when calculating possible positions by the application. In short: if you want to sell covered PUTs, put your available cash on trading account. If you want to sell naked - do what you want but be warned! ๐Ÿค“

default_sorting_method - this parameter tells what should the app use to sort the possible option trades. You should by default use 'arr', as this gives utilizes to the maximum your capital in the assumed time period. Other possible values are:

premium_usd
premium_per_day
delta

You will be able to change it later, in the app.

Tickers' list should be put into the tickers2watch.txt file - please note that you might want to put them in a specific order, for instance from the best in the first line to the least attractive in the last one.

The best way to obtain the most attractive list of tickers is to use a tool such as finviz screener or even run a script like https://github.com/RudolfTheOne/FinVizStockSelector.

Note: if you will not provide any list, the application will present option chains for SPY ETF.

Running the app

Once you have your tickers and proper config files, you run the app and see its main interface. Here is the explanation of what the app's main interface tells you:

Header

In this part of the screen the app will report:

header.png

ThetaTracker - its name ๐Ÿ˜Ž

Date: YYYY-MM-DD HH:MM - current date and time

Buying power: $XXXXX.00 - your buying power in USD

Market: Open - market status (can be Open or Closed).

Footer

Bottom part of the interface gives you a brief overview of hotkeys, as:

footer.png

q - the app will exit

c - configuration setup, allowing you to change user config options:

config.png

s - sorting method, see:

sorting.png

r - forced refresh: this will force the app to retrieve all the data from the external sources again and refresh displayed position on the screen. It might take a while, especially for larger number of tickets.

Main window - main element and its details

position.png

First row displays ticker along its position from the tickers2watch.txt file in the square bracket. The assumption is that if you sorted your tickers from best to worst, you might want to consider that info when choosing the trade. Next are Bid and Ask prices along with their sizes and Volatility followed by Strike Price.

Second row gives position description (along with type of the option), followed by the delta value (remember - rule of thumb is the lower delta, the less risky is the trade), underlying price followed by difference between this price and strike price (in the bracket it will display d: $2.0 0.04% meaning the difference between the underlying price and the strike price is 2 dollars which translates to 0.04% of the difference.). The last value in the row is Days to Expiration.

Third row displays the most essential data for the trader: Premium Total in USD - this calculates the total premium you will get for selling the total number of contracts.

NOTE: this doesn't take into account your trade fees from your broker!.

The next value says about premium you will earn per day (that's simply premium total divided per days to expiration) followed by ARR. The ARR reflects the percentage rate of return expected on an investment extending the result on one trade to a full year. It's the most useful indicator of how profitable your trade is in specific time window. The last constant thing displayed is Number of contracts to write: this tells you how many options you can sell having your previously defined buying power. Note: in case the specific trade's underlying has an earning report within defined time window, you will see a warning: โš ๏ธ๐Ÿ“†.

Ending notes

This app has been written by Chat GPT 4.

Happy trading! ๐Ÿ’ต๐Ÿ’ช

thetatracker's People

Contributors

rudolftheone avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.