It is obviously possible to write such software. Many brokers, such as Interactive Brokers, TD Ameritrade, and, I think, E-Trade, have programming interfaces for downloading option chains, and it is also possible to scrape them from web sites, such as finance.yahoo.com or nasdaq.com.
You might want to keep in mind that a maximum profit of $300 and maximum loss of $30 does not necessarily mean that the expected return is positive.
In case it helps you on your way, here is a shell script that should run on most Unix-like systems that have the "wget" command, which will scrape an option chain from Yahoo. That is, if you put it in a file named script.sh and then do something like "script.sh spy", it should print the option chain for SPY as a comma separated variable spreadsheet.
#!/bin/bash
if [ $# != 1 ] ; then
echo "Usage: $0 symbol" >&2
exit 1
fi
symbol=$1
extract_word() {
local word="$1"
local line="$2"
local rest=${line#*\"$word\":\{}
local to_fmt=${rest#*\"fmt\":\"}
echo "${to_fmt%%\"*}"
return 0
}
print_line_csv() {
local type="$1"
local line="$2"
local word
echo -n "${type}"
for word in expiration strike bid ask ; do
echo -n ','$(extract_word "$word" "$line")
done
echo ""
}
get_page() {
local symbol="$1"
local symbol_and_rest="$2"
wget --quiet --no-check-certificate --output-document=- \
"
https://finance.yahoo.com/quote/${symbol}/options?p=${symbol_and_rest}" |
sed 's/>/>\'$'\n'"/g" |
sed 's/{"contractSymbol":/\'$'\n''{"contractSymbol":/g'
}
print_expirations() {
local line rest expiration
egrep '^<option value="' |
while read line ; do
rest=${line#'<option value="'}
expiration=${rest%%\"*}
echo "$expiration"
done
}
print_options() {
local type
while read line ; do
case "$line" in
*\"calls\":* ) type=call ;;
*\"puts\":* ) type=put ;;
\{\"contractSymbol\":* ) print_line_csv "$type" "$line" ;;
esac
done
}
symbol_cap=$(echo "$symbol" | tr a-z A-Z)
for expiration in $(get_page "${symbol_cap}" "S{symbol}" | print_expirations) ; do
get_page "${symbol_cap}" "${symbol}&date=${expiration}" |
print_options
done | sort -u