Skip to content

Commit 4577a16

Browse files
authored
Merge pull request #66 from MaxxRK/deepsource-transform-b8220318
style: format code with Black and isort
2 parents 8584f71 + 3c7623e commit 4577a16

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

test.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from firstrade import account, order, symbols
22

33
# Create a session
4-
ft_ss = account.FTSession(username="", password="", email = "", profile_path="")
4+
ft_ss = account.FTSession(username="", password="", email="", profile_path="")
55
need_code = ft_ss.login()
66
if need_code:
77
code = input("Please enter the pin sent to your email/phone: ")
@@ -58,11 +58,13 @@
5858
history = ft_accounts.get_account_history(
5959
account=ft_accounts.account_numbers[0],
6060
date_range="cust",
61-
custom_range=["2024-01-01", "2024-06-30"]
61+
custom_range=["2024-01-01", "2024-06-30"],
6262
)
6363

6464
for item in history["items"]:
65-
print(f"Transaction: {item['symbol']} on {item['report_date']} for {item['amount']}.")
65+
print(
66+
f"Transaction: {item['symbol']} on {item['report_date']} for {item['amount']}."
67+
)
6668

6769

6870
# Create an order object.
@@ -92,27 +94,35 @@
9294
# Cancel placed order
9395
# cancel = ft_accounts.cancel_order(order_conf['result']["order_id"])
9496
# if cancel["result"]["result"] == "success":
95-
# print("Order cancelled successfully.")
97+
# print("Order cancelled successfully.")
9698
# print(cancel)
9799

98100
# Check orders
99101
recent_orders = ft_accounts.get_orders(ft_accounts.account_numbers[0])
100102
print(recent_orders)
101103

102-
#Get option dates
104+
# Get option dates
103105
option_first = symbols.OptionQuote(ft_ss, "INTC")
104106
for item in option_first.option_dates["items"]:
105-
print(f"Expiration Date: {item['exp_date']} Days Left: {item['day_left']} Expiration Type: {item['exp_type']}")
107+
print(
108+
f"Expiration Date: {item['exp_date']} Days Left: {item['day_left']} Expiration Type: {item['exp_type']}"
109+
)
106110

107111
# Get option quote
108-
option_quote = option_first.get_option_quote("INTC", option_first.option_dates["items"][0]["exp_date"])
112+
option_quote = option_first.get_option_quote(
113+
"INTC", option_first.option_dates["items"][0]["exp_date"]
114+
)
109115
print(option_quote)
110116

111117
# Get option greeks
112-
option_greeks = option_first.get_greek_options("INTC", option_first.option_dates["items"][0]["exp_date"])
118+
option_greeks = option_first.get_greek_options(
119+
"INTC", option_first.option_dates["items"][0]["exp_date"]
120+
)
113121
print(option_greeks)
114122

115-
print(f"Placing dry option order for {option_quote['items'][0]['opt_symbol']} with a price of {option_quote['items'][0]['ask']}.")
123+
print(
124+
f"Placing dry option order for {option_quote['items'][0]['opt_symbol']} with a price of {option_quote['items'][0]['ask']}."
125+
)
116126
print("Symbol readable ticker 'INTC'")
117127

118128
# Place dry option order

0 commit comments

Comments
 (0)