Skip to content

Section 1 - Globals

1.1 - context

This is the main class used in QuantSigma. Here you can store variables or use it to pull the algorithm's account information

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Return cash in account
print(context.account.cash)
output: 10000.00

# Return positions in portfolio
print(context.account.portfolio)
output: {'SPY': {'qty': 10, 'cost': 301.50},
         'TLT': {'qty': 1, 'cost': 155.32}}

# Store variables
context.symbol = 'SPY'
print(context.symbol)
output: 'SPY'

1.2 - MARKET

This variable is used to set which market the algorithm will trade in. These are the current supported markets:

Markets

  • US-EQUTIES
  • CRYPTO

Example

1
MARKET = 'USEQUITIES'
1
MARKET = 'CRYPTO'