Skip to content

Commit

Permalink
Refactor the account to be easier to change.
Browse files Browse the repository at this point in the history
  • Loading branch information
chipkent committed Aug 28, 2024
1 parent 89a7e6e commit 395c5b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions examples/example_all_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

import deephaven_ib as dhib

## Setup

account = "DU123456" # Set your account here

###########################################################################
# WARNING: THIS SCRIPT EXECUTES TRADES!! ONLY USE ON PAPER TRADING ACCOUNTS
###########################################################################
Expand Down Expand Up @@ -483,7 +487,7 @@ def get_contracts() -> Dict[str, Contract]:
print(contract)

order = Order()
order.account = "DF4943843"
order.account = account
order.action = "BUY"
order.orderType = "LIMIT"
order.totalQuantity = 1
Expand All @@ -494,7 +498,7 @@ def get_contracts() -> Dict[str, Contract]:
print("Placing order: END")

order = Order()
order.account = "DF4943843"
order.account = account
order.action = "BUY"
order.orderType = "LIMIT"
order.totalQuantity = 1
Expand All @@ -505,7 +509,7 @@ def get_contracts() -> Dict[str, Contract]:
print("Placing order: START")

order = Order()
order.account = "DF4943843"
order.account = account
order.action = "BUY"
order.orderType = "LIMIT"
order.totalQuantity = 1
Expand Down
2 changes: 1 addition & 1 deletion examples/example_market_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

## Setup

account = "DU4943848"
account = "DU123456" # Set your account here
max_position_dollars = 10000.0
em_time = "PT00:02:00"

Expand Down
10 changes: 7 additions & 3 deletions examples/example_read_only_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

import deephaven_ib as dhib

## Setup

account = "DU123456" # Set your account here

print("==============================================================================================================")
print("==== Create a client and connect.")
print("==== ** Accept the connection in TWS **")
Expand Down Expand Up @@ -479,7 +483,7 @@ def get_contracts() -> Dict[str, Contract]:
print(contract)

order = Order()
order.account = "DF4943843"
order.account = account
order.action = "BUY"
order.orderType = "LIMIT"
order.totalQuantity = 1
Expand All @@ -496,7 +500,7 @@ def get_contracts() -> Dict[str, Contract]:
print("Placing order -- confirm fail: END")

order = Order()
order.account = "DF4943843"
order.account = account
order.action = "BUY"
order.orderType = "LIMIT"
order.totalQuantity = 1
Expand All @@ -513,7 +517,7 @@ def get_contracts() -> Dict[str, Contract]:
print("Placing order -- confirm fail: START")

order = Order()
order.account = "DF4943843"
order.account = account
order.action = "BUY"
order.orderType = "LIMIT"
order.totalQuantity = 1
Expand Down

0 comments on commit 395c5b5

Please sign in to comment.