From 64d807a2445576c5127e02d7e70f24e106b79b31 Mon Sep 17 00:00:00 2001 From: sal Date: Sun, 29 Oct 2023 15:05:35 -0500 Subject: [PATCH] updated --- appveyor.yml | 2 +- docs/_modules/pyqstrat/evaluator.html | 9 +- docs/_modules/pyqstrat/pq_types.html | 40 +- docs/_modules/pyqstrat/pq_utils.html | 21 +- docs/_modules/pyqstrat/strategy.html | 25 +- docs/_modules/pyqstrat/strategy_builder.html | 22 +- .../pyqstrat/strategy_components.html | 331 +++++++++++---- docs/genindex.html | 112 +++-- docs/modules.html | 58 ++- docs/objects.inv | Bin 3254 -> 3401 bytes docs/pyqstrat.html | 394 ++++++++++++++---- docs/searchindex.js | 2 +- 12 files changed, 771 insertions(+), 245 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e0a7687..ece5436 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -53,7 +53,7 @@ for: - mypy --ignore-missing-imports pyqstrat/ - flake8 --ignore W291,W293,W503,E402,E701,E275,E741 --max-line-length=160 pyqstrat/ # run notebooks and exit on first error - - find pyqstrat/notebooks -name '*.ipynb' | xargs -n1 sh -c 'ipython $0 || exit 255' + - find pyqstrat/notebooks -name '*.ipynb' | xargs -n1 sh -c 'ipython --no-automagic $0 || exit 255' - matrix: diff --git a/docs/_modules/pyqstrat/evaluator.html b/docs/_modules/pyqstrat/evaluator.html index b98eeae..26c9c76 100644 --- a/docs/_modules/pyqstrat/evaluator.html +++ b/docs/_modules/pyqstrat/evaluator.html @@ -701,7 +701,7 @@

Source code for pyqstrat.evaluator

 
 
[docs] -def plot_return_metrics(metrics: dict[str, Any], title='', height=1000, width=0, show_points=True, show=True) -> go.Figure: +def plot_return_metrics(metrics: dict[str, Any], title='', height=1000, width=0, show_points=False, show=True) -> go.Figure: ''' Plot equity, rolling drawdowns and and a boxplot of annual returns given the output of compute_return_metrics. @@ -758,6 +758,8 @@

Source code for pyqstrat.evaluator

     fig.add_trace(go.Box(x=all_rets, boxmean=True, marker_color='blue', line_color='blue', name='All'), row=3, col=1)
     if show_points:
         fig.update_traces(boxpoints='all', jitter=0.1, row=3, col=1)
+    else:
+        fig.update_traces(boxpoints=False, row=3, col=1)
 
     fig.update_yaxes(title_text="Equity", type="log", row=1, col=1)
     fig.update_yaxes(title_text="Drawdown", row=2, col=1)
@@ -780,8 +782,9 @@ 

Source code for pyqstrat.evaluator

     
     ev = compute_return_metrics(timestamps, rets, starting_equity)
     display_return_metrics(ev.metrics())
-    plot_return_metrics(ev.metrics())
-    
+    plot_return_metrics(ev.metrics(), show_points=False)
+    plot_return_metrics(ev.metrics(), show_points=True)
+
     assert_(round(ev.metric('sharpe'), 6) == 2.932954)
     assert_(round(ev.metric('sortino'), 6) == 5.690878)
     assert_(ev.metric('annual_returns')[0] == [2018])
diff --git a/docs/_modules/pyqstrat/pq_types.html b/docs/_modules/pyqstrat/pq_types.html
index 6f4ee64..05cb78f 100644
--- a/docs/_modules/pyqstrat/pq_types.html
+++ b/docs/_modules/pyqstrat/pq_types.html
@@ -77,6 +77,13 @@ 

Source code for pyqstrat.pq_types

         return ContractGroup._instances[name]
+
+[docs] + @staticmethod + def get_default() -> ContractGroup: + return DEFAULT_CG
+ +
[docs] @staticmethod @@ -107,8 +114,14 @@

Source code for pyqstrat.pq_types

 [docs]
     @staticmethod
     def clear_cache() -> None:
-        ContractGroup.contracts = {}
-        ContractGroup.contracts = {}
+ ContractGroup._instances = {}
+ + +
+[docs] + def clear(self) -> None: + '''Remove all contracts''' + self.contracts.clear()
def __repr__(self) -> str: @@ -198,6 +211,22 @@

Source code for pyqstrat.pq_types

         return Contract._instances.get(name)
+
+[docs] + @staticmethod + def get_or_create(symbol: str, + contract_group: ContractGroup | None = None, + expiry: np.datetime64 | None = None, + multiplier: float = 1., + components: list[tuple[Contract, float]] | None = None, + properties: SimpleNamespace | None = None) -> Contract: + if symbol in Contract._instances: + contract = Contract._instances.get(symbol) + else: + contract = Contract.create(symbol, contract_group, expiry, multiplier, components, properties) + return contract # type: ignore
+ +
[docs] @staticmethod @@ -387,8 +416,11 @@

Source code for pyqstrat.pq_types

 @dataclass(kw_only=True)
 class MarketOrder(Order):
     def __post_init__(self):
-        if not np.isfinite(self.qty) or math.isclose(self.qty, 0):
-            raise ValueError(f'order qty must be finite and nonzero: {self.qty}')
+        try:
+            if not np.isfinite(self.qty) or math.isclose(self.qty, 0):
+                raise ValueError(f'order qty must be finite and nonzero: {self.qty}')
+        except Exception as ex:
+            _logger.info(ex)
             
     def __repr__(self):
         timestamp = pd.Timestamp(self.timestamp).to_pydatetime()
diff --git a/docs/_modules/pyqstrat/pq_utils.html b/docs/_modules/pyqstrat/pq_utils.html
index eb12251..881f981 100644
--- a/docs/_modules/pyqstrat/pq_utils.html
+++ b/docs/_modules/pyqstrat/pq_utils.html
@@ -573,7 +573,7 @@ 

Source code for pyqstrat.pq_utils

     for period in ['D', 'M', 'm', 's']:
         ret = try_frequency(timestamps, period, threshold)
         if math.isfinite(ret): return ret
-    assert_(False, f'could not infer frequency from timestamps: {timestamps}')
+    assert_(False, f'could not infer frequency from timestamps: {timestamps[:100]} ...')
     return math.nan  # will never execute but keeps mypy happy
@@ -777,7 +777,6 @@

Source code for pyqstrat.pq_utils

                         formatter: logging.Formatter | None = None) -> None:
     if formatter is None: formatter = logging.Formatter(fmt=LOG_FORMAT, datefmt=DATE_FORMAT)
     stream_handler = logging.StreamHandler(sys.stdout)
-    # stream_handler = logging.StreamHandler()
     stream_handler.setFormatter(formatter)
     stream_handler.setLevel(log_level)
     logger.addHandler(stream_handler)
@@ -786,7 +785,6 @@ 

Source code for pyqstrat.pq_utils

 
[docs] def get_main_logger() -> logging.Logger: - # sys.stderr = sys.stdout main_logger = logging.getLogger('pq') if len(main_logger.handlers): return main_logger _add_stream_handler(main_logger) @@ -813,7 +811,16 @@

Source code for pyqstrat.pq_utils

     Whether we are running in an ipython (or Jupyter) environment
     '''
     import builtins
-    return '__IPYTHON__' in vars(builtins)
+ if ('__IPYTHON__' in vars(builtins)): return True + return False
+ + + +
+[docs] +def in_debug() -> bool: + if 'PQ_DEBUG_MODE' in os.environ: return True + return False
@@ -832,7 +839,11 @@

Source code for pyqstrat.pq_utils

     using the python optimization switch
     '''
     if msg is None: msg = ''
-    if not condition: raise PQException(msg)
+ if not condition: + if in_debug(): + import pdb + pdb.set_trace() + raise PQException(msg)
diff --git a/docs/_modules/pyqstrat/strategy.html b/docs/_modules/pyqstrat/strategy.html index a538bd6..788073f 100644 --- a/docs/_modules/pyqstrat/strategy.html +++ b/docs/_modules/pyqstrat/strategy.html @@ -103,6 +103,8 @@

Source code for pyqstrat.strategy

                  pnl_calc_time: int = 16 * 60 + 1,
                  trade_lag: int = 0,
                  run_final_calc: bool = True, 
+                 log_trades: bool = True,
+                 log_orders: bool = False,
                  strategy_context: StrategyContextType | None = None) -> None:
         '''
         Args:
@@ -120,6 +122,8 @@ 

Source code for pyqstrat.strategy

             strategy_context: A storage class where you can store key / value pairs relevant to this strategy.
                 For example, you may have a pre-computed table of correlations that you use in the indicator or trade rule functions.  
                 If not set, the __init__ function will create an empty member strategy_context object that you can access.
+            log_trades: If set, we log orders as they are created
+            log_orders: If set, we log trades as they are created
         '''
         self.name = 'main'  # Set by portfolio when running multiple strategies
         increasing_ts: bool = bool(np.all(np.diff(timestamps.astype(int)) > 0))
@@ -134,6 +138,8 @@ 

Source code for pyqstrat.strategy

         assert_(trade_lag >= 0, f'trade_lag cannot be negative: {trade_lag}')
         self.trade_lag = trade_lag
         self.run_final_calc = run_final_calc
+        self.log_trades = log_trades
+        self.log_orders = log_orders
         self.indicators: dict[str, IndicatorType] = {}
         self.signals: dict[str, SignalType] = {}
         self.signal_values: dict[str, SimpleNamespace] = defaultdict(types.SimpleNamespace)
@@ -470,6 +476,12 @@ 

Source code for pyqstrat.strategy

         
         for j, (rule_function, contract_group, params) in enumerate(rules):
             orders = self._get_orders(i, rule_function, contract_group, params)
+            if self.log_orders and len(orders) > 0:
+                if len(orders) > 1:
+                    _logger.info('ORDERS:' + ''.join([f'\n {order}' for order in orders]))
+                else:
+                    _logger.info(f'ORDER: {orders[0]}')
+                    
             self._orders += orders
             self._current_orders += orders
             # _logger.info(f'current_orders: {self._current_orders}')
@@ -507,9 +519,9 @@ 

Source code for pyqstrat.strategy

             if position_filter is not None:
                 curr_pos = self.account.position(contract_group, self.timestamps[idx])
                 if position_filter == 'zero' and not math.isclose(curr_pos, 0): return []
-                if position_filter == 'nonzero' and math.isclose(curr_pos, 0): return []
-                if position_filter == 'positive' and (curr_pos < 0 or math.isclose(curr_pos, 0)): return []
-                if position_filter == 'negative' and (curr_pos > 0 or math.isclose(curr_pos, 0)): return []
+                elif position_filter == 'nonzero' and math.isclose(curr_pos, 0): return []
+                elif position_filter == 'positive' and (curr_pos < 0 or math.isclose(curr_pos, 0)): return []
+                elif position_filter == 'negative' and (curr_pos > 0 or math.isclose(curr_pos, 0)): return []
                 
             orders = rule_function(contract_group, idx, self.timestamps, indicator_values, signal_values, self.account,
                                    self._current_orders, self.strategy_context)
@@ -551,6 +563,13 @@ 

Source code for pyqstrat.strategy

                                              self.indicator_values, 
                                              self.signal_values, 
                                              self.strategy_context)
+                
+                if self.log_trades and len(trades) > 0:
+                    if len(trades) > 1:
+                        _logger.info('TRADES:' + ''.join([f'\n {trade}' for trade in trades]))
+                    else:
+                        _logger.info(f'TRADE: {trades[0]}')
+
                 if len(trades): self.account.add_trades(trades)
                 self._trades += trades
             except Exception as e:
diff --git a/docs/_modules/pyqstrat/strategy_builder.html b/docs/_modules/pyqstrat/strategy_builder.html
index d2aec62..c4ecc35 100644
--- a/docs/_modules/pyqstrat/strategy_builder.html
+++ b/docs/_modules/pyqstrat/strategy_builder.html
@@ -105,6 +105,8 @@ 

Source code for pyqstrat.strategy_builder

     signals: list[tuple[str, SignalType, Sequence[ContractGroup] | None, Sequence[str] | None, Sequence[str] | None]]
     rules: list[tuple[str, RuleType, str, Sequence[Any] | None, str | None]]
     market_sims: list[MarketSimulatorType]
+    log_trades: bool
+    log_orders: bool
     
 
[docs] @@ -121,7 +123,9 @@

Source code for pyqstrat.strategy_builder

         self.indicators = []
         self.signals = []
         self.rules = []
-        self.market_sims = []
+ self.market_sims = [] + self.log_trades = True + self.log_orders = False
@@ -155,6 +159,18 @@

Source code for pyqstrat.strategy_builder

         self.strategy_context = context
+
+[docs] + def set_log_trades(self, log_trades: bool) -> None: + self.log_trades = log_trades
+ + +
+[docs] + def set_log_orders(self, log_orders: bool) -> None: + self.log_orders = log_orders
+ +
[docs] def add_contract(self, symbol: str) -> Contract: @@ -266,7 +282,9 @@

Source code for pyqstrat.strategy_builder

                          self.starting_equity, 
                          self.pnl_calc_time, 
                          self.trade_lag, 
-                         True, 
+                         True,
+                         self.log_trades,
+                         self.log_orders,
                          self.strategy_context)
         
         assert_(self.rules is not None and len(self.rules) > 0, 'rules cannot be empty or None')
diff --git a/docs/_modules/pyqstrat/strategy_components.html b/docs/_modules/pyqstrat/strategy_components.html
index d89307d..a8282c6 100644
--- a/docs/_modules/pyqstrat/strategy_components.html
+++ b/docs/_modules/pyqstrat/strategy_components.html
@@ -115,15 +115,62 @@ 

Source code for pyqstrat.strategy_components

[docs]
 def get_contract_price_from_array_dict(price_dict: dict[str, tuple[np.ndarray, np.ndarray]], 
                                        contract: Contract, 
-                                       timestamp: np.datetime64) -> float:
+                                       timestamp: np.datetime64,
+                                       allow_previous: bool) -> float:
     tup: tuple[np.ndarray, np.ndarray] | None = price_dict.get(contract.symbol)
     assert_(tup is not None, f'{contract.symbol} not found in price_dict')
-    _timestamps: np.ndarray = tup[0]  # type: ignore
-    idx = np_indexof_sorted(_timestamps, timestamp)
+    _timestamps, _prices = tup  # type: ignore
+    idx: int
+    if allow_previous:
+        idx = int(np.searchsorted(_timestamps, timestamp, side='right')) - 1
+    else:
+        idx = np_indexof_sorted(_timestamps, timestamp)
     if idx == -1: return math.nan
-    return tup[1][idx]  # type: ignore
+# if idx >= len(_prices): +# import pdb +# pdb.set_trace() + return _prices[idx] # type: ignore
+ + + +
+[docs] +@dataclass +class PriceFuncArrays: + ''' + A function object with a signature of PriceFunctionType. Takes three ndarrays + of symbols, timestamps and prices + ''' + price_dict: dict[str, tuple[np.ndarray, np.ndarray]] + allow_previous: bool + +
+[docs] + def __init__(self, symbols: np.ndarray, timestamps: np.ndarray, prices: np.ndarray, allow_previous: bool = False) -> None: + assert_(len(timestamps) == len(symbols) and len(prices) == len(symbols), + f'arrays have different sizes: {len(timestamps)} {len(symbols)} {len(prices)}') + price_dict: dict[str, tuple[np.ndarray, np.ndarray]] = {} + for symbol in np.unique(symbols): + mask = (symbols == symbol) + price_dict[symbol] = (timestamps[mask], prices[mask]) + self.price_dict = price_dict + self.allow_previous = allow_previous
+ + +
+[docs] + def __call__(self, contract: Contract, timestamps: np.ndarray, i: int, context: StrategyContextType) -> float: + price: float = 0. + timestamp = timestamps[i] + if contract.is_basket(): + for _contract, ratio in contract.components: + price += get_contract_price_from_array_dict(self.price_dict, _contract, timestamp, self.allow_previous) * ratio + else: + price = get_contract_price_from_array_dict(self.price_dict, contract, timestamp, self.allow_previous) + return price
+
+ -
[docs] @@ -132,6 +179,11 @@

Source code for pyqstrat.strategy_components

    '''
     A function object with a signature of PriceFunctionType and takes a dictionary of 
         contract name -> tuple of sorted timestamps and prices
+    
+    Args:
+        price_dict: a dict with key=contract nane and value a tuple of timestamp and price arrays
+        allow_previous: if set and we don't find an exact match for the timestamp, use the 
+            previous timestamp. Useful if you have a dict with keys containing dates instead of timestamps
         
     >>> timestamps = np.arange(np.datetime64('2023-01-01'), np.datetime64('2023-01-04'))
     >>> price_dict = {'AAPL': (timestamps, [8, 9, 10]), 'IBM': (timestamps, [20, 21, 22])}
@@ -144,11 +196,13 @@ 

Source code for pyqstrat.strategy_components

    >>> assert(pricefunc(basket, timestamps, 1, None) == -12)
     '''
     price_dict: dict[str, tuple[np.ndarray, np.ndarray]]
+    allow_previous: bool
         
 
[docs] - def __init__(self, price_dict: dict[str, tuple[np.ndarray, np.ndarray]]) -> None: - self.price_dict = price_dict
+ def __init__(self, price_dict: dict[str, tuple[np.ndarray, np.ndarray]], allow_previous: bool = False) -> None: + self.price_dict = price_dict + self.allow_previous = allow_previous
@@ -158,9 +212,9 @@

Source code for pyqstrat.strategy_components

timestamp = timestamps[i]
         if contract.is_basket():
             for _contract, ratio in contract.components:
-                price += get_contract_price_from_array_dict(self.price_dict, _contract, timestamp) * ratio
+                price += get_contract_price_from_array_dict(self.price_dict, _contract, timestamp, self.allow_previous) * ratio
         else:
-            price = get_contract_price_from_array_dict(self.price_dict, contract, timestamp)
+            price = get_contract_price_from_array_dict(self.price_dict, contract, timestamp, self.allow_previous)
         return price
@@ -227,32 +281,38 @@

Source code for pyqstrat.strategy_components

    >>> timestamp = np.datetime64('2023-01-03 14:35')
     >>> price_func = PriceFuncDict({put_symbol: {timestamp: 4.8}, call_symbol: {timestamp: 3.5}})
     >>> order = MarketOrder(contract=basket, timestamp=timestamp, qty=10, reason_code='TEST')
-    >>> sim = SimpleMarketSimulator(price_func=price_func, slippage_per_trade=0)
+    >>> sim = SimpleMarketSimulator(price_func=price_func, slippage_pct=0)
     >>> out = sim([order], 0, np.array([timestamp]), {}, {}, SimpleNamespace())
     >>> assert(len(out) == 1)
     >>> assert(math.isclose(out[0].price, -1.3))
     >>> assert(out[0].qty == 10)    
     '''
     price_func: PriceFunctionType
-    slippage: float
+    slippage_pct: float
     commission: float
+    price_rounding: int
+    post_trade_func: Callable[[Trade, StrategyContextType], None] | None
         
 
[docs] def __init__(self, price_func: PriceFunctionType, - slippage_per_trade: float = 0., - commission_per_trade: float = 0) -> None: + slippage_pct: float = 0., + commission: float = 0, + price_rounding: int = 3, + post_trade_func: Callable[[Trade, StrategyContextType], None] | None = None) -> None: ''' Args: price_func: A function that we use to get the price to execute at - slippage_per_trade: Slippage in local currency. Meant to simulate the difference - between bid/ask mid and execution price - commission_per_trade: Fee paid to broker per trade + slippage_pct: Slippage per dollar transacted. + Meant to simulate the difference between bid/ask mid and execution price + commission: Fee paid to broker per trade ''' - self.price_func: PriceFunctionType = price_func - self.slippage: float = slippage_per_trade - self.commission: float = commission_per_trade
+ self.price_func = price_func + self.slippage_pct = slippage_pct + self.commission = commission + self.price_rounding = price_rounding + self.post_trade_func = post_trade_func
@@ -261,13 +321,12 @@

Source code for pyqstrat.strategy_components

orders: Sequence[Order],
                  i: int, 
                  timestamps: np.ndarray, 
-                 indicators: dict[ContractGroup, SimpleNamespace],
-                 signals: dict[ContractGroup, SimpleNamespace],
+                 indicators: dict[str, SimpleNamespace],
+                 signals: dict[str, SimpleNamespace],
                  strategy_context: SimpleNamespace) -> list[Trade]:
-        '''TODO: code for limit orders and stop orders'''
+        '''TODO: code for stop orders'''
         trades = []
         timestamp = timestamps[i]
-        # _logger.info(f'got: {orders}')
         for order in orders:
             if not isinstance(order, MarketOrder) and not isinstance(order, LimitOrder): continue
             contract = order.contract
@@ -280,9 +339,10 @@ 

Source code for pyqstrat.strategy_components

if np.isnan(raw_price):
                         break
             if np.isnan(raw_price): continue
-            slippage = self.slippage * order.qty
+            slippage = self.slippage_pct * raw_price
             if order.qty < 0: slippage = -slippage
             price = raw_price + slippage
+            price = round(price, self.price_rounding)
             if isinstance(order, LimitOrder) and np.isfinite(order.limit_price):
                 if ((abs(order.qty > 0) and order.limit_price > price) 
                         or (abs(order.qty < 0) and order.limit_price < price)):
@@ -290,9 +350,10 @@ 

Source code for pyqstrat.strategy_components

commission = self.commission * order.qty
             if order.qty < 0: commission = -commission
             trade = Trade(order.contract, order, timestamp, order.qty, price, self.commission)
-            _logger.info(f'TRADE: {timestamp.astype("M8[m]")} {trade}')
             order.fill()
             trades.append(trade)
+            if self.post_trade_func is not None:
+                self.post_trade_func(trade, strategy_context)
         return trades
@@ -309,6 +370,7 @@

Source code for pyqstrat.strategy_components

        reason_code: Reason for entering the order, used for display
         equity_percent: Percentage of equity used to size order
         long: Whether We want to go long or short
+        allocate_risk: If set, we divide the max risk by number of trades. Otherwise each trade will be alloated max risk 
         limit_increment: If not nan, we add or subtract this number from current market price (if selling or buying respectively)
             and create a limit order. If nan, we create market orders
         price_func: The function we use to get intraday prices
@@ -318,6 +380,7 @@ 

Source code for pyqstrat.strategy_components

price_func: PriceFunctionType
     equity_percent: float = 0.1  # use 10% of equity by default
     long: bool = True
+    allocate_risk: bool = False
     limit_increment: float = math.nan
         
 
@@ -343,7 +406,8 @@

Source code for pyqstrat.strategy_components

curr_equity = account.equity(timestamp)
             risk_amount = self.equity_percent * curr_equity
             order_qty = risk_amount / entry_price_est
-            order_qty /= len(contracts)  # divide up qty equally between all contracts
+            if self.allocate_risk:
+                order_qty /= len(contracts)  # divide up qty equally between all contracts
             if not self.long: order_qty *= -1
             order_qty = math.floor(order_qty) if order_qty > 0 else math.ceil(order_qty)
             if math.isclose(order_qty, 0.): return []
@@ -384,8 +448,8 @@ 

Source code for pyqstrat.strategy_components

        long: Whether we want to go long or short
         percent_of_equity: Order qty is calculated so that if the stop price is reached, we lose this amount
         stop_price_ind: Don't enter if estimated entry price is 
-            market price <= stop price + min_price_diff (for long orders) or the opposite for short orders
-        min_price_diff: See stop_price_ind
+            market price <= stop price + min_price_diff_pct * market_price (for long orders) or the opposite for short orders
+        min_price_diff_pct: See stop_price_ind
     '''
     reason_code: str
     vwap_minutes: int
@@ -393,7 +457,7 @@ 

Source code for pyqstrat.strategy_components

long: bool
     percent_of_equity: float
     stop_price_ind: str | None
-    min_price_diff: float
+    min_price_diff_pct: float
     single_entry_per_day: bool
         
 
@@ -405,7 +469,7 @@

Source code for pyqstrat.strategy_components

long: bool = True,
                  percent_of_equity: float = 0.1,
                  stop_price_ind: str | None = None,
-                 min_price_diff: float = 0,
+                 min_price_diff_pct: float = 0,
                  single_entry_per_day: bool = False) -> None:
         self.reason_code = reason_code
         self.price_func = price_func
@@ -413,7 +477,7 @@ 

Source code for pyqstrat.strategy_components

self.vwap_minutes = vwap_minutes
         self.percent_of_equity = percent_of_equity
         self.stop_price_ind = stop_price_ind
-        self.min_price_diff = min_price_diff
+        self.min_price_diff_pct = min_price_diff_pct
         self.single_entry_per_day = single_entry_per_day
@@ -446,8 +510,8 @@

Source code for pyqstrat.strategy_components

if self.stop_price_ind:
                 _stop_price_ind = getattr(indicator_values, self.stop_price_ind)
                 stop_price = _stop_price_ind[i]
-                if self.long and (entry_price_est - stop_price) < self.min_price_diff: return []
-                if not self.long and (stop_price - entry_price_est) < self.min_price_diff: return []
+                if self.long and (entry_price_est - stop_price) < self.min_price_diff_pct * entry_price_est: return []
+                if not self.long and (stop_price - entry_price_est) < self.min_price_diff_pct * entry_price_est: return []
             else:
                 stop_price = math.nan
 
@@ -606,11 +670,9 @@ 

Source code for pyqstrat.strategy_components

fill_fraction = (timestamp - order.timestamp) / (order.vwap_end_time - order.timestamp)
                 fill_fraction = min(fill_fraction, 1)
                 fill_qty = np.fix(order.qty * fill_fraction)
-                _logger.info(f'{timestamp} {order.timestamp} {order.vwap_end_time} {fill_fraction} qty: {fill_qty}')
             order.fill(fill_qty)
             order.cancel()
             trade = Trade(order.contract, order, timestamp, fill_qty, vwap)
-            _logger.info(f'Trade: {timestamp.astype("M8[m]")} {trade} {i}')
             trades.append(trade)
         return trades
@@ -618,7 +680,7 @@

Source code for pyqstrat.strategy_components

ContractFilterType = Callable[
-    [Contract, 
+    [ContractGroup, 
      int, 
      np.ndarray, 
      SimpleNamespace, 
@@ -626,13 +688,13 @@ 

Source code for pyqstrat.strategy_components

Account, 
      Sequence[Order],
      StrategyContextType],
-    list[str] | None]
+    list[str]]
 
 
-
-[docs] +
+[docs] @dataclass -class FiniteRiskEntryRule: +class BracketOrderEntryRule: ''' A rule that generates orders with stops @@ -644,45 +706,77 @@

Source code for pyqstrat.strategy_components

            Used to calculate order qty so that if we get stopped out, we don't lose 
             more than this amount. Of course if price gaps up or down rather than moving smoothly,
             we may lose more.
-        stop_price_ind: An indicator containing the stop price so we exit the order when this is breached
+        stop_return_func: A function that gives us the distance between entry price and stop price
+        min_stop_return: We will not enter if the stop_return is closer than this percent to the stop.
+            Otherwise, we get very large trade sizes
+        max_position_size: An order should not result in a position that is greater than this percent
+            of the portfolio
         contract_filter: A function that takes similar arguments as a rule (with ContractGroup) replaced by 
             Contract but returns a list of contract names for each positive signal timestamp. For example, 
             for a strategy that trades 5000 stocks, you may want to construct a single signal and apply it 
             to different contracts at different times, rather than create 5000 signals that will call your rule
             5000 times every time the signal is true.
+            
+    >>> timestamps = np.arange(np.datetime64('2023-01-01'), np.datetime64('2023-01-05'))
+    >>> sig_values = np.full(len(timestamps), False) 
+    >>> aapl_prices = np.array([100.1, 100.2, 100.3, 100.4])
+    >>> ibm_prices = np.array([200.1, 200.2, 200.3, 200.4])
+    >>> aapl_stops = np.array([-0.5, -0.3, -0.2, -0.01])
+    >>> ibm_stops=  np.array([-0.5, -0.3, -0.2, -0.15])
+    >>> price_dict = {'AAPL': (timestamps, aapl_prices), 'IBM': (timestamps, ibm_prices)}
+    >>> stop_dict = {'AAPL': (timestamps, aapl_stops), 'IBM': (timestamps, ibm_stops)}
+    >>> price_func = PriceFuncArrayDict(price_dict)
+    >>> fr = BracketOrderEntryRule('TEST_ENTRY', price_func, long=False)
+    >>> default_cg = ContractGroup.get('DEFAULT')
+    >>> default_cg.clear_cache()
+    >>> default_cg.add_contract(Contract.get_or_create('AAPL'))
+    >>> default_cg.add_contract(Contract.get_or_create('IBM'))
+    >>> account = SimpleNamespace()
+    >>> account.equity = lambda x: 1e6
+    >>> orders = fr(default_cg, 1, timestamps, SimpleNamespace(), sig_values, account, [], SimpleNamespace())
+    >>> assert len(orders) == 2 and orders[0].qty == -998 and orders[1].qty == -499
+    >>> stop_return_func = PriceFuncArrayDict(stop_dict)
+    >>> fr = BracketOrderEntryRule('TEST_ENTRY', price_func, long=True, stop_return_func=stop_return_func, min_stop_return=-0.1)
+    >>> orders = fr(default_cg, 2, timestamps, SimpleNamespace(), sig_values, account, [], SimpleNamespace())
+    >>> assert len(orders) == 2 and orders[0].qty == 4985 and orders[1].qty == 2496
+    >>> orders = fr(default_cg, 3, timestamps, SimpleNamespace(), sig_values, account, [], SimpleNamespace())
+    >>> assert len(orders) == 1 and orders[0].qty == 3326
     '''
     reason_code: str
     price_func: PriceFunctionType
     long: bool
     percent_of_equity: float
-    stop_price_ind: str | None
-    min_price_diff: float
+    min_stop_returnt: float
+    max_position_size: float
     single_entry_per_day: bool
     contract_filter: ContractFilterType | None
-        
-
-[docs] + stop_return_func: PriceFunctionType | None + +
+[docs] def __init__(self, reason_code: str, price_func: PriceFunctionType, long: bool = True, percent_of_equity: float = 0.1, - stop_price_ind: str | None = None, - min_price_diff: float = 0, + min_stop_return: float = 0, + max_position_size: float = 0, single_entry_per_day: bool = False, - contract_filter: ContractFilterType | None = None) -> None: + contract_filter: ContractFilterType | None = None, + stop_return_func: PriceFunctionType | None = None) -> None: self.reason_code = reason_code self.price_func = price_func self.long = long self.percent_of_equity = percent_of_equity - self.stop_price_ind = stop_price_ind - self.min_price_diff = min_price_diff + self.stop_return_func = stop_return_func + self.min_stop_return = min_stop_return + self.max_position_size = max_position_size self.single_entry_per_day = single_entry_per_day self.contract_filter = contract_filter
-
-[docs] +
+[docs] def __call__(self, contract_group: ContractGroup, i: int, @@ -693,37 +787,58 @@

Source code for pyqstrat.strategy_components

current_orders: Sequence[Order],
                  strategy_context: StrategyContextType) -> list[Order]:
         timestamp = timestamps[i]
-        if self.single_entry_per_day:
-            date = timestamp.astype('M8[D]')
-            trades = account.get_trades_for_date(contract_group.name, date)
-            if len(trades): return []
-
-        contracts = contract_group.get_contracts()
+        date = timestamp.astype('M8[D]')
+
+        contracts: list[Contract] = []
+        if self.contract_filter is not None:
+            names = self.contract_filter(
+                contract_group, i, timestamps, indicator_values, signal_values, account, current_orders, strategy_context)
+            for name in names:
+                _contract = Contract.get(name)
+                if _contract is None: continue
+                contracts.append(_contract)
+        else:
+            contracts = contract_group.get_contracts()
+            
         orders: list[Order] = []
         for contract in contracts:
-            if self.contract_filter is not None:
-                relevant_contracts = self.contract_filter(
-                    contract, i, timestamps, indicator_values, signal_values, account, current_orders, strategy_context)
-                if relevant_contracts is None or contract.symbol not in relevant_contracts: continue
-
+            if self.single_entry_per_day:
+                trades = account.get_trades_for_date(contract_group.name, date)
+                if len(trades): continue
+            
             entry_price_est = self.price_func(contract, timestamps, i, strategy_context)  # type: ignore
-            if math.isnan(entry_price_est): return []
-
-            if self.stop_price_ind:
-                _stop_price_ind = getattr(indicator_values, self.stop_price_ind)
-                stop_price = _stop_price_ind[i]
-            else:
-                stop_price = 0.
-
-            if self.long and (entry_price_est - stop_price) < self.min_price_diff: return []
-            if not self.long and (stop_price - entry_price_est) < self.min_price_diff: return []
+            if math.isnan(entry_price_est): continue
+
+            stop_price = 0.
+            if self.stop_return_func is not None:           
+                stop_return = self.stop_return_func(contract, timestamps, i, strategy_context)  # type: ignore
+                assert_(stop_return < 0, f'stop_return must be negative: {stop_return} {timestamp} {contract.symbol}')
+                if stop_return > self.min_stop_return:
+                    _logger.info(f'entry price estimate: {entry_price_est} too close to stop price: {stop_price}'
+                                 f' min stop return: {self.min_stop_return}')
+                    continue
+                if not self.long: stop_return = -stop_return
+                stop_price = entry_price_est * (1 + stop_return)
+                if ((self.long and entry_price_est <= stop_price) or (not self.long and entry_price_est >= stop_price)):
+                    _logger.info(f'entry price estimate: {entry_price_est} exceeds stop price: {stop_price}')
+                    continue                                 
 
             curr_equity = account.equity(timestamp)
             risk_amount = self.percent_of_equity * curr_equity
-            order_qty = risk_amount / (entry_price_est - stop_price)
-            order_qty /= len(contracts)  # divide up equity equally
-            order_qty = math.floor(order_qty) if order_qty > 0 else math.ceil(order_qty)
-            if math.isclose(order_qty, 0.): return []
+            order_qty = risk_amount / abs(entry_price_est - stop_price)
+            
+            if self.max_position_size > 0:
+                max_qty = abs(self.max_position_size * curr_equity / entry_price_est)
+                orig_qty = order_qty
+                if max_qty < abs(orig_qty):
+                    order_qty = max_qty * np.sign(orig_qty)
+                    _logger.info(f'max postion size exceeded: {contract} timestamp: {timestamp} max_qty: {max_qty}'
+                                 f' orig_qty: {orig_qty} new qty: {order_qty} max_qty: {max_qty} pos size: {self.max_position_size}'
+                                 f' curr_equity: {curr_equity} entry_price_est: {entry_price_est}')
+                
+            order_qty = math.floor(order_qty)
+            if not self.long: order_qty = -order_qty
+            if math.isclose(order_qty, 0.): continue
             order = MarketOrder(contract=contract,  # type: ignore
                                 timestamp=timestamp, 
                                 qty=order_qty,
@@ -746,7 +861,6 @@ 

Source code for pyqstrat.strategy_components

        price_func: the function this rule uses to get market prices
         limit_increment: if not nan, we add or subtract this number from current market price (if selling or buying respectively)
             and create a limit order
-        log_orders: if set, we use the python logger to log each order as it is generated
     '''
     reason_code: str
     price_func: PriceFunctionType
@@ -757,14 +871,11 @@ 

Source code for pyqstrat.strategy_components

def __init__(self, 
                  reason_code: str, 
                  price_func: PriceFunctionType,
-                 limit_increment: float = math.nan,
-                 log_orders: bool = True) -> None:
+                 limit_increment: float = math.nan) -> None:
         self.reason_code = reason_code
         self.price_func = price_func
-        assert_(math.isnan(limit_increment) or limit_increment >= 0, 
-                f'limit_increment: {limit_increment} cannot be negative')
-        self.limit_increment = limit_increment
-        self.log_orders = log_orders
+ assert_(math.isnan(limit_increment) or limit_increment >= 0, f'limit_increment: {limit_increment} cannot be negative') + self.limit_increment = limit_increment
@@ -780,7 +891,6 @@

Source code for pyqstrat.strategy_components

strategy_context: StrategyContextType) -> list[Order]:
         timestamp = timestamps[i]
         positions = account.positions(contract_group, timestamp)
-        # assert len(positions) == 1, f'expected 1 positions, got: {positions}'
         orders: list[Order] = []
         for (contract, qty) in positions:
             if math.isfinite(self.limit_increment):
@@ -794,7 +904,54 @@ 

Source code for pyqstrat.strategy_components

continue
             order = MarketOrder(contract=contract, timestamp=timestamp, qty=-qty, reason_code=self.reason_code)
             orders.append(order)
-        if self.log_orders: _logger.info(f'ORDER: {timestamp} {order}')
+        return orders
+
+ + + +
+[docs] +@dataclass +class StopReturnExitRule: + ''' + A rule that exits any given positions if a stop is hit. + You should set entry_price in the strategy context in the market simulator when you enter a position + ''' + reason_code: str + price_func: PriceFunctionType + stop_return_func: PriceFunctionType + +
+[docs] + def __call__(self, + contract_group: ContractGroup, + i: int, + timestamps: np.ndarray, + indicator_values: SimpleNamespace, + signal_values: np.ndarray, + account: Account, + current_orders: Sequence[Order], + context: StrategyContextType) -> list[Order]: + + timestamp = timestamps[i] + date = timestamp.astype('M8[D]') + entry_prices: dict[str, float] = context.entry_prices[date] + assert_(len(entry_prices) > 0, f'no symbols entered for: {date}') + positions = account.positions(contract_group, timestamp) + + orders: list[Order] = [] + for contract, qty in positions: + symbol = contract.symbol + stop_ret = self.stop_return_func(contract, timestamps, i, context) + assert_(stop_ret < 0, f'stop_return must be negative: {stop_ret} {timestamp} {symbol}') + entry_price = entry_prices[symbol] + if qty < 0: stop_ret = -stop_ret + stop_price = entry_price * (1 + stop_ret) + curr_price = self.price_func(contract, timestamps, i, context) + if math.isnan(curr_price): continue + if (qty > 0 and curr_price > stop_price) or (qty <= 0 and curr_price < stop_price): continue + order = MarketOrder(contract=contract, timestamp=timestamp, qty=-qty, reason_code=self.reason_code) + orders.append(order) return orders
diff --git a/docs/genindex.html b/docs/genindex.html index ee2facc..6a89136 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -70,17 +70,21 @@

_

  • (pyqstrat.strategy_builder.StrategyBuilder method)
  • -
  • (pyqstrat.strategy_components.ClosePositionExitRule method) +
  • (pyqstrat.strategy_components.BracketOrderEntryRule method)
  • -
  • (pyqstrat.strategy_components.FiniteRiskEntryRule method) +
  • (pyqstrat.strategy_components.ClosePositionExitRule method)
  • (pyqstrat.strategy_components.PercentOfEquityTradingRule method)
  • (pyqstrat.strategy_components.PriceFuncArrayDict method) +
  • +
  • (pyqstrat.strategy_components.PriceFuncArrays method)
  • (pyqstrat.strategy_components.PriceFuncDict method)
  • (pyqstrat.strategy_components.SimpleMarketSimulator method) +
  • +
  • (pyqstrat.strategy_components.StopReturnExitRule method)
  • (pyqstrat.strategy_components.VectorIndicator method)
  • @@ -124,17 +128,21 @@

    _

  • (pyqstrat.strategy_builder.StrategyBuilder method)
  • -
  • (pyqstrat.strategy_components.ClosePositionExitRule method) +
  • (pyqstrat.strategy_components.BracketOrderEntryRule method)
  • -
  • (pyqstrat.strategy_components.FiniteRiskEntryRule method) +
  • (pyqstrat.strategy_components.ClosePositionExitRule method)
  • (pyqstrat.strategy_components.PercentOfEquityTradingRule method)
  • (pyqstrat.strategy_components.PriceFuncArrayDict method) +
  • +
  • (pyqstrat.strategy_components.PriceFuncArrays method)
  • (pyqstrat.strategy_components.PriceFuncDict method)
  • (pyqstrat.strategy_components.SimpleMarketSimulator method) +
  • +
  • (pyqstrat.strategy_components.StopReturnExitRule method)
  • (pyqstrat.strategy_components.VectorIndicator method)
  • @@ -183,10 +191,10 @@

    A

  • (pyqstrat.strategy_builder.StrategyBuilder method)
  • - - + - + @@ -250,6 +268,8 @@

    C

  • CANCELLED (pyqstrat.pq_types.OrderStatus attribute)
  • cdf() (in module pyqstrat.pyqstrat_cpp) +
  • +
  • clear() (pyqstrat.pq_types.ContractGroup method)
  • clear_cache() (pyqstrat.pq_types.Contract static method) @@ -329,7 +349,7 @@

    C

  • (pyqstrat.pq_types.RoundTripTrade attribute)
  • -
  • contract_filter (pyqstrat.strategy_components.FiniteRiskEntryRule attribute) +
  • contract_filter (pyqstrat.strategy_components.BracketOrderEntryRule attribute)
  • contract_group (pyqstrat.pq_types.Contract attribute)
  • @@ -493,8 +513,6 @@

    F

      @@ -550,6 +570,8 @@

      G

    • get_main_logger() (in module pyqstrat.pq_utils)
    • get_next_symbol() (pyqstrat.markets.EminiFuture static method) +
    • +
    • get_or_create() (pyqstrat.pq_types.Contract static method)
    • get_paths() (in module pyqstrat.pq_utils)
    • @@ -590,6 +612,8 @@

      I

      - + + -
    • LimitOrder (class in pyqstrat.pq_types)
    • -
      -
    • pyqstrat.strategy_components module
        +
      • BracketOrderEntryRule +
      • ClosePositionExitRule
      • -
      • FiniteRiskEntryRule -
      • PercentOfEquityTradingRule
        • PercentOfEquityTradingRule.__call__()
        • PercentOfEquityTradingRule.__init__()
        • +
        • PercentOfEquityTradingRule.allocate_risk
        • PercentOfEquityTradingRule.equity_percent
        • PercentOfEquityTradingRule.limit_increment
        • PercentOfEquityTradingRule.long
        • @@ -466,9 +476,17 @@

          pyqstrat
        • PriceFuncArrayDict
        • +
        • PriceFuncArrays +
        • PriceFuncDict +
        • +
        • StopReturnExitRule
        • VWAPCloseRule
            @@ -494,7 +522,7 @@

            pyqstrat
          • VWAPEntryRule.__call__()
          • VWAPEntryRule.__init__()
          • VWAPEntryRule.long
          • -
          • VWAPEntryRule.min_price_diff
          • +
          • VWAPEntryRule.min_price_diff_pct
          • VWAPEntryRule.percent_of_equity
          • VWAPEntryRule.price_func
          • VWAPEntryRule.reason_code
          • diff --git a/docs/objects.inv b/docs/objects.inv index 8b557ee1296a95a1217c2116a9c4d4f9f3f699c2..3776458fb1a299adf5abedbfb03510dff37886bd 100644 GIT binary patch delta 3306 zcmVEXX8Oa)ue}CgP636fJDO|OC9o1%1d&$l5cv7zQWR$UYQ#qj^5|mH|0S*A# zRzCgW!Ivb;CK|1i_4@zt>TWbZkZ$%rjMda$HTz#`Rkng%{mZ?MAFg(`7XOGJfBfgw z#}C67v?x?7fvVN@s4fIG=IW;-@ms1DAzX4xNGP1yohsAxw0|s#`=Vq9N+_r(pxUw` z-AAO6B7>5r*6u}VHE%Mz!lCj2>_^M(9;)6l+m%l$rAbLGgQ6N`xaCUb>cKsMH6&(V zZE0K1{ri2QTThh1v4~_K*O+q3Do2e_fm}Jz7Ar1G7adFXN;b?nL~w?x zl|_IpN4U|mM1LwtB$bhu4ib!(Ty6uxD)KkeDji~(tH@-sS*B*sRJ7D8oj5-Yy4CHJ zu)vsSl*#kd9K+95POEv5Ln&0P<`u~b_mOm2;2Ta$)quF5PI>=6Dh*|R(oiV=ZKqFo*-+p)D0!q4bsi9^Y) zkJ(Y(Wcim-+H#o{CyWL4M#)Vh=pJE^cT|>wg>0?z2?xuWN*bXoLY+d|c94ZFBkYvm zrRxQnP0;3XEzf#PfE1jWBKZC{9xVT z7TEB6m}E9}G-Jjg=+aB1xp4*+v)9?V9I3K?k9`~?5Vf0f4HGOR zCZyD=Db-6#+J6G=7bShofS5|D47F>^3ol(JW=Ko{$_$uWhZjs*F8ZCeobEBfj(vhi z-BL@qZxLX;X43GmcuOOOx!W3u3D3W`_}Z=gi?nqDzk^H!;~&ZELna_GDfNj zJxfA8tQwbnNv<w`{x5;rLTN<4!P? z((U3h3|2}WJ*Q8w#xrt%n1L65Q-9jzlC(3WY>44oNtd71X?~D&1NWM6PD_zpS^Yb~ zrGnCH+>F-jK|;+MT0DWIuD?i*&($2Z7^14K*1 z*RgI@2u8JA>=!$hV35ZURX0lZljy=Ma}E< z;<%uWji}(h7>vvi(2=@#CcA@k9WX+2TxcL*4b>Ed&@fW6iaOuQBuQE`$Y|ZWRNa2l z<>DpWjB+LXOVVgwfa>rytbf8mm4J&@1(gL8$=%+GC$^N@+(@XnfEMnexeKBasLqSP zk@3Us;bJ$J86}5}7AWLL>yx#tQ8bp?HlrKdI+wXsiQjWCSRTezrEb88hoK?Keh{Ur zo9o|iZtw4JKWEmV1Cj5yfBg6M;W3~0MC`5U-IFLvwIzZsmciQ9uVF3fg$7P6&(Lx_dKMWo8Z=y%zaA4`xkVmfPedEw*PMmJJPdPq zJrQqoJq>ekCpSB0l7NBj!Kwznf;?2`t|E_UPQ2YRjm=}AS@6*f`knmJFB4KaX(C;H zzWyt-^wpPd|H(!C_ILwAK<2(^oyk|`dinqUyk3J$a}c`Jg?~1L$uc-Dq}@j-_!|fOIT9dY+?Y-jcej5N({4(x0f4YCx#OZFLitDqMGWWe0b*7+cJHs>`3uhs z2&t*-hO9O;y?@mLwAQtOz(!z44JpTS=!t6A=#p*PElkRry>l`N5?5}T^q2lL8*)St zqY9gHvH-Q-5XoLZBQCh~7e2x%%|?l&+ja*?&4qAvFkBXlutpU-2t-L`mE``+_1;y; zhd@V!3@PZz3!}Q}j?BWeAr^&|vjGxZ+v5%CPbkr^)z8lb$J6|yipURgJ#L!?%JDq-Q+y|rxvRl80v%ri*X zf&#zawSUQ({d|}YC!bOtozcG_Mbo4%4<^#pM$qEPdHPNXXRyP1IlU6ABI(G~R9XH6 z6@G#WnXnY7-O{>-YW=MvoR#D`X_YV~=$!&8?T&%l{LHoxY5I}JQMrn*WL%_GDU zw{S*Tg&V-K0Ac6bWFZnBFgL4DJk34N06wsA7M6>Eo>M<1<&Mte87dhRyv|KHH9so` zoSC2JB%PR_M%$5|lcm}?Sr zJbx#Sh6Yc4Z&Kki;hR{<#P}w#TYFxn6FNA4r9qSXS>&N{rCbbt7v1L&SiHj+jYSn| zJ4seBsbd_*qK=M*igk$=36CXCymt3K*e{aFu$Vw35A!S*&~F1BngWV@_1L^Qc@}#z zYIx+6VM9ZQ2U+?J-?V37FCYVR`*+Dh zx->q@20l_}$`DF!F9NRVE9oD*pL)(bp%i~Q!>Xp+AFvlGq`Um)uf4&8()*7*o7oRUz4z4G>RZ#wH{01G(*?-ox*Tzd=86X;HOwT(>P`0^_P=9^ezqJN$LL;rO7K o9y2ZHpqGYsSN_q`Zo&A$Fsh5)VOjCBD0qn9ul;ZT5AXZ)cNleUD*R|{fP*t5z>Y8I?&OV%oUs6>FF~KZCp>S&VlBDS|A%DpIf=~k`)R@;$Eoo5y z6;gs{Q1aB;eIQmdm1zox$^+1!9kU0hdPi+vK5C>!1X~J4DQTExQsnBvmMGOF=Fn~> z2g_lFUr6D8uI=XAb>gs|DZ{`*f`W#|oI{!%b%6@x%7MPvFhShxNa!QlQa2#NU}!o~ z2iSUq>phEv6n{uy5qaq#PBCF(7Z6sWUsTIrN@<`bOTT9M;L?@&SCAU6i zkG0AgUq))nMAkfEEXW#!8O8CTKqv39Ae@G5t?>y5%?TxnOIx5$A#FR#!qyS?k~8A0 z;vyLp1b=Ijn7}>JR~P-Km3iFrfaG-U1=O$u5rzRim;%UQAzTp2%$!&N=;zqNb+mh? z32Josy=+kH7EyaR*IO|}+eXV4Jy3erw|t%ZGGVD-!m)c73EW6Z^xji>bv1pl>2WK3 z_%%$jC%+1;HT6bQ?7nYv323KMc5|NKu9={2Nq^n29n@?SA>U#%RxNp)60vpj>(;N! zz$}-f-nmS}ITI~JG_;m}EF93G6mc&f5TO<`UWn)heSIgWF}b`i8ms+Z%V1ka zImcg?iOzrA9K$pH=UH~9Z+>-)Eswppg0_4jX{2uR8arZ2HFXZmZ0M~^FAK%S1ysyl7h`#$%KAO_sgFR^KI9t8X-G^E z(NYolkdpR4fewq3p=Ll#BV~r#wdH{kmx&n^Qvi|ybL;S$3d{Jg)0Sf%6a3gGh}bQ) zxchAZ7;C98EG*vAh#~gd)D=>%sxDhM27fd&Oa^G8AkK`XW9vdQuizs$gDzbS2UNq^e8QZ~e}oxtnw>ZqS6-NC&k+|!b1Pnv%x45^^> z8W+*j0VLE^;rb3Fb@h$+cpyrl5Y`%}%s>$^3ZeE2^B1rI_MoUq@82LBFA%MrzD{*j z%_-Jyv0v|LfvGQ36f(Zz9-qaQL{aDNkAZV4}+ z8MMXbE(g(e+%m-()mhC@TDs)OGMeWb)4~Ia_%b*ZWSj(Xh|=|J#DNSOQ6P*&W3L`t(7REMu&!3wGbTvXLq z)RZTiy%*0sAho%X&@c`y+<(oVZrTz+b>5s889(g-E_Tt+NHOk7Kp{UnpVwsdqOsU^ z8D?-xLh2HDzdc>kJdCSKtH6kxu_4LhAWEx?^KTcI*VmVyGV9QT(2vVM{&#tEo6q}v zRiakkH<#aX8JqJTw^!%a*MB2;oi@W9nbJ=|RJn`^T%s4drQI(ICx2|?P8wL8Sv(U- zn|UYd7Oc#hEhEE(?e@Sq0IOk?n>C?r$eLdwVl+Nb{(vA|@I!JAitwY*rLxjc1dLY` zMpGYg;hav8Tg}w1f0QY`F>`fR>T!Z{i(-9nfw*m%G5twS5u_YCtq2XASUy9`8PSW# zn9&r&WsTQU;v=(#dwrd_ ziaen?@oq<9|2wnv>ht&i<|4k_UVspg*cZJs`4DT6 z|M}PX2IQKf(4{U|Au321xR7?App0{?G)!k12kgNIS+)7&@_(_W<2?;J{;;alYJ=@Q zVO=>BrSEb_u`9++-ze#nA}Y61TK|Ii8W=dKQh ziJBs+WW9$#q>xq$=I?{7id{^3b5B}?s7FM!^qB5on+$1v23{N5j-4emIo0bbrmg)GdT zHP*#th}7zj1U4PJA8n_gYG?G?+=GN2XyW%{Q9KFF$@nSRCU_lYif*WxL` zU+Ed|hvs48Ljf)|Zu2<)l4%|x-Y|tTNE04-%6|fc?Q4^TNO+;zqCWBV@-hSXg1$vq zE&_Tl`za~6cV_Pl$)J=oZo)0`MKR!x_%bKyhWIif@qYMI2+WvnCCqrgj|-U02l-fy z|4g`qx&1jz@)OA`fUwx{ED&-#GzmK0i!O!+hrSo7@JRR~77`d=1omssw=qHwFJEa; zaDRUmdF)&%C%Uhqha935?|6@lfk^uwQthF+nd#9%EN2poxd) z$95>|B& za_FahR*F4#ncs|l8*))IANfKm^!Q0JNPn6+5vmJ+^0Mh)n|=An?2m5s>wZ@A;ECr7 zGB5*ul^pN+goCx=9Rcv3dZvtN`h62T>=A|~{^#(9%pc6$UHZF!nNG4mE8-%{+x~0{T-uf20SGBCnNEYTzuv-*nhi{*azi)PLXd zrFwWtXz60CRDC})K{5;2#4i2bT!s$4jV~k3oCThT7MToQ#OKcmFW{rsqkbH`ndu8h zsFw=LpNU?e7aPkjlu>R-hbKioyUL#XqxMg1^?L)>!OFP)61ITLKgAA#q_(BZTFRp3 zjalA~Wlb1g7a5;YcAq<*@c*!^=6@A2>2u_K(=L-i50CVEo{7%3nR#r!xVx3cVHFZoZkXsxBi>_~u z(WO^5C-hR&$T7C8_rK{n=A?j^OMd5gOZnOR4`;)-;qT6_{Kt3GpAlL6 zKbrl;`R3}(ecSmh5gf{Df=}6EY42J|779^^_rotDVOM-WXVqNc#%ZlGc!A<=A#{cdA0Y9G6z6#hqjsO4v diff --git a/docs/pyqstrat.html b/docs/pyqstrat.html index a017e88..d676b5c 100644 --- a/docs/pyqstrat.html +++ b/docs/pyqstrat.html @@ -223,6 +223,16 @@

            Submodules +
            +pyqstrat.pq_utils.in_debug()[source]¶
            +
            +
            Return type:
            +

            bool

            +
            +
            +
            +
            pyqstrat.pq_utils.in_ipython()[source]¶
            @@ -838,6 +848,16 @@

            Submodules +
            +static get_or_create(symbol, contract_group=None, expiry=None, multiplier=1.0, components=None, properties=None)[source]¶
            +
            +
            Return type:
            +

            Contract

            +
            +
            +

            +
            is_basket()[source]¶
            @@ -876,6 +896,17 @@

            Submodulesadd_contract(contract)[source]¶

            +
            +
            +clear()[source]¶
            +

            Remove all contracts

            +
            +
            Return type:
            +

            None

            +
            +
            +
            +
            static clear_cache()[source]¶
            @@ -938,6 +969,16 @@

            Submodules +
            +static get_default()[source]¶
            +
            +
            Return type:
            +

            ContractGroup

            +
            +
            +

            +
            name: str¶
            @@ -2019,11 +2060,11 @@

            Submodules

            pyqstrat.strategy module¶

            -class pyqstrat.strategy.Strategy(timestamps, contract_groups, price_function, starting_equity=1000000.0, pnl_calc_time=961, trade_lag=0, run_final_calc=True, strategy_context=None)[source]¶
            +class pyqstrat.strategy.Strategy(timestamps, contract_groups, price_function, starting_equity=1000000.0, pnl_calc_time=961, trade_lag=0, run_final_calc=True, log_trades=True, log_orders=False, strategy_context=None)[source]¶

            Bases: object

            -__init__(timestamps, contract_groups, price_function, starting_equity=1000000.0, pnl_calc_time=961, trade_lag=0, run_final_calc=True, strategy_context=None)[source]¶
            +__init__(timestamps, contract_groups, price_function, starting_equity=1000000.0, pnl_calc_time=961, trade_lag=0, run_final_calc=True, log_trades=True, log_orders=False, strategy_context=None)[source]¶
            Parameters:
            @@ -3192,7 +3235,7 @@

            Submodules
            -pyqstrat.evaluator.plot_return_metrics(metrics, title='', height=1000, width=0, show_points=True, show=True)[source]¶
            +pyqstrat.evaluator.plot_return_metrics(metrics, title='', height=1000, width=0, show_points=False, show=True)[source]¶

            Plot equity, rolling drawdowns and and a boxplot of annual returns given the output of compute_return_metrics.

            Parameters:
            @@ -3792,6 +3835,16 @@

            Submodulesindicators: list[tuple[str, Callable[[ContractGroup, ndarray, SimpleNamespace, SimpleNamespace], ndarray], Optional[Sequence[ContractGroup]], Optional[Sequence[str]]]]¶

            +
            +
            +log_orders: bool¶
            +
            + +
            +
            +log_trades: bool¶
            +
            +
            market_sims: list[Callable[[Sequence[Order], int, ndarray, dict[str, SimpleNamespace], dict[str, SimpleNamespace], SimpleNamespace], list[Trade]]]¶
            @@ -3812,6 +3865,26 @@

            Submodulesrules: list[tuple[str, Callable[[ContractGroup, int, ndarray, SimpleNamespace, ndarray, Account, Sequence[Order], SimpleNamespace], list[Order]], str, Optional[Sequence[Any]], Optional[str]]]¶

            +
            +
            +set_log_orders(log_orders)[source]¶
            +
            +
            Return type:
            +

            None

            +
            +
            +
            + +
            +
            +set_log_trades(log_trades)[source]¶
            +
            +
            Return type:
            +

            None

            +
            +
            +
            +
            set_pnl_calc_time(pnl_calc_time)[source]¶
            @@ -3908,24 +3981,62 @@

            Submodules

            pyqstrat.strategy_components module¶

            -
            -class pyqstrat.strategy_components.ClosePositionExitRule(reason_code, price_func, limit_increment=nan, log_orders=True)[source]¶
            +
            +class pyqstrat.strategy_components.BracketOrderEntryRule(reason_code, price_func, long=True, percent_of_equity=0.1, min_stop_return=0, max_position_size=0, single_entry_per_day=False, contract_filter=None, stop_return_func=None)[source]¶

            Bases: object

            -

            A rule to close out an open position

            +

            A rule that generates orders with stops

            Parameters:
              -
            • reason_code (str) – the reason for closing out used for display purposes

            • -
            • price_func (Callable[[Contract, ndarray, int, SimpleNamespace], float]) – the function this rule uses to get market prices

            • -
            • limit_increment (float) – if not nan, we add or subtract this number from current market price (if selling or buying respectively) -and create a limit order

            • -
            • log_orders (bool) – if set, we use the python logger to log each order as it is generated

            • +
            • reason_code (str) – Reason for the orders created used for display

            • +
            • price_func (Callable[[Contract, ndarray, int, SimpleNamespace], float]) – A function that returns price given a contract and timestamp

            • +
            • long (bool) – whether we want to go long or short

            • +
            • percent_of_equity (float) – How much to risk per trade as a percentage of current equity. +Used to calculate order qty so that if we get stopped out, we don’t lose +more than this amount. Of course if price gaps up or down rather than moving smoothly, +we may lose more.

            • +
            • stop_return_func (Optional[Callable[[Contract, ndarray, int, SimpleNamespace], float]]) – A function that gives us the distance between entry price and stop price

            • +
            • min_stop_return (float) – We will not enter if the stop_return is closer than this percent to the stop. +Otherwise, we get very large trade sizes

            • +
            • max_position_size (float) – An order should not result in a position that is greater than this percent +of the portfolio

            • +
            • contract_filter (Optional[Callable[[ContractGroup, int, ndarray, SimpleNamespace, ndarray, Account, Sequence[Order], SimpleNamespace], list[str]]]) – A function that takes similar arguments as a rule (with ContractGroup) replaced by +Contract but returns a list of contract names for each positive signal timestamp. For example, +for a strategy that trades 5000 stocks, you may want to construct a single signal and apply it +to different contracts at different times, rather than create 5000 signals that will call your rule +5000 times every time the signal is true.

            +
            >>> timestamps = np.arange(np.datetime64('2023-01-01'), np.datetime64('2023-01-05'))
            +>>> sig_values = np.full(len(timestamps), False)
            +>>> aapl_prices = np.array([100.1, 100.2, 100.3, 100.4])
            +>>> ibm_prices = np.array([200.1, 200.2, 200.3, 200.4])
            +>>> aapl_stops = np.array([-0.5, -0.3, -0.2, -0.01])
            +>>> ibm_stops=  np.array([-0.5, -0.3, -0.2, -0.15])
            +>>> price_dict = {'AAPL': (timestamps, aapl_prices), 'IBM': (timestamps, ibm_prices)}
            +>>> stop_dict = {'AAPL': (timestamps, aapl_stops), 'IBM': (timestamps, ibm_stops)}
            +>>> price_func = PriceFuncArrayDict(price_dict)
            +>>> fr = BracketOrderEntryRule('TEST_ENTRY', price_func, long=False)
            +>>> default_cg = ContractGroup.get('DEFAULT')
            +>>> default_cg.clear_cache()
            +>>> default_cg.add_contract(Contract.get_or_create('AAPL'))
            +>>> default_cg.add_contract(Contract.get_or_create('IBM'))
            +>>> account = SimpleNamespace()
            +>>> account.equity = lambda x: 1e6
            +>>> orders = fr(default_cg, 1, timestamps, SimpleNamespace(), sig_values, account, [], SimpleNamespace())
            +>>> assert len(orders) == 2 and orders[0].qty == -998 and orders[1].qty == -499
            +>>> stop_return_func = PriceFuncArrayDict(stop_dict)
            +>>> fr = BracketOrderEntryRule('TEST_ENTRY', price_func, long=True, stop_return_func=stop_return_func, min_stop_return=-0.1)
            +>>> orders = fr(default_cg, 2, timestamps, SimpleNamespace(), sig_values, account, [], SimpleNamespace())
            +>>> assert len(orders) == 2 and orders[0].qty == 4985 and orders[1].qty == 2496
            +>>> orders = fr(default_cg, 3, timestamps, SimpleNamespace(), sig_values, account, [], SimpleNamespace())
            +>>> assert len(orders) == 1 and orders[0].qty == 3326
            +
            +
            -
            -__call__(contract_group, i, timestamps, indicator_values, signal_values, account, current_orders, strategy_context)[source]¶
            +
            +__call__(contract_group, i, timestamps, indicator_values, signal_values, account, current_orders, strategy_context)[source]¶

            Call self as a function.

            Return type:
            @@ -3935,54 +4046,75 @@

            Submodules -
            -__init__(reason_code, price_func, limit_increment=nan, log_orders=True)[source]¶
            +
            +__init__(reason_code, price_func, long=True, percent_of_equity=0.1, min_stop_return=0, max_position_size=0, single_entry_per_day=False, contract_filter=None, stop_return_func=None)[source]¶

            -
            -limit_increment: float¶
            +
            +contract_filter: Optional[Callable[[ContractGroup, int, ndarray, SimpleNamespace, ndarray, Account, Sequence[Order], SimpleNamespace], list[str]]]¶
            -
            -price_func: Callable[[Contract, ndarray, int, SimpleNamespace], float]¶
            +
            +long: bool¶
            -
            -reason_code: str¶
            +
            +max_position_size: float¶
            +
            + +
            +
            +min_stop_returnt: float¶
            +
            + +
            +
            +percent_of_equity: float¶
            +
            + +
            +
            +price_func: Callable[[Contract, ndarray, int, SimpleNamespace], float]¶
            +
            + +
            +
            +reason_code: str¶
            +
            + +
            +
            +single_entry_per_day: bool¶
            +
            + +
            +
            +stop_return_func: Optional[Callable[[Contract, ndarray, int, SimpleNamespace], float]]¶
            -
            -class pyqstrat.strategy_components.FiniteRiskEntryRule(reason_code, price_func, long=True, percent_of_equity=0.1, stop_price_ind=None, min_price_diff=0, single_entry_per_day=False, contract_filter=None)[source]¶
            +
            +class pyqstrat.strategy_components.ClosePositionExitRule(reason_code, price_func, limit_increment=nan)[source]¶

            Bases: object

            -

            A rule that generates orders with stops

            +

            A rule to close out an open position

            Parameters:
              -
            • reason_code (str) – Reason for the orders created used for display

            • -
            • price_func (Callable[[Contract, ndarray, int, SimpleNamespace], float]) – A function that returns price given a contract and timestamp

            • -
            • long (bool) – whether we want to go long or short

            • -
            • percent_of_equity (float) – How much to risk per trade as a percentage of current equity. -Used to calculate order qty so that if we get stopped out, we don’t lose -more than this amount. Of course if price gaps up or down rather than moving smoothly, -we may lose more.

            • -
            • stop_price_ind (Optional[str]) – An indicator containing the stop price so we exit the order when this is breached

            • -
            • contract_filter (Optional[Callable[[Contract, int, ndarray, SimpleNamespace, ndarray, Account, Sequence[Order], SimpleNamespace], Optional[list[str]]]]) – A function that takes similar arguments as a rule (with ContractGroup) replaced by -Contract but returns a list of contract names for each positive signal timestamp. For example, -for a strategy that trades 5000 stocks, you may want to construct a single signal and apply it -to different contracts at different times, rather than create 5000 signals that will call your rule -5000 times every time the signal is true.

            • +
            • reason_code (str) – the reason for closing out used for display purposes

            • +
            • price_func (Callable[[Contract, ndarray, int, SimpleNamespace], float]) – the function this rule uses to get market prices

            • +
            • limit_increment (float) – if not nan, we add or subtract this number from current market price (if selling or buying respectively) +and create a limit order

            -
            -__call__(contract_group, i, timestamps, indicator_values, signal_values, account, current_orders, strategy_context)[source]¶
            +
            +__call__(contract_group, i, timestamps, indicator_values, signal_values, account, current_orders, strategy_context)[source]¶

            Call self as a function.

            Return type:
            @@ -3992,55 +4124,30 @@

            Submodules -
            -__init__(reason_code, price_func, long=True, percent_of_equity=0.1, stop_price_ind=None, min_price_diff=0, single_entry_per_day=False, contract_filter=None)[source]¶
            -

            - -
            -
            -contract_filter: Optional[Callable[[Contract, int, ndarray, SimpleNamespace, ndarray, Account, Sequence[Order], SimpleNamespace], Optional[list[str]]]]¶
            -
            - -
            -
            -long: bool¶
            -
            - -
            -
            -min_price_diff: float¶
            -
            - -
            -
            -percent_of_equity: float¶
            -
            - -
            -
            -price_func: Callable[[Contract, ndarray, int, SimpleNamespace], float]¶
            +
            +__init__(reason_code, price_func, limit_increment=nan)[source]¶
            -
            -reason_code: str¶
            +
            +limit_increment: float¶
            -
            -single_entry_per_day: bool¶
            +
            +price_func: Callable[[Contract, ndarray, int, SimpleNamespace], float]¶
            -
            -stop_price_ind: Optional[str]¶
            +
            +reason_code: str¶
            -class pyqstrat.strategy_components.PercentOfEquityTradingRule(reason_code, price_func, equity_percent=0.1, long=True, limit_increment=nan)[source]¶
            +class pyqstrat.strategy_components.PercentOfEquityTradingRule(reason_code, price_func, equity_percent=0.1, long=True, allocate_risk=False, limit_increment=nan)[source]¶

            Bases: object

            A rule that trades a percentage of equity.

            @@ -4049,6 +4156,7 @@

            Submodulesstr) – Reason for entering the order, used for display

          • equity_percent (float) – Percentage of equity used to size order

          • long (bool) – Whether We want to go long or short

          • +
          • allocate_risk (bool) – If set, we divide the max risk by number of trades. Otherwise each trade will be alloated max risk

          • limit_increment (float) – If not nan, we add or subtract this number from current market price (if selling or buying respectively) and create a limit order. If nan, we create market orders

          • price_func (Callable[[Contract, ndarray, int, SimpleNamespace], float]) – The function we use to get intraday prices

          • @@ -4068,7 +4176,12 @@

            Submodules
            -__init__(reason_code, price_func, equity_percent=0.1, long=True, limit_increment=nan)¶
            +__init__(reason_code, price_func, equity_percent=0.1, long=True, allocate_risk=False, limit_increment=nan)¶ +

            + +
            +
            +allocate_risk: bool = False¶
            @@ -4100,12 +4213,21 @@

            Submodules
            -class pyqstrat.strategy_components.PriceFuncArrayDict(price_dict)[source]¶
            +class pyqstrat.strategy_components.PriceFuncArrayDict(price_dict, allow_previous=False)[source]¶

            Bases: object

            A function object with a signature of PriceFunctionType and takes a dictionary of

            contract name -> tuple of sorted timestamps and prices

            +
            +
            Parameters:
            +
              +
            • price_dict (dict[str, tuple[ndarray, ndarray]]) – a dict with key=contract nane and value a tuple of timestamp and price arrays

            • +
            • allow_previous (bool) – if set and we don’t find an exact match for the timestamp, use the +previous timestamp. Useful if you have a dict with keys containing dates instead of timestamps

            • +
            +
            +
            >>> timestamps = np.arange(np.datetime64('2023-01-01'), np.datetime64('2023-01-04'))
             >>> price_dict = {'AAPL': (timestamps, [8, 9, 10]), 'IBM': (timestamps, [20, 21, 22])}
             >>> pricefunc = PriceFuncArrayDict(price_dict)
            @@ -4130,7 +4252,12 @@ 

            Submodules
            -__init__(price_dict)[source]¶
            +__init__(price_dict, allow_previous=False)[source]¶ +

            + +
            +
            +allow_previous: bool¶
            @@ -4140,6 +4267,40 @@

            Submodules +
            +class pyqstrat.strategy_components.PriceFuncArrays(symbols, timestamps, prices, allow_previous=False)[source]¶
            +

            Bases: object

            +

            A function object with a signature of PriceFunctionType. Takes three ndarrays +of symbols, timestamps and prices

            +
            +
            +__call__(contract, timestamps, i, context)[source]¶
            +

            Call self as a function.

            +
            +
            Return type:
            +

            float

            +
            +
            +
            + +
            +
            +__init__(symbols, timestamps, prices, allow_previous=False)[source]¶
            +
            + +
            +
            +allow_previous: bool¶
            +
            + +
            +
            +price_dict: dict[str, tuple[ndarray, ndarray]]¶
            +
            + +

            +
            class pyqstrat.strategy_components.PriceFuncDict(price_dict)[source]¶
            @@ -4184,7 +4345,7 @@

            Submodules
            -class pyqstrat.strategy_components.SimpleMarketSimulator(price_func, slippage_per_trade=0.0, commission_per_trade=0)[source]¶
            +class pyqstrat.strategy_components.SimpleMarketSimulator(price_func, slippage_pct=0.0, commission=0, price_rounding=3, post_trade_func=None)[source]¶

            Bases: object

            A function object with a signature of MarketSimulatorType. It can take into account slippage and commission @@ -4198,7 +4359,7 @@

            Submodules
            __call__(orders, i, timestamps, indicators, signals, strategy_context)[source]¶
            -

            TODO: code for limit orders and stop orders

            +

            TODO: code for stop orders

            Return type:

            list[Trade]

            @@ -4216,14 +4377,14 @@

            Submodules
            -__init__(price_func, slippage_per_trade=0.0, commission_per_trade=0)[source]¶
            +__init__(price_func, slippage_pct=0.0, commission=0, price_rounding=3, post_trade_func=None)[source]¶
            Parameters:
            • price_func (Callable[[Contract, ndarray, int, SimpleNamespace], float]) – A function that we use to get the price to execute at

            • -
            • slippage_per_trade (float) – Slippage in local currency. Meant to simulate the difference

            • -
            • price (between bid/ask mid and execution) –

            • -
            • commission_per_trade (float) – Fee paid to broker per trade

            • +
            • slippage_pct (float) – Slippage per dollar transacted. +Meant to simulate the difference between bid/ask mid and execution price

            • +
            • commission (float) – Fee paid to broker per trade

            @@ -4234,14 +4395,63 @@

            Submodulescommission: float¶

            +
            +
            +post_trade_func: Optional[Callable[[Trade, SimpleNamespace], None]]¶
            +
            +
            price_func: Callable[[Contract, ndarray, int, SimpleNamespace], float]¶
            -
            -slippage: float¶
            +
            +price_rounding: int¶
            +
            + +
            +
            +slippage_pct: float¶
            +
            + +

            + +
            +
            +class pyqstrat.strategy_components.StopReturnExitRule(reason_code, price_func, stop_return_func)[source]¶
            +

            Bases: object

            +

            A rule that exits any given positions if a stop is hit. +You should set entry_price in the strategy context in the market simulator when you enter a position

            +
            +
            +__call__(contract_group, i, timestamps, indicator_values, signal_values, account, current_orders, context)[source]¶
            +

            Call self as a function.

            +
            +
            Return type:
            +

            list[Order]

            +
            +
            +
            + +
            +
            +__init__(reason_code, price_func, stop_return_func)¶
            +
            + +
            +
            +price_func: Callable[[Contract, ndarray, int, SimpleNamespace], float]¶
            +
            + +
            +
            +reason_code: str¶
            +
            + +
            +
            +stop_return_func: Callable[[Contract, ndarray, int, SimpleNamespace], float]¶
            @@ -4285,7 +4495,7 @@

            Submodules
            -class pyqstrat.strategy_components.VWAPEntryRule(reason_code, vwap_minutes, price_func, long=True, percent_of_equity=0.1, stop_price_ind=None, min_price_diff=0, single_entry_per_day=False)[source]¶
            +class pyqstrat.strategy_components.VWAPEntryRule(reason_code, vwap_minutes, price_func, long=True, percent_of_equity=0.1, stop_price_ind=None, min_price_diff_pct=0, single_entry_per_day=False)[source]¶

            Bases: object

            A rule that generates VWAP orders

            @@ -4298,8 +4508,8 @@

            Submodulesbool) – Whether we want to go long or short

          • percent_of_equity (float) – Order qty is calculated so that if the stop price is reached, we lose this amount

          • stop_price_ind (Optional[str]) – Don’t enter if estimated entry price is -market price <= stop price + min_price_diff (for long orders) or the opposite for short orders

          • -
          • min_price_diff (float) – See stop_price_ind

          • +market price <= stop price + min_price_diff_pct * market_price (for long orders) or the opposite for short orders

            +
          • min_price_diff_pct (float) – See stop_price_ind

          @@ -4316,7 +4526,7 @@

          Submodules
          -__init__(reason_code, vwap_minutes, price_func, long=True, percent_of_equity=0.1, stop_price_ind=None, min_price_diff=0, single_entry_per_day=False)[source]¶
          +__init__(reason_code, vwap_minutes, price_func, long=True, percent_of_equity=0.1, stop_price_ind=None, min_price_diff_pct=0, single_entry_per_day=False)[source]¶
          @@ -4325,8 +4535,8 @@

          Submodules -
          -min_price_diff: float¶
          +
          +min_price_diff_pct: float¶

          @@ -4475,7 +4685,7 @@

          Submodules
          -pyqstrat.strategy_components.get_contract_price_from_array_dict(price_dict, contract, timestamp)[source]¶
          +pyqstrat.strategy_components.get_contract_price_from_array_dict(price_dict, contract, timestamp, allow_previous)[source]¶
          Return type:

          float

          diff --git a/docs/searchindex.js b/docs/searchindex.js index 7b4dd9d..f7e1809 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["index", "modules", "pyqstrat"], "filenames": ["index.rst", "modules.rst", "pyqstrat.rst"], "titles": ["API documentation for pyqstrat", "pyqstrat", "pyqstrat package"], "terms": {"pleas": 0, "read": [0, 2], "readm": 0, "rst": 0, "main": [0, 2], "directori": [0, 2], "get": [0, 1, 2], "start": [0, 2], "packag": [0, 1], "index": [0, 2], "modul": [0, 1], "search": 0, "page": 0, "submodul": 1, "pq_util": 1, "pqexcept": [1, 2], "path": [1, 2], "creat": [1, 2], "assert_": [1, 2], "bootstrap_ci": [1, 2], "day_of_week_num": [1, 2], "day_symbol": [1, 2], "find_in_subdir": [1, 2], "get_child_logg": [1, 2], "get_config": [1, 2], "get_empty_np_valu": [1, 2], "get_main_logg": [1, 2], "get_path": [1, 2], "get_temp_dir": [1, 2], "has_displai": [1, 2], "in_ipython": [1, 2], "infer_compress": [1, 2], "infer_frequ": [1, 2], "is_new": [1, 2], "linear_interpol": [1, 2], "millis_since_epoch": [1, 2], "monotonically_increas": [1, 2], "nan_to_zero": [1, 2], "np_bucket": [1, 2], "np_find_closest": [1, 2], "np_inc_dat": [1, 2], "np_indexof": [1, 2], "np_indexof_sort": [1, 2], "np_parse_arrai": [1, 2], "np_rolling_window": [1, 2], "np_round": [1, 2], "np_uniqu": [1, 2], "percentile_of_scor": [1, 2], "remove_dup": [1, 2], "resample_trade_bar": [1, 2], "resample_t": [1, 2], "resample_vwap": [1, 2], "series_to_arrai": [1, 2], "set_default": [1, 2], "set_ipython_default": [1, 2], "shift_np": [1, 2], "str2date": [1, 2], "strtup2dat": [1, 2], "to_csv": [1, 2], "touch": [1, 2], "try_frequ": [1, 2], "zero_to_nan": [1, 2], "pq_type": 1, "contract": [1, 2], "clear_cach": [1, 2], "compon": [1, 2], "contract_group": [1, 2], "exist": [1, 2], "expiri": [1, 2], "is_basket": [1, 2], "multipli": [1, 2], "properti": [1, 2], "symbol": [1, 2], "contractgroup": [1, 2], "add_contract": [1, 2], "get_contract": [1, 2], "name": [1, 2], "limitord": [1, 2], "limit_pric": [1, 2], "marketord": [1, 2], "order": [1, 2], "cancel": [1, 2], "fill": [1, 2], "is_open": [1, 2], "qty": [1, 2], "reason_cod": [1, 2], "request_cancel": [1, 2], "statu": [1, 2], "time_in_forc": [1, 2], "timestamp": [1, 2], "orderstatu": [1, 2], "cancel_request": [1, 2], "open": [1, 2], "partially_fil": [1, 2], "price": [1, 2], "ask": [1, 2], "ask_siz": [1, 2], "bid": [1, 2], "bid_siz": [1, 2], "invalid": [1, 2], "mid": [1, 2], "set_properti": [1, 2], "spread": [1, 2], "valid": [1, 2], "vw_mid": [1, 2], "rollord": [1, 2], "close_qti": [1, 2], "reopen_qti": [1, 2], "roundtriptrad": [1, 2], "entry_commiss": [1, 2], "entry_ord": [1, 2], "entry_pric": [1, 2], "entry_properti": [1, 2], "entry_reason": [1, 2], "entry_timestamp": [1, 2], "exit_commiss": [1, 2], "exit_ord": [1, 2], "exit_pric": [1, 2], "exit_properti": [1, 2], "exit_reason": [1, 2], "exit_timestamp": [1, 2], "net_pnl": [1, 2], "stoplimitord": [1, 2], "trigger_pric": [1, 2], "trigger": [1, 2], "timeinforc": [1, 2], "dai": [1, 2], "fok": [1, 2], "gtc": [1, 2], "trade": [1, 2], "__init__": [1, 2], "vwapord": [1, 2], "vwap_end_tim": [1, 2], "vwap_stop": [1, 2], "pq_io": 1, "df_to_hdf5": [1, 2], "hdf5_copi": [1, 2], "hdf5_repack": [1, 2], "hdf5_to_df": [1, 2], "hdf5_to_np_arrai": [1, 2], "np_arrays_to_hdf5": [1, 2], "test_hdf5_to_df": [1, 2], "holiday_calendar": 1, "calendar": [1, 2], "add_trading_dai": [1, 2], "get_trading_dai": [1, 2], "is_trading_dai": [1, 2], "num_trading_dai": [1, 2], "third_friday_of_month": [1, 2], "get_date_from_weekdai": [1, 2], "account": 1, "add_trad": [1, 2], "calc": [1, 2], "df_account_pnl": [1, 2], "df_pnl": [1, 2], "df_roundtrip_trad": [1, 2], "df_trade": [1, 2], "equiti": [1, 2], "get_trades_for_d": [1, 2], "posit": [1, 2], "roundtrip_trad": [1, 2], "contractpnl": [1, 2], "calc_net_pnl": [1, 2], "df": [1, 2], "pnl": [1, 2], "find_index_befor": [1, 2], "find_last_non_nan_index": [1, 2], "leading_nan_to_zero": [1, 2], "test_account": [1, 2], "strategi": 1, "add_ind": [1, 2], "add_market_sim": [1, 2], "add_rul": [1, 2], "add_sign": [1, 2], "df_data": [1, 2], "df_order": [1, 2], "df_return": [1, 2], "evaluate_return": [1, 2], "plot_return": [1, 2], "run": [1, 2], "run_ind": [1, 2], "run_rul": [1, 2], "run_sign": [1, 2], "portfolio": 1, "add_strategi": [1, 2], "plot": [1, 2], "optim": 1, "experi": [1, 2], "df_experi": [1, 2], "experiment_list": [1, 2], "plot_2d": [1, 2], "plot_3d": [1, 2], "flatten_kei": [1, 2], "test_optim": [1, 2], "evalu": 1, "add_metr": [1, 2], "comput": [1, 2], "compute_metr": [1, 2], "metric": [1, 2], "compute_amean": [1, 2], "compute_annual_return": [1, 2], "compute_bucketed_return": [1, 2], "compute_calmar": [1, 2], "compute_dates_3yr": [1, 2], "compute_equ": [1, 2], "compute_gmean": [1, 2], "compute_k_ratio": [1, 2], "compute_mar": [1, 2], "compute_maxdd_d": [1, 2], "compute_maxdd_date_3yr": [1, 2], "compute_maxdd_pct": [1, 2], "compute_maxdd_pct_3yr": [1, 2], "compute_maxdd_start": [1, 2], "compute_maxdd_start_3yr": [1, 2], "compute_num_period": [1, 2], "compute_periods_per_year": [1, 2], "compute_return_metr": [1, 2], "compute_returns_3yr": [1, 2], "compute_rolling_dd": [1, 2], "compute_rolling_dd_3yr": [1, 2], "compute_sharp": [1, 2], "compute_sortino": [1, 2], "compute_std": [1, 2], "display_return_metr": [1, 2], "handle_non_finite_return": [1, 2], "plot_return_metr": [1, 2], "test_evalu": [1, 2], "pyqstrat_cpp": 1, "black_scholes_pric": [1, 2], "cdf": [1, 2], "d1": [1, 2], "d2": [1, 2], "delta": [1, 2], "gamma": [1, 2], "implied_vol": [1, 2], "rho": [1, 2], "theta": [1, 2], "vega": [1, 2], "pyqstrat_io": 1, "parse_datetim": [1, 2], "read_fil": [1, 2], "market": 1, "eminifutur": [1, 2], "get_current_symbol": [1, 2], "get_expiri": [1, 2], "get_next_symbol": [1, 2], "get_previous_symbol": [1, 2], "eminiopt": [1, 2], "decode_symbol": [1, 2], "future_code_to_month": [1, 2], "future_code_to_month_numb": [1, 2], "get_future_cod": [1, 2], "strategy_build": 1, "strategybuild": [1, 2], "__call__": [1, 2], "add_contract_group": [1, 2], "add_series_ind": [1, 2], "add_series_rul": [1, 2], "data": [1, 2], "indic": [1, 2], "market_sim": [1, 2], "pnl_calc_tim": [1, 2], "price_funct": [1, 2], "rule": [1, 2], "set_pnl_calc_tim": [1, 2], "set_price_funct": [1, 2], "set_starting_equ": [1, 2], "set_strategy_context": [1, 2], "set_timestamp": [1, 2], "set_trade_lag": [1, 2], "signal": [1, 2], "starting_equ": [1, 2], "strategy_context": [1, 2], "timestamp_unit": [1, 2], "trade_lag": [1, 2], "strategy_compon": 1, "closepositionexitrul": [1, 2], "limit_incr": [1, 2], "price_func": [1, 2], "finiteriskentryrul": [1, 2], "contract_filt": [1, 2], "long": [1, 2], "min_price_diff": [1, 2], "percent_of_equ": [1, 2], "single_entry_per_dai": [1, 2], "stop_price_ind": [1, 2], "percentofequitytradingrul": [1, 2], "equity_perc": [1, 2], "pricefuncarraydict": [1, 2], "price_dict": [1, 2], "pricefuncdict": [1, 2], "simplemarketsimul": [1, 2], "commiss": [1, 2], "slippag": [1, 2], "vwapcloserul": [1, 2], "vwap_minut": [1, 2], "vwapentryrul": [1, 2], "vwapmarketsimul": [1, 2], "backup_price_ind": [1, 2], "price_ind": [1, 2], "volume_ind": [1, 2], "vectorind": [1, 2], "vector": [1, 2], "vectorsign": [1, 2], "get_contract_price_from_array_dict": [1, 2], "get_contract_price_from_dict": [1, 2], "interactive_plot": 1, "interactiveplot": [1, 2], "create_pivot": [1, 2], "updat": [1, 2], "lineconfig": [1, 2], "color": [1, 2], "marker_mod": [1, 2], "secondary_i": [1, 2], "show_detail": [1, 2], "thick": [1, 2], "linegraphwithdetaildisplai": [1, 2], "meanwithci": [1, 2], "simpledetailt": [1, 2], "simpletransform": [1, 2], "testinteractiveplot": [1, 2], "test_interactive_plot": [1, 2], "transform": [1, 2], "create_selection_dropdown": [1, 2], "display_form": [1, 2], "foo": [1, 2], "on_widgets_upd": [1, 2], "percentile_bucket": [1, 2], "simple_data_filt": [1, 2], "simple_dimension_filt": [1, 2], "content": 1, "except": 2, "sourc": 2, "base": 2, "class": 2, "base_path": 2, "none": 2, "object": 2, "convent": 2, "where": 2, "write": 2, "report": 2, "return": 2, "type": 2, "condit": 2, "msg": 2, "like": 2, "python": 2, "assert": 2, "rais": 2, "an": 2, "i": 2, "turn": 2, "off": 2, "us": 2, "switch": 2, "ci_level": 2, "0": 2, "95": 2, "n": 2, "1000": 2, "func": 2, "function": 2, "mean": 2, "non": 2, "parametr": 2, "bootstrap": 2, "confid": 2, "interv": 2, "ndarrai": 2, "param": 2, "The": 2, "from": 2, "float": 2, "level": 2, "e": 2, "g": 2, "default": 2, "int": 2, "number": 2, "boostrap": 2, "iter": 2, "callabl": 2, "np": 2, "median": 2, "tupl": 2, "A": 2, "contain": 2, "lower": 2, "upper": 2, "ci": 2, "random": 2, "seed": 2, "x": 2, "uniform": 2, "high": 2, "10": 2, "size": 2, "100000": 2, "allclos": 2, "4": 2, "9773159": 2, "5": 2, "010328": 2, "http": 2, "stackoverflow": 2, "com": 2, "question": 2, "52398383": 2, "find": 2, "week": 2, "datetime64": 2, "numpi": 2, "arrai": 2, "datetim": 2, "mondai": 2, "sundai": 2, "6": 2, "paramet": 2, "2015": 2, "01": 2, "04": 2, "day_int": 2, "str": 2, "dir": 2, "filenam": 2, "rel": 2, "file": 2, "subdirectori": 2, "child_nam": 2, "logger": 2, "load": 2, "config": 2, "yaml": 2, "dict": 2, "thi": 2, "first": 2, "valu": 2, "call": 2, "yml": 2, "your": 2, "home": 2, "next": 2, "look": 2, "local": 2, "work": 2, "If": 2, "found": 2, "overrid": 2, "ani": 2, "np_dtype": 2, "empti": 2, "given": 2, "datatyp": 2, "2018": 2, "03": 2, "dtype": 2, "m8": 2, "d": 2, "nat": 2, "headless": 2, "machin": 2, "remot": 2, "server": 2, "so": 2, "we": 2, "don": 2, "t": 2, "try": 2, "show": 2, "graph": 2, "etc": 2, "dure": 2, "unit": 2, "test": 2, "bool": 2, "whether": 2, "ar": 2, "ipython": 2, "jupyt": 2, "environ": 2, "input_filenam": 2, "infer": 2, "compress": 2, "its": 2, "suffix": 2, "For": 2, "exampl": 2, "tmp": 2, "hello": 2, "gz": 2, "gzip": 2, "abc": 2, "txt": 2, "true": 2, "option": 2, "most": 2, "common": 2, "frequenc": 2, "date": 2, "differ": 2, "fraction": 2, "monoton": 2, "increas": 2, "11": 2, "00": 2, "15": 2, "30": 2, "35": 2, "traceback": 2, "recent": 2, "last": 2, "could": 2, "50": 2, "print": 2, "round": 2, "8": 2, "01041667": 2, "rtype": 2, "py": 2, "05": 2, "07": 2, "09": 2, "math": 2, "isclos": 2, "60": 2, "ref_filenam": 2, "ctime": 2, "modfic": 2, "time": 2, "newer": 2, "than": 2, "either": 2, "doe": 2, "import": 2, "tempfil": 2, "temp_dir": 2, "gettempdir": 2, "f": 2, "sleep": 2, "1": 2, "y": 2, "fals": 2, "a1": 2, "a2": 2, "x1": 2, "x2": 2, "3": 2, "9": 2, "45": 2, "isnan": 2, "dt": 2, "millisecond": 2, "between": 2, "unix": 2, "epoch": 2, "sinc": 2, "can": 2, "well": 2, "1514764800000": 2, "otherwis": 2, "02": 2, "convert": 2, "nan": 2, "bucket": 2, "default_valu": 2, "side": 2, "sort": 2, "list": 2, "assign": 2, "each": 2, "element": 2, "when": 2, "cannot": 2, "left": 2, "right": 2, "set": 2, "midpoint": 2, "same": 2, "length": 2, "18": 2, "12": 2, "25": 2, "v": 2, "8914491": 2, "nearest": 2, "closest": 2, "must": 2, "all": 2, "2": 2, "num_dai": 2, "increment": 2, "cell": 2, "higher": 2, "2021": 2, "06": 2, "08": 2, "check": 2, "array_equ": 2, "equal_nan": 2, "indexof_sort": 2, "": 2, "string": 2, "window": 2, "appli": 2, "roll": 2, "see": 2, "6811183": 2, "1d": 2, "std": 2, "clip": 2, "75": 2, "mai": 2, "have": 2, "gener": 2, "structur": 2, "uniqu": 2, "array1": 2, "array2": 2, "p": 2, "c": 2, "len": 2, "percentil": 2, "29989971": 2, "5351549": 2, "scipi": 2, "stat": 2, "percentileofscor": 2, "o": 2, "log": 2, "100": 2, "lst": 2, "key_func": 2, "remov": 2, "duplic": 2, "take": 2, "kei": 2, "detect": 2, "dup": 2, "stabl": 2, "sens": 2, "origin": 2, "retain": 2, "lambda": 2, "sampling_frequ": 2, "resample_func": 2, "downsampl": 2, "bar": 2, "sampl": 2, "pd": 2, "datafram": 2, "which": 2, "panda": 2, "dictionari": 2, "column": 2, "resampl": 2, "custom": 2, "defin": 2, "entri": 2, "13": 2, "h": 2, "7": 2, "l": 2, "200": 2, "150": 2, "300": 2, "400": 2, "vwap": 2, "set_index": 2, "inplac": 2, "agg": 2, "iloc": 2, "24": 2, "bin": 2, "edg": 2, "seri": 2, "weight": 2, "averag": 2, "volum": 2, "back": 2, "unchang": 2, "df_float_sf": 2, "df_display_max_row": 2, "df_display_max_column": 2, "99": 2, "np_seterr": 2, "some": 2, "displai": 2, "make": 2, "easier": 2, "view": 2, "signific": 2, "figur": 2, "row": 2, "you": 2, "them": 2, "error": 2, "mode": 2, "warn": 2, "seterr": 2, "detail": 2, "jupyter_multiple_displai": 2, "multipl": 2, "output": 2, "fill_valu": 2, "similar": 2, "shift": 2, "place": 2, "neg": 2, "after": 2, "slot": 2, "boolean": 2, "2008": 2, "tup": 2, "2009": 2, "16": 2, "file_nam": 2, "arg": 2, "kwarg": 2, "temporari": 2, "renam": 2, "perman": 2, "half": 2, "written": 2, "also": 2, "xz": 2, "algorithm": 2, "fname": 2, "438": 2, "dir_fd": 2, "replic": 2, "command": 2, "doesn": 2, "period": 2, "threshold": 2, "zero": 2, "static": 2, "our": 2, "cach": 2, "group": 2, "reprent": 2, "ibm": 2, "esh9": 2, "sometim": 2, "need": 2, "calcul": 2, "ha": 2, "futur": 2, "hedg": 2, "In": 2, "case": 2, "over": 2, "expir": 2, "want": 2, "track": 2, "leg": 2, "one": 2, "other": 2, "per": 2, "here": 2, "mini": 2, "would": 2, "simplenamespac": 2, "store": 2, "strike": 2, "contrat": 2, "stock": 2, "wai": 2, "out": 2, "factori": 2, "wa": 2, "share": 2, "quantiti": 2, "sell": 2, "reason": 2, "specif": 2, "fill_qti": 2, "enum": 2, "2020": 2, "189": 2, "4f": 2, "4433": 2, "stop": 2, "loss": 2, "limit": 2, "goe": 2, "abov": 2, "below": 2, "depend": 2, "short": 2, "becom": 2, "point": 2, "cross": 2, "enumer": 2, "fee": 2, "refer": 2, "execut": 2, "paid": 2, "broker": 2, "commis": 2, "sent": 2, "till": 2, "end": 2, "specifi": 2, "bui": 2, "now": 2, "as_utf8": 2, "hdf5": 2, "in_filenam": 2, "in_kei": 2, "out_filenam": 2, "out_kei": 2, "skip_if_exist": 2, "recurs": 2, "copi": 2, "input": 2, "skip": 2, "alreadi": 2, "replac": 2, "tempdir": 2, "temp_in": 2, "temp_out": 2, "test_g": 2, "test_subg": 2, "h5py": 2, "w": 2, "create_group": 2, "create_dataset": 2, "r": 2, "obj": 2, "serv": 2, "purpos": 2, "h5repack": 2, "line": 2, "tool": 2, "discard": 2, "space": 2, "smaller": 2, "previous": 2, "subgroup": 2, "g1": 2, "g2": 2, "subgrp": 2, "within": 2, "grp": 2, "along": 2, "compression_arg": 2, "dimension": 2, "col1": 2, "f4": 2, "byte": 2, "as_utf_8": 2, "save": 2, "utf8": 2, "encod": 2, "max": 2, "fix": 2, "ascii": 2, "much": 2, "faster": 2, "process": 2, "hdf5plugin": 2, "argument": 2, "blosc": 2, "calendar_nam": 2, "pandas_market_calendar": 2, "add": 2, "union": 2, "forward": 2, "follow": 2, "backward": 2, "preced": 2, "modifiedfollow": 2, "modifiedpreced": 2, "allow": 2, "special": 2, "ad": 2, "holidai": 2, "act": 2, "give": 2, "busi": 2, "rest": 2, "busday_offset": 2, "document": 2, "how": 2, "treat": 2, "do": 2, "fall": 2, "later": 2, "earlier": 2, "unless": 2, "across": 2, "month": 2, "boundari": 2, "nyse": 2, "28": 2, "2017": 2, "14": 2, "fridai": 2, "2019": 2, "17": 2, "19t15": 2, "15t15": 2, "include_first": 2, "include_last": 2, "2005": 2, "19": 2, "20": 2, "21": 2, "26": 2, "27": 2, "31": 2, "2016": 2, "29": 2, "22": 2, "weekend": 2, "eurex": 2, "arang": 2, "count": 2, "two": 2, "includ": 2, "those": 2, "2011": 2, "766": 2, "2013": 2, "timedelta64": 2, "filterwarn": 2, "action": 2, "ignor": 2, "categori": 2, "performancewarn": 2, "dates2": 2, "set_printopt": 2, "formatt": 2, "1f": 2, "lead": 2, "sign": 2, "year": 2, "weekdai": 2, "1000000": 2, "900": 2, "sequenc": 2, "might": 2, "pass": 2, "current": 2, "state": 2, "currenc": 2, "e6": 2, "minut": 2, "past": 2, "midnight": 2, "should": 2, "pm": 2, "intern": 2, "rememb": 2, "up": 2, "more": 2, "onli": 2, "broken": 2, "down": 2, "start_dat": 2, "end_dat": 2, "trip": 2, "greater": 2, "equal": 2, "less": 2, "Will": 2, "caus": 2, "net": 2, "thei": 2, "account_timestamp": 2, "singl": 2, "aapl_contract": 2, "aapl": 2, "def": 2, "get_pric": 2, "idx": 2, "unknown": 2, "contract_pnl": 2, "trade_5": 2, "trade_6": 2, "trade_7": 2, "_add_trad": 2, "to_dict": 2, "unreal": 2, "44": 2, "realiz": 2, "000000000000007": 2, "47": 2, "00000000000001": 2, "sorted_dict": 2, "961": 2, "run_final_calc": 2, "heartbeat": 2, "simul": 2, "potenti": 2, "think": 2, "second": 2, "daili": 2, "done": 2, "storag": 2, "pair": 2, "relev": 2, "pre": 2, "tabl": 2, "correl": 2, "member": 2, "access": 2, "depends_on": 2, "market_sim_funct": 2, "rule_funct": 2, "signal_nam": 2, "sig_true_valu": 2, "position_filt": 2, "guarante": 2, "exit": 2, "re": 2, "enter": 2, "new": 2, "ones": 2, "sure": 2, "befor": 2, "match": 2, "nonzero": 2, "correspond": 2, "fit": 2, "criteria": 2, "signal_funct": 2, "depends_on_ind": 2, "depends_on_sign": 2, "add_pnl": 2, "sum": 2, "possibl": 2, "periods_per_year": 2, "display_summari": 2, "float_precis": 2, "return_metr": 2, "gap": 2, "yourself": 2, "252": 2, "drawdown": 2, "indicator_nam": 2, "clear_al": 2, "clear": 2, "rule_nam": 2, "concurr": 2, "uncorrel": 2, "togeth": 2, "instanc": 2, "strategy_nam": 2, "combin": 2, "By": 2, "few": 2, "readi": 2, "descript": 2, "suggest": 2, "cost": 2, "other_cost": 2, "result": 2, "variabl": 2, "repres": 2, "finit": 2, "infin": 2, "cost_func": 2, "max_process": 2, "titl": 2, "yield": 2, "cpu": 2, "core": 2, "mani": 2, "sort_column": 2, "ascend": 2, "sort_ord": 2, "lowest_cost": 2, "highest_cost": 2, "were": 2, "marker": 2, "height": 2, "width": 2, "2d": 2, "axi": 2, "anoth": 2, "subplot": 2, "plu": 2, "plotli": 2, "z": 2, "filter_func": 2, "xlim": 2, "ylim": 2, "vertical_spac": 2, "3d": 2, "actual": 2, "datapoint": 2, "reduc": 2, "dataset": 2, "filter": 2, "dimens": 2, "beyond": 2, "pick": 2, "interpol": 2, "vertic": 2, "raise_on_error": 2, "even": 2, "multiprocess": 2, "bubbl": 2, "debug": 2, "stack": 2, "trace": 2, "util": 2, "initial_metr": 2, "retriev": 2, "init": 2, "initi": 2, "subsequ": 2, "scalar": 2, "metric_nam": 2, "arithmet": 2, "003": 2, "004": 2, "882": 2, "geometr": 2, "being": 2, "integ": 2, "annual": 2, "returns_3yr": 2, "mdd_pct_3yr": 2, "calmar": 2, "ratio": 2, "divid": 2, "001": 2, "002": 2, "018362": 2, "halflife_year": 2, "k": 2, "version": 2, "lar": 2, "kestner": 2, "paper": 2, "ssrn": 2, "sol3": 2, "cfm": 2, "abstract_id": 2, "2230949": 2, "implement": 2, "modif": 2, "linear": 2, "regress": 2, "older": 2, "observ": 2, "sqrt": 2, "nob": 2, "unweight": 2, "ret": 2, "normal": 2, "loc": 2, "0025": 2, "scale": 2, "cumprod": 2, "888": 2, "abs_tol": 2, "602": 2, "140": 2, "mdd_pct": 2, "mar": 2, "biggest": 2, "incept": 2, "rolling_dd_d": 2, "rolling_dd": 2, "dd": 2, "percentag": 2, "rolling_dd_3yr_timestamp": 2, "rolling_dd_3yr": 2, "mdd_date": 2, "draw": 2, "mdd_date_3yr": 2, "approx": 2, "separ": 2, "m": 2, "72576": 2, "leading_non_finite_to_zero": 2, "subsequent_non_finite_to_zero": 2, "instrument": 2, "nd": 2, "inf": 2, "warmup": 2, "move": 2, "There": 2, "incorrect": 2, "own": 2, "recomput": 2, "just": 2, "015": 2, "ev": 2, "gmean": 2, "03122": 2, "sharp": 2, "594366": 2, "amean": 2, "note": 2, "risk": 2, "free": 2, "realli": 2, "sharpe0": 2, "assum": 2, "050508": 2, "target": 2, "133631": 2, "standard": 2, "deviat": 2, "conveni": 2, "obtain": 2, "chang": 2, "format": 2, "6g": 2, "show_point": 2, "boxplot": 2, "produc": 2, "let": 2, "select": 2, "float64": 2, "sigma": 2, "q": 2, "euroepean": 2, "put": 2, "spot": 2, "discount": 2, "exp": 2, "rt": 2, "matur": 2, "continu": 2, "compound": 2, "interest": 2, "rate": 2, "volatil": 2, "dividend": 2, "cumul": 2, "densiti": 2, "distribut": 2, "black": 2, "schole": 2, "european": 2, "impli": 2, "premium": 2, "formula": 2, "365": 2, "u": 2, "customari": 2, "pars": 2, "curr_dat": 2, "esm9": 2, "esh0": 2, "fut_symbol": 2, "esh8": 2, "16t08": 2, "curr_future_symbol": 2, "esz8": 2, "e1af8": 2, "mo": 2, "ew2z5": 2, "11t15": 2, "e3af7": 2, "17t15": 2, "ewf0": 2, "31t15": 2, "future_cod": 2, "code": 2, "abbrevi": 2, "nov": 2, "letter": 2, "march": 2, "helper": 2, "build": 2, "simpler": 2, "lot": 2, "boilerpl": 2, "built": 2, "part": 2, "aggreg": 2, "suppli": 2, "pricefunctiontyp": 2, "basi": 2, "backtest": 2, "33": 2, "send": 2, "lag": 2, "relax": 2, "assumpt": 2, "user": 2, "instead": 2, "hardcod": 2, "numer": 2, "overnight": 2, "yesterdai": 2, "close": 2, "morn": 2, "determin": 2, "night": 2, "logic": 2, "decid": 2, "what": 2, "kind": 2, "sim": 2, "successfulli": 2, "column_nam": 2, "constructor": 2, "context": 2, "log_ord": 2, "subtract": 2, "respect": 2, "indicator_valu": 2, "signal_valu": 2, "current_ord": 2, "self": 2, "go": 2, "lose": 2, "amount": 2, "Of": 2, "cours": 2, "rather": 2, "smoothli": 2, "breach": 2, "5000": 2, "construct": 2, "everi": 2, "intradai": 2, "signatur": 2, "2023": 2, "pricefunc": 2, "basket": 2, "aapl_ibm": 2, "aapl_pric": 2, "ibm_pric": 2, "slippage_per_trad": 2, "commission_per_trad": 2, "marketsimulatortyp": 2, "It": 2, "put_symbol": 2, "call_symbol": 2, "spx": 2, "3500": 2, "4000": 2, "put_contract": 2, "call_contract": 2, "test_contract": 2, "todo": 2, "meant": 2, "reach": 2, "estim": 2, "opposit": 2, "b": 2, "histor": 2, "miss": 2, "parent_valu": 2, "label": 2, "transform_func": 2, "create_selection_widgets_func": 2, "dim_filter_func": 2, "data_filter_func": 2, "stat_func": 2, "plot_func": 2, "display_form_func": 2, "multidimension": 2, "interact": 2, "map": 2, "friendli": 2, "choos": 2, "dropdown": 2, "onc": 2, "statist": 2, "widget": 2, "associ": 2, "form": 2, "dont": 2, "xcol": 2, "ycol": 2, "zcol": 2, "pivot": 2, "zvalu": 2, "option_typ": 2, "american": 2, "bermudan": 2, "care": 2, "chosen": 2, "owner_idx": 2, "redraw": 2, "everyth": 2, "display_detail_func": 2, "line_config": 2, "hovertempl": 2, "pane": 2, "click": 2, "xaxis_titl": 2, "yaxis_titl": 2, "line_data": 2, "configur": 2, "hover": 2, "mean_func": 2, "nanmean": 2, "filtered_data": 2, "versu": 2, "colnam": 2, "float_format": 2, "4g": 2, "min_row": 2, "copy_to_clipboard": 2, "under": 2, "detail_widget": 2, "truncat": 2, "clipboard": 2, "On": 2, "linux": 2, "instal": 2, "xclip": 2, "quantil": 2, "methodnam": 2, "runtest": 2, "testcas": 2, "dim": 2, "update_form_func": 2, "form_widget": 2, "old": 2, "selection_widget": 2, "callback": 2, "10000": 2, "atol": 2, "selected_valu": 2, "dim_nam": 2}, "objects": {"": [[2, 0, 0, "-", "pyqstrat"]], "pyqstrat": [[2, 0, 0, "-", "account"], [2, 0, 0, "-", "evaluator"], [2, 0, 0, "-", "holiday_calendars"], [2, 0, 0, "-", "interactive_plot"], [2, 0, 0, "-", "markets"], [2, 0, 0, "-", "optimize"], [2, 0, 0, "-", "portfolio"], [2, 0, 0, "-", "pq_io"], [2, 0, 0, "-", "pq_types"], [2, 0, 0, "-", "pq_utils"], [2, 0, 0, "-", "pyqstrat_cpp"], [2, 0, 0, "-", "pyqstrat_io"], [2, 0, 0, "-", "strategy"], [2, 0, 0, "-", "strategy_builder"], [2, 0, 0, "-", "strategy_components"]], "pyqstrat.account": [[2, 1, 1, "", "Account"], [2, 1, 1, "", "ContractPNL"], [2, 3, 1, "", "find_index_before"], [2, 3, 1, "", "find_last_non_nan_index"], [2, 3, 1, "", "leading_nan_to_zero"], [2, 3, 1, "", "test_account"]], "pyqstrat.account.Account": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_trades"], [2, 2, 1, "", "calc"], [2, 2, 1, "", "df_account_pnl"], [2, 2, 1, "", "df_pnl"], [2, 2, 1, "", "df_roundtrip_trades"], [2, 2, 1, "", "df_trades"], [2, 2, 1, "", "equity"], [2, 2, 1, "", "get_trades_for_date"], [2, 2, 1, "", "position"], [2, 2, 1, "", "positions"], [2, 2, 1, "", "roundtrip_trades"], [2, 2, 1, "", "symbols"], [2, 2, 1, "", "trades"]], "pyqstrat.account.ContractPNL": [[2, 2, 1, "", "calc_net_pnl"], [2, 2, 1, "", "df"], [2, 2, 1, "", "net_pnl"], [2, 2, 1, "", "pnl"], [2, 2, 1, "", "position"]], "pyqstrat.evaluator": [[2, 1, 1, "", "Evaluator"], [2, 3, 1, "", "compute_amean"], [2, 3, 1, "", "compute_annual_returns"], [2, 3, 1, "", "compute_bucketed_returns"], [2, 3, 1, "", "compute_calmar"], [2, 3, 1, "", "compute_dates_3yr"], [2, 3, 1, "", "compute_equity"], [2, 3, 1, "", "compute_gmean"], [2, 3, 1, "", "compute_k_ratio"], [2, 3, 1, "", "compute_mar"], [2, 3, 1, "", "compute_maxdd_date"], [2, 3, 1, "", "compute_maxdd_date_3yr"], [2, 3, 1, "", "compute_maxdd_pct"], [2, 3, 1, "", "compute_maxdd_pct_3yr"], [2, 3, 1, "", "compute_maxdd_start"], [2, 3, 1, "", "compute_maxdd_start_3yr"], [2, 3, 1, "", "compute_num_periods"], [2, 3, 1, "", "compute_periods_per_year"], [2, 3, 1, "", "compute_return_metrics"], [2, 3, 1, "", "compute_returns_3yr"], [2, 3, 1, "", "compute_rolling_dd"], [2, 3, 1, "", "compute_rolling_dd_3yr"], [2, 3, 1, "", "compute_sharpe"], [2, 3, 1, "", "compute_sortino"], [2, 3, 1, "", "compute_std"], [2, 3, 1, "", "display_return_metrics"], [2, 3, 1, "", "handle_non_finite_returns"], [2, 3, 1, "", "plot_return_metrics"], [2, 3, 1, "", "test_evaluator"]], "pyqstrat.evaluator.Evaluator": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_metric"], [2, 2, 1, "", "compute"], [2, 2, 1, "", "compute_metric"], [2, 2, 1, "", "metric"], [2, 2, 1, "", "metrics"]], "pyqstrat.holiday_calendars": [[2, 1, 1, "", "Calendar"], [2, 3, 1, "", "get_date_from_weekday"]], "pyqstrat.holiday_calendars.Calendar": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_trading_days"], [2, 2, 1, "", "get_trading_days"], [2, 2, 1, "", "is_trading_day"], [2, 2, 1, "", "num_trading_days"], [2, 2, 1, "", "third_friday_of_month"]], "pyqstrat.interactive_plot": [[2, 1, 1, "", "InteractivePlot"], [2, 1, 1, "", "LineConfig"], [2, 1, 1, "", "LineGraphWithDetailDisplay"], [2, 1, 1, "", "MeanWithCI"], [2, 1, 1, "", "SimpleDetailTable"], [2, 1, 1, "", "SimpleTransform"], [2, 1, 1, "", "TestInteractivePlot"], [2, 3, 1, "", "create_selection_dropdowns"], [2, 3, 1, "", "display_form"], [2, 3, 1, "", "foo"], [2, 3, 1, "", "on_widgets_updated"], [2, 3, 1, "", "percentile_buckets"], [2, 3, 1, "", "simple_data_filter"], [2, 3, 1, "", "simple_dimension_filter"]], "pyqstrat.interactive_plot.InteractivePlot": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "create_pivot"], [2, 2, 1, "", "update"]], "pyqstrat.interactive_plot.LineConfig": [[2, 2, 1, "", "__init__"], [2, 4, 1, "", "color"], [2, 4, 1, "", "marker_mode"], [2, 4, 1, "", "secondary_y"], [2, 4, 1, "", "show_detail"], [2, 4, 1, "", "thickness"]], "pyqstrat.interactive_plot.LineGraphWithDetailDisplay": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.MeanWithCI": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.SimpleDetailTable": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.SimpleTransform": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.TestInteractivePlot": [[2, 2, 1, "", "test_interactive_plot"], [2, 2, 1, "", "transform"]], "pyqstrat.markets": [[2, 1, 1, "", "EminiFuture"], [2, 1, 1, "", "EminiOption"], [2, 3, 1, "", "future_code_to_month"], [2, 3, 1, "", "future_code_to_month_number"], [2, 3, 1, "", "get_future_code"]], "pyqstrat.markets.EminiFuture": [[2, 4, 1, "", "calendar"], [2, 2, 1, "", "get_current_symbol"], [2, 2, 1, "", "get_expiry"], [2, 2, 1, "", "get_next_symbol"], [2, 2, 1, "", "get_previous_symbol"]], "pyqstrat.markets.EminiOption": [[2, 4, 1, "", "calendar"], [2, 2, 1, "", "decode_symbol"], [2, 2, 1, "", "get_expiry"]], "pyqstrat.optimize": [[2, 1, 1, "", "Experiment"], [2, 1, 1, "", "Optimizer"], [2, 3, 1, "", "flatten_keys"], [2, 3, 1, "", "test_optimize"]], "pyqstrat.optimize.Experiment": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "valid"]], "pyqstrat.optimize.Optimizer": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "df_experiments"], [2, 2, 1, "", "experiment_list"], [2, 2, 1, "", "plot_2d"], [2, 2, 1, "", "plot_3d"], [2, 2, 1, "", "run"]], "pyqstrat.portfolio": [[2, 1, 1, "", "Portfolio"]], "pyqstrat.portfolio.Portfolio": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_strategy"], [2, 2, 1, "", "df_returns"], [2, 2, 1, "", "evaluate_returns"], [2, 2, 1, "", "plot"], [2, 2, 1, "", "run"], [2, 2, 1, "", "run_indicators"], [2, 2, 1, "", "run_rules"], [2, 2, 1, "", "run_signals"]], "pyqstrat.pq_io": [[2, 3, 1, "", "df_to_hdf5"], [2, 3, 1, "", "hdf5_copy"], [2, 3, 1, "", "hdf5_repack"], [2, 3, 1, "", "hdf5_to_df"], [2, 3, 1, "", "hdf5_to_np_arrays"], [2, 3, 1, "", "np_arrays_to_hdf5"], [2, 3, 1, "", "test_hdf5_to_df"]], "pyqstrat.pq_types": [[2, 1, 1, "", "Contract"], [2, 1, 1, "", "ContractGroup"], [2, 1, 1, "", "LimitOrder"], [2, 1, 1, "", "MarketOrder"], [2, 1, 1, "", "Order"], [2, 1, 1, "", "OrderStatus"], [2, 1, 1, "", "Price"], [2, 1, 1, "", "RollOrder"], [2, 1, 1, "", "RoundTripTrade"], [2, 1, 1, "", "StopLimitOrder"], [2, 1, 1, "", "TimeInForce"], [2, 1, 1, "", "Trade"], [2, 1, 1, "", "VWAPOrder"]], "pyqstrat.pq_types.Contract": [[2, 2, 1, "", "clear_cache"], [2, 4, 1, "", "components"], [2, 4, 1, "", "contract_group"], [2, 2, 1, "", "create"], [2, 2, 1, "", "exists"], [2, 4, 1, "", "expiry"], [2, 2, 1, "", "get"], [2, 2, 1, "", "is_basket"], [2, 4, 1, "", "multiplier"], [2, 4, 1, "", "properties"], [2, 4, 1, "", "symbol"]], "pyqstrat.pq_types.ContractGroup": [[2, 2, 1, "", "add_contract"], [2, 2, 1, "", "clear_cache"], [2, 4, 1, "", "contracts"], [2, 2, 1, "", "exists"], [2, 2, 1, "", "get"], [2, 2, 1, "", "get_contract"], [2, 2, 1, "", "get_contracts"], [2, 4, 1, "", "name"]], "pyqstrat.pq_types.LimitOrder": [[2, 4, 1, "", "limit_price"]], "pyqstrat.pq_types.Order": [[2, 2, 1, "", "cancel"], [2, 4, 1, "", "contract"], [2, 2, 1, "", "fill"], [2, 2, 1, "", "is_open"], [2, 4, 1, "", "properties"], [2, 4, 1, "", "qty"], [2, 4, 1, "", "reason_code"], [2, 2, 1, "", "request_cancel"], [2, 4, 1, "", "status"], [2, 4, 1, "", "time_in_force"], [2, 4, 1, "", "timestamp"]], "pyqstrat.pq_types.OrderStatus": [[2, 4, 1, "", "CANCELLED"], [2, 4, 1, "", "CANCEL_REQUESTED"], [2, 4, 1, "", "FILLED"], [2, 4, 1, "", "OPEN"], [2, 4, 1, "", "PARTIALLY_FILLED"]], "pyqstrat.pq_types.Price": [[2, 4, 1, "", "ask"], [2, 4, 1, "", "ask_size"], [2, 4, 1, "", "bid"], [2, 4, 1, "", "bid_size"], [2, 2, 1, "", "invalid"], [2, 2, 1, "", "mid"], [2, 4, 1, "", "properties"], [2, 2, 1, "", "set_property"], [2, 2, 1, "", "spread"], [2, 4, 1, "", "timestamp"], [2, 4, 1, "", "valid"], [2, 2, 1, "", "vw_mid"]], "pyqstrat.pq_types.RollOrder": [[2, 4, 1, "", "close_qty"], [2, 4, 1, "", "reopen_qty"]], "pyqstrat.pq_types.RoundTripTrade": [[2, 4, 1, "", "contract"], [2, 4, 1, "", "entry_commission"], [2, 4, 1, "", "entry_order"], [2, 4, 1, "", "entry_price"], [2, 4, 1, "", "entry_properties"], [2, 4, 1, "", "entry_reason"], [2, 4, 1, "", "entry_timestamp"], [2, 4, 1, "", "exit_commission"], [2, 4, 1, "", "exit_order"], [2, 4, 1, "", "exit_price"], [2, 4, 1, "", "exit_properties"], [2, 4, 1, "", "exit_reason"], [2, 4, 1, "", "exit_timestamp"], [2, 4, 1, "", "net_pnl"], [2, 4, 1, "", "qty"]], "pyqstrat.pq_types.StopLimitOrder": [[2, 4, 1, "", "limit_price"], [2, 4, 1, "", "trigger_price"], [2, 4, 1, "", "triggered"]], "pyqstrat.pq_types.TimeInForce": [[2, 4, 1, "", "DAY"], [2, 4, 1, "", "FOK"], [2, 4, 1, "", "GTC"]], "pyqstrat.pq_types.Trade": [[2, 2, 1, "", "__init__"]], "pyqstrat.pq_types.VWAPOrder": [[2, 4, 1, "", "vwap_end_time"], [2, 4, 1, "", "vwap_stop"]], "pyqstrat.pq_utils": [[2, 5, 1, "", "PQException"], [2, 1, 1, "", "Paths"], [2, 3, 1, "", "assert_"], [2, 3, 1, "", "bootstrap_ci"], [2, 3, 1, "", "day_of_week_num"], [2, 3, 1, "", "day_symbol"], [2, 3, 1, "", "find_in_subdir"], [2, 3, 1, "", "get_child_logger"], [2, 3, 1, "", "get_config"], [2, 3, 1, "", "get_empty_np_value"], [2, 3, 1, "", "get_main_logger"], [2, 3, 1, "", "get_paths"], [2, 3, 1, "", "get_temp_dir"], [2, 3, 1, "", "has_display"], [2, 3, 1, "", "in_ipython"], [2, 3, 1, "", "infer_compression"], [2, 3, 1, "", "infer_frequency"], [2, 3, 1, "", "is_newer"], [2, 3, 1, "", "linear_interpolate"], [2, 3, 1, "", "millis_since_epoch"], [2, 3, 1, "", "monotonically_increasing"], [2, 3, 1, "", "nan_to_zero"], [2, 3, 1, "", "np_bucket"], [2, 3, 1, "", "np_find_closest"], [2, 3, 1, "", "np_inc_dates"], [2, 3, 1, "", "np_indexof"], [2, 3, 1, "", "np_indexof_sorted"], [2, 3, 1, "", "np_parse_array"], [2, 3, 1, "", "np_rolling_window"], [2, 3, 1, "", "np_round"], [2, 3, 1, "", "np_uniques"], [2, 3, 1, "", "percentile_of_score"], [2, 3, 1, "", "remove_dups"], [2, 3, 1, "", "resample_trade_bars"], [2, 3, 1, "", "resample_ts"], [2, 3, 1, "", "resample_vwap"], [2, 3, 1, "", "series_to_array"], [2, 3, 1, "", "set_defaults"], [2, 3, 1, "", "set_ipython_defaults"], [2, 3, 1, "", "shift_np"], [2, 3, 1, "", "str2date"], [2, 3, 1, "", "strtup2date"], [2, 3, 1, "", "to_csv"], [2, 3, 1, "", "touch"], [2, 3, 1, "", "try_frequency"], [2, 3, 1, "", "zero_to_nan"]], "pyqstrat.pq_utils.Paths": [[2, 2, 1, "", "create"]], "pyqstrat.pyqstrat_cpp": [[2, 3, 1, "", "black_scholes_price"], [2, 3, 1, "", "cdf"], [2, 3, 1, "", "d1"], [2, 3, 1, "", "d2"], [2, 3, 1, "", "delta"], [2, 3, 1, "", "gamma"], [2, 3, 1, "", "implied_vol"], [2, 3, 1, "", "rho"], [2, 3, 1, "", "theta"], [2, 3, 1, "", "vega"]], "pyqstrat.pyqstrat_io": [[2, 3, 1, "", "parse_datetimes"], [2, 3, 1, "", "read_file"]], "pyqstrat.strategy": [[2, 1, 1, "", "Strategy"]], "pyqstrat.strategy.Strategy": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_indicator"], [2, 2, 1, "", "add_market_sim"], [2, 2, 1, "", "add_rule"], [2, 2, 1, "", "add_signal"], [2, 2, 1, "", "df_data"], [2, 2, 1, "", "df_orders"], [2, 2, 1, "", "df_pnl"], [2, 2, 1, "", "df_returns"], [2, 2, 1, "", "df_roundtrip_trades"], [2, 2, 1, "", "df_trades"], [2, 2, 1, "", "evaluate_returns"], [2, 2, 1, "", "orders"], [2, 2, 1, "", "plot_returns"], [2, 2, 1, "", "roundtrip_trades"], [2, 2, 1, "", "run"], [2, 2, 1, "", "run_indicators"], [2, 2, 1, "", "run_rules"], [2, 2, 1, "", "run_signals"], [2, 2, 1, "", "trades"]], "pyqstrat.strategy_builder": [[2, 1, 1, "", "StrategyBuilder"]], "pyqstrat.strategy_builder.StrategyBuilder": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_contract"], [2, 2, 1, "", "add_contract_group"], [2, 2, 1, "", "add_indicator"], [2, 2, 1, "", "add_market_sim"], [2, 2, 1, "", "add_rule"], [2, 2, 1, "", "add_series_indicator"], [2, 2, 1, "", "add_series_rule"], [2, 2, 1, "", "add_signal"], [2, 4, 1, "", "contract_groups"], [2, 4, 1, "", "data"], [2, 4, 1, "", "indicators"], [2, 4, 1, "", "market_sims"], [2, 4, 1, "", "pnl_calc_time"], [2, 4, 1, "", "price_function"], [2, 4, 1, "", "rules"], [2, 2, 1, "", "set_pnl_calc_time"], [2, 2, 1, "", "set_price_function"], [2, 2, 1, "", "set_starting_equity"], [2, 2, 1, "", "set_strategy_context"], [2, 2, 1, "", "set_timestamps"], [2, 2, 1, "", "set_trade_lag"], [2, 4, 1, "", "signals"], [2, 4, 1, "", "starting_equity"], [2, 4, 1, "", "strategy_context"], [2, 4, 1, "", "timestamp_unit"], [2, 4, 1, "", "timestamps"], [2, 4, 1, "", "trade_lag"]], "pyqstrat.strategy_components": [[2, 1, 1, "", "ClosePositionExitRule"], [2, 1, 1, "", "FiniteRiskEntryRule"], [2, 1, 1, "", "PercentOfEquityTradingRule"], [2, 1, 1, "", "PriceFuncArrayDict"], [2, 1, 1, "", "PriceFuncDict"], [2, 1, 1, "", "SimpleMarketSimulator"], [2, 1, 1, "", "VWAPCloseRule"], [2, 1, 1, "", "VWAPEntryRule"], [2, 1, 1, "", "VWAPMarketSimulator"], [2, 1, 1, "", "VectorIndicator"], [2, 1, 1, "", "VectorSignal"], [2, 3, 1, "", "get_contract_price_from_array_dict"], [2, 3, 1, "", "get_contract_price_from_dict"]], "pyqstrat.strategy_components.ClosePositionExitRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "limit_increment"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"]], "pyqstrat.strategy_components.FiniteRiskEntryRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "contract_filter"], [2, 4, 1, "", "long"], [2, 4, 1, "", "min_price_diff"], [2, 4, 1, "", "percent_of_equity"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"], [2, 4, 1, "", "single_entry_per_day"], [2, 4, 1, "", "stop_price_ind"]], "pyqstrat.strategy_components.PercentOfEquityTradingRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "equity_percent"], [2, 4, 1, "", "limit_increment"], [2, 4, 1, "", "long"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"]], "pyqstrat.strategy_components.PriceFuncArrayDict": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "price_dict"]], "pyqstrat.strategy_components.PriceFuncDict": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "price_dict"]], "pyqstrat.strategy_components.SimpleMarketSimulator": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "commission"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "slippage"]], "pyqstrat.strategy_components.VWAPCloseRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "reason_code"], [2, 4, 1, "", "vwap_minutes"]], "pyqstrat.strategy_components.VWAPEntryRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "long"], [2, 4, 1, "", "min_price_diff"], [2, 4, 1, "", "percent_of_equity"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"], [2, 4, 1, "", "single_entry_per_day"], [2, 4, 1, "", "stop_price_ind"], [2, 4, 1, "", "vwap_minutes"]], "pyqstrat.strategy_components.VWAPMarketSimulator": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "backup_price_indicator"], [2, 4, 1, "", "price_indicator"], [2, 4, 1, "", "volume_indicator"]], "pyqstrat.strategy_components.VectorIndicator": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "vector"]], "pyqstrat.strategy_components.VectorSignal": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "vector"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:function", "4": "py:attribute", "5": "py:exception"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "function", "Python function"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "exception", "Python exception"]}, "titleterms": {"api": 0, "document": 0, "pyqstrat": [0, 1, 2], "content": [0, 2], "indic": 0, "tabl": 0, "packag": 2, "submodul": 2, "pq_util": 2, "modul": 2, "pq_type": 2, "pq_io": 2, "holiday_calendar": 2, "account": 2, "strategi": 2, "portfolio": 2, "optim": 2, "evalu": 2, "pyqstrat_cpp": 2, "pyqstrat_io": 2, "market": 2, "strategy_build": 2, "strategy_compon": 2, "interactive_plot": 2}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"API documentation for pyqstrat": [[0, "api-documentation-for-pyqstrat"]], "Contents:": [[0, null]], "Indices and tables": [[0, "indices-and-tables"]], "pyqstrat": [[1, "pyqstrat"]], "pyqstrat package": [[2, "pyqstrat-package"]], "Submodules": [[2, "submodules"]], "pyqstrat.pq_utils module": [[2, "module-pyqstrat.pq_utils"]], "pyqstrat.pq_types module": [[2, "module-pyqstrat.pq_types"]], "pyqstrat.pq_io module": [[2, "module-pyqstrat.pq_io"]], "pyqstrat.holiday_calendars module": [[2, "module-pyqstrat.holiday_calendars"]], "pyqstrat.account module": [[2, "module-pyqstrat.account"]], "pyqstrat.strategy module": [[2, "module-pyqstrat.strategy"]], "pyqstrat.portfolio module": [[2, "module-pyqstrat.portfolio"]], "pyqstrat.optimize module": [[2, "module-pyqstrat.optimize"]], "pyqstrat.evaluator module": [[2, "module-pyqstrat.evaluator"]], "pyqstrat.pyqstrat_cpp module": [[2, "module-pyqstrat.pyqstrat_cpp"]], "pyqstrat.pyqstrat_io module": [[2, "module-pyqstrat.pyqstrat_io"]], "pyqstrat.markets module": [[2, "module-pyqstrat.markets"]], "pyqstrat.strategy_builder module": [[2, "module-pyqstrat.strategy_builder"]], "pyqstrat.strategy_components module": [[2, "module-pyqstrat.strategy_components"]], "pyqstrat.interactive_plot module": [[2, "module-pyqstrat.interactive_plot"]], "Module contents": [[2, "module-pyqstrat"]]}, "indexentries": {"account (class in pyqstrat.account)": [[2, "pyqstrat.account.Account"]], "cancelled (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.CANCELLED"]], "cancel_requested (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.CANCEL_REQUESTED"]], "calendar (class in pyqstrat.holiday_calendars)": [[2, "pyqstrat.holiday_calendars.Calendar"]], "closepositionexitrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule"]], "contract (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Contract"]], "contractgroup (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.ContractGroup"]], "contractpnl (class in pyqstrat.account)": [[2, "pyqstrat.account.ContractPNL"]], "day (pyqstrat.pq_types.timeinforce attribute)": [[2, "pyqstrat.pq_types.TimeInForce.DAY"]], "eminifuture (class in pyqstrat.markets)": [[2, "pyqstrat.markets.EminiFuture"]], "eminioption (class in pyqstrat.markets)": [[2, "pyqstrat.markets.EminiOption"]], "evaluator (class in pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.Evaluator"]], "experiment (class in pyqstrat.optimize)": [[2, "pyqstrat.optimize.Experiment"]], "filled (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.FILLED"]], "fok (pyqstrat.pq_types.timeinforce attribute)": [[2, "pyqstrat.pq_types.TimeInForce.FOK"]], "finiteriskentryrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule"]], "gtc (pyqstrat.pq_types.timeinforce attribute)": [[2, "pyqstrat.pq_types.TimeInForce.GTC"]], "interactiveplot (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.InteractivePlot"]], "limitorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.LimitOrder"]], "lineconfig (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.LineConfig"]], "linegraphwithdetaildisplay (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.LineGraphWithDetailDisplay"]], "marketorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.MarketOrder"]], "meanwithci (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.MeanWithCI"]], "open (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.OPEN"]], "optimizer (class in pyqstrat.optimize)": [[2, "pyqstrat.optimize.Optimizer"]], "order (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Order"]], "orderstatus (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.OrderStatus"]], "partially_filled (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.PARTIALLY_FILLED"]], "pqexception": [[2, "pyqstrat.pq_utils.PQException"]], "paths (class in pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.Paths"]], "percentofequitytradingrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule"]], "portfolio (class in pyqstrat.portfolio)": [[2, "pyqstrat.portfolio.Portfolio"]], "price (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Price"]], "pricefuncarraydict (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict"]], "pricefuncdict (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.PriceFuncDict"]], "rollorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.RollOrder"]], "roundtriptrade (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.RoundTripTrade"]], "simpledetailtable (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.SimpleDetailTable"]], "simplemarketsimulator (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator"]], "simpletransform (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.SimpleTransform"]], "stoplimitorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.StopLimitOrder"]], "strategy (class in pyqstrat.strategy)": [[2, "pyqstrat.strategy.Strategy"]], "strategybuilder (class in pyqstrat.strategy_builder)": [[2, "pyqstrat.strategy_builder.StrategyBuilder"]], "testinteractiveplot (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.TestInteractivePlot"]], "timeinforce (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.TimeInForce"]], "trade (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Trade"]], "vwapcloserule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VWAPCloseRule"]], "vwapentryrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VWAPEntryRule"]], "vwapmarketsimulator (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator"]], "vwaporder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.VWAPOrder"]], "vectorindicator (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VectorIndicator"]], "vectorsignal (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VectorSignal"]], "__call__() (pyqstrat.interactive_plot.linegraphwithdetaildisplay method)": [[2, "pyqstrat.interactive_plot.LineGraphWithDetailDisplay.__call__"]], "__call__() (pyqstrat.interactive_plot.meanwithci method)": [[2, "pyqstrat.interactive_plot.MeanWithCI.__call__"]], "__call__() (pyqstrat.interactive_plot.simpledetailtable method)": [[2, "pyqstrat.interactive_plot.SimpleDetailTable.__call__"]], "__call__() (pyqstrat.interactive_plot.simpletransform method)": [[2, "pyqstrat.interactive_plot.SimpleTransform.__call__"]], "__call__() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.__call__"]], "__call__() (pyqstrat.strategy_components.closepositionexitrule method)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.__call__"]], "__call__() (pyqstrat.strategy_components.finiteriskentryrule method)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.__call__"]], "__call__() (pyqstrat.strategy_components.percentofequitytradingrule method)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.__call__"]], "__call__() (pyqstrat.strategy_components.pricefuncarraydict method)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict.__call__"]], "__call__() (pyqstrat.strategy_components.pricefuncdict method)": [[2, "pyqstrat.strategy_components.PriceFuncDict.__call__"]], "__call__() (pyqstrat.strategy_components.simplemarketsimulator method)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.__call__"]], "__call__() (pyqstrat.strategy_components.vwapcloserule method)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.__call__"]], "__call__() (pyqstrat.strategy_components.vwapentryrule method)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.__call__"]], "__call__() (pyqstrat.strategy_components.vwapmarketsimulator method)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.__call__"]], "__call__() (pyqstrat.strategy_components.vectorindicator method)": [[2, "pyqstrat.strategy_components.VectorIndicator.__call__"]], "__call__() (pyqstrat.strategy_components.vectorsignal method)": [[2, "pyqstrat.strategy_components.VectorSignal.__call__"]], "__init__() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.__init__"]], "__init__() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.__init__"]], "__init__() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.__init__"]], "__init__() (pyqstrat.interactive_plot.interactiveplot method)": [[2, "pyqstrat.interactive_plot.InteractivePlot.__init__"]], "__init__() (pyqstrat.interactive_plot.lineconfig method)": [[2, "pyqstrat.interactive_plot.LineConfig.__init__"]], "__init__() (pyqstrat.interactive_plot.linegraphwithdetaildisplay method)": [[2, "pyqstrat.interactive_plot.LineGraphWithDetailDisplay.__init__"]], "__init__() (pyqstrat.interactive_plot.meanwithci method)": [[2, "pyqstrat.interactive_plot.MeanWithCI.__init__"]], "__init__() (pyqstrat.interactive_plot.simpledetailtable method)": [[2, "pyqstrat.interactive_plot.SimpleDetailTable.__init__"]], "__init__() (pyqstrat.interactive_plot.simpletransform method)": [[2, "pyqstrat.interactive_plot.SimpleTransform.__init__"]], "__init__() (pyqstrat.optimize.experiment method)": [[2, "pyqstrat.optimize.Experiment.__init__"]], "__init__() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.__init__"]], "__init__() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.__init__"]], "__init__() (pyqstrat.pq_types.trade method)": [[2, "pyqstrat.pq_types.Trade.__init__"]], "__init__() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.__init__"]], "__init__() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.__init__"]], "__init__() (pyqstrat.strategy_components.closepositionexitrule method)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.__init__"]], "__init__() (pyqstrat.strategy_components.finiteriskentryrule method)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.__init__"]], "__init__() (pyqstrat.strategy_components.percentofequitytradingrule method)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.__init__"]], "__init__() (pyqstrat.strategy_components.pricefuncarraydict method)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict.__init__"]], "__init__() (pyqstrat.strategy_components.pricefuncdict method)": [[2, "pyqstrat.strategy_components.PriceFuncDict.__init__"]], "__init__() (pyqstrat.strategy_components.simplemarketsimulator method)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.__init__"]], "__init__() (pyqstrat.strategy_components.vwapcloserule method)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.__init__"]], "__init__() (pyqstrat.strategy_components.vwapentryrule method)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.__init__"]], "__init__() (pyqstrat.strategy_components.vwapmarketsimulator method)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.__init__"]], "__init__() (pyqstrat.strategy_components.vectorindicator method)": [[2, "pyqstrat.strategy_components.VectorIndicator.__init__"]], "__init__() (pyqstrat.strategy_components.vectorsignal method)": [[2, "pyqstrat.strategy_components.VectorSignal.__init__"]], "add_contract() (pyqstrat.pq_types.contractgroup method)": [[2, "pyqstrat.pq_types.ContractGroup.add_contract"]], "add_contract() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_contract"]], "add_contract_group() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_contract_group"]], "add_indicator() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_indicator"]], "add_indicator() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_indicator"]], "add_market_sim() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_market_sim"]], "add_market_sim() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_market_sim"]], "add_metric() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.add_metric"]], "add_rule() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_rule"]], "add_rule() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_rule"]], "add_series_indicator() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_series_indicator"]], "add_series_rule() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_series_rule"]], "add_signal() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_signal"]], "add_signal() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_signal"]], "add_strategy() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.add_strategy"]], "add_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.add_trades"]], "add_trading_days() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.add_trading_days"]], "ask (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.ask"]], "ask_size (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.ask_size"]], "assert_() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.assert_"]], "backup_price_indicator (pyqstrat.strategy_components.vwapmarketsimulator attribute)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.backup_price_indicator"]], "bid (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.bid"]], "bid_size (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.bid_size"]], "black_scholes_price() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.black_scholes_price"]], "bootstrap_ci() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.bootstrap_ci"]], "calc() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.calc"]], "calc_net_pnl() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.calc_net_pnl"]], "calendar (pyqstrat.markets.eminifuture attribute)": [[2, "pyqstrat.markets.EminiFuture.calendar"]], "calendar (pyqstrat.markets.eminioption attribute)": [[2, "pyqstrat.markets.EminiOption.calendar"]], "cancel() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.cancel"]], "cdf() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.cdf"]], "clear_cache() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.clear_cache"]], "clear_cache() (pyqstrat.pq_types.contractgroup static method)": [[2, "pyqstrat.pq_types.ContractGroup.clear_cache"]], "close_qty (pyqstrat.pq_types.rollorder attribute)": [[2, "pyqstrat.pq_types.RollOrder.close_qty"]], "color (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.color"]], "commission (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.commission"]], "components (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.components"]], "compute() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.compute"]], "compute_amean() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_amean"]], "compute_annual_returns() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_annual_returns"]], "compute_bucketed_returns() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_bucketed_returns"]], "compute_calmar() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_calmar"]], "compute_dates_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_dates_3yr"]], "compute_equity() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_equity"]], "compute_gmean() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_gmean"]], "compute_k_ratio() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_k_ratio"]], "compute_mar() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_mar"]], "compute_maxdd_date() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_date"]], "compute_maxdd_date_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_date_3yr"]], "compute_maxdd_pct() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_pct"]], "compute_maxdd_pct_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_pct_3yr"]], "compute_maxdd_start() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_start"]], "compute_maxdd_start_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_start_3yr"]], "compute_metric() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.compute_metric"]], "compute_num_periods() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_num_periods"]], "compute_periods_per_year() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_periods_per_year"]], "compute_return_metrics() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_return_metrics"]], "compute_returns_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_returns_3yr"]], "compute_rolling_dd() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_rolling_dd"]], "compute_rolling_dd_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_rolling_dd_3yr"]], "compute_sharpe() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_sharpe"]], "compute_sortino() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_sortino"]], "compute_std() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_std"]], "contract (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.contract"]], "contract (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.contract"]], "contract_filter (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.contract_filter"]], "contract_group (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.contract_group"]], "contract_groups (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.contract_groups"]], "contracts (pyqstrat.pq_types.contractgroup attribute)": [[2, "pyqstrat.pq_types.ContractGroup.contracts"]], "create() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.create"]], "create() (pyqstrat.pq_utils.paths method)": [[2, "pyqstrat.pq_utils.Paths.create"]], "create_pivot() (pyqstrat.interactive_plot.interactiveplot method)": [[2, "pyqstrat.interactive_plot.InteractivePlot.create_pivot"]], "create_selection_dropdowns() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.create_selection_dropdowns"]], "d1() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.d1"]], "d2() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.d2"]], "data (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.data"]], "day_of_week_num() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.day_of_week_num"]], "day_symbol() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.day_symbol"]], "decode_symbol() (pyqstrat.markets.eminioption static method)": [[2, "pyqstrat.markets.EminiOption.decode_symbol"]], "delta() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.delta"]], "df() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.df"]], "df_account_pnl() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_account_pnl"]], "df_data() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_data"]], "df_experiments() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.df_experiments"]], "df_orders() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_orders"]], "df_pnl() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_pnl"]], "df_pnl() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_pnl"]], "df_returns() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.df_returns"]], "df_returns() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_returns"]], "df_roundtrip_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_roundtrip_trades"]], "df_roundtrip_trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_roundtrip_trades"]], "df_to_hdf5() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.df_to_hdf5"]], "df_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_trades"]], "df_trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_trades"]], "display_form() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.display_form"]], "display_return_metrics() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.display_return_metrics"]], "entry_commission (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_commission"]], "entry_order (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_order"]], "entry_price (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_price"]], "entry_properties (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_properties"]], "entry_reason (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_reason"]], "entry_timestamp (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_timestamp"]], "equity() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.equity"]], "equity_percent (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.equity_percent"]], "evaluate_returns() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.evaluate_returns"]], "evaluate_returns() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.evaluate_returns"]], "exists() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.exists"]], "exists() (pyqstrat.pq_types.contractgroup static method)": [[2, "pyqstrat.pq_types.ContractGroup.exists"]], "exit_commission (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_commission"]], "exit_order (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_order"]], "exit_price (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_price"]], "exit_properties (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_properties"]], "exit_reason (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_reason"]], "exit_timestamp (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_timestamp"]], "experiment_list() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.experiment_list"]], "expiry (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.expiry"]], "fill() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.fill"]], "find_in_subdir() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.find_in_subdir"]], "find_index_before() (in module pyqstrat.account)": [[2, "pyqstrat.account.find_index_before"]], "find_last_non_nan_index() (in module pyqstrat.account)": [[2, "pyqstrat.account.find_last_non_nan_index"]], "flatten_keys() (in module pyqstrat.optimize)": [[2, "pyqstrat.optimize.flatten_keys"]], "foo() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.foo"]], "future_code_to_month() (in module pyqstrat.markets)": [[2, "pyqstrat.markets.future_code_to_month"]], "future_code_to_month_number() (in module pyqstrat.markets)": [[2, "pyqstrat.markets.future_code_to_month_number"]], "gamma() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.gamma"]], "get() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.get"]], "get() (pyqstrat.pq_types.contractgroup static method)": [[2, "pyqstrat.pq_types.ContractGroup.get"]], "get_child_logger() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_child_logger"]], "get_config() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_config"]], "get_contract() (pyqstrat.pq_types.contractgroup method)": [[2, "pyqstrat.pq_types.ContractGroup.get_contract"]], "get_contract_price_from_array_dict() (in module pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.get_contract_price_from_array_dict"]], "get_contract_price_from_dict() (in module pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.get_contract_price_from_dict"]], "get_contracts() (pyqstrat.pq_types.contractgroup method)": [[2, "pyqstrat.pq_types.ContractGroup.get_contracts"]], "get_current_symbol() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_current_symbol"]], "get_date_from_weekday() (in module pyqstrat.holiday_calendars)": [[2, "pyqstrat.holiday_calendars.get_date_from_weekday"]], "get_empty_np_value() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_empty_np_value"]], "get_expiry() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_expiry"]], "get_expiry() (pyqstrat.markets.eminioption static method)": [[2, "pyqstrat.markets.EminiOption.get_expiry"]], "get_future_code() (in module pyqstrat.markets)": [[2, "pyqstrat.markets.get_future_code"]], "get_main_logger() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_main_logger"]], "get_next_symbol() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_next_symbol"]], "get_paths() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_paths"]], "get_previous_symbol() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_previous_symbol"]], "get_temp_dir() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_temp_dir"]], "get_trades_for_date() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.get_trades_for_date"]], "get_trading_days() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.get_trading_days"]], "handle_non_finite_returns() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.handle_non_finite_returns"]], "has_display() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.has_display"]], "hdf5_copy() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_copy"]], "hdf5_repack() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_repack"]], "hdf5_to_df() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_to_df"]], "hdf5_to_np_arrays() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_to_np_arrays"]], "implied_vol() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.implied_vol"]], "in_ipython() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.in_ipython"]], "indicators (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.indicators"]], "infer_compression() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.infer_compression"]], "infer_frequency() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.infer_frequency"]], "invalid() (pyqstrat.pq_types.price static method)": [[2, "pyqstrat.pq_types.Price.invalid"]], "is_basket() (pyqstrat.pq_types.contract method)": [[2, "pyqstrat.pq_types.Contract.is_basket"]], "is_newer() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.is_newer"]], "is_open() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.is_open"]], "is_trading_day() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.is_trading_day"]], "leading_nan_to_zero() (in module pyqstrat.account)": [[2, "pyqstrat.account.leading_nan_to_zero"]], "limit_increment (pyqstrat.strategy_components.closepositionexitrule attribute)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.limit_increment"]], "limit_increment (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.limit_increment"]], "limit_price (pyqstrat.pq_types.limitorder attribute)": [[2, "pyqstrat.pq_types.LimitOrder.limit_price"]], "limit_price (pyqstrat.pq_types.stoplimitorder attribute)": [[2, "pyqstrat.pq_types.StopLimitOrder.limit_price"]], "linear_interpolate() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.linear_interpolate"]], "long (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.long"]], "long (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.long"]], "long (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.long"]], "marker_mode (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.marker_mode"]], "market_sims (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.market_sims"]], "metric() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.metric"]], "metrics() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.metrics"]], "mid() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.mid"]], "millis_since_epoch() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.millis_since_epoch"]], "min_price_diff (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.min_price_diff"]], "min_price_diff (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.min_price_diff"]], "module": [[2, "module-pyqstrat"], [2, "module-pyqstrat.account"], [2, "module-pyqstrat.evaluator"], [2, "module-pyqstrat.holiday_calendars"], [2, "module-pyqstrat.interactive_plot"], [2, "module-pyqstrat.markets"], [2, "module-pyqstrat.optimize"], [2, "module-pyqstrat.portfolio"], [2, "module-pyqstrat.pq_io"], [2, "module-pyqstrat.pq_types"], [2, "module-pyqstrat.pq_utils"], [2, "module-pyqstrat.pyqstrat_cpp"], [2, "module-pyqstrat.pyqstrat_io"], [2, "module-pyqstrat.strategy"], [2, "module-pyqstrat.strategy_builder"], [2, "module-pyqstrat.strategy_components"]], "monotonically_increasing() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.monotonically_increasing"]], "multiplier (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.multiplier"]], "name (pyqstrat.pq_types.contractgroup attribute)": [[2, "pyqstrat.pq_types.ContractGroup.name"]], "nan_to_zero() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.nan_to_zero"]], "net_pnl (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.net_pnl"]], "net_pnl() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.net_pnl"]], "np_arrays_to_hdf5() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.np_arrays_to_hdf5"]], "np_bucket() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_bucket"]], "np_find_closest() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_find_closest"]], "np_inc_dates() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_inc_dates"]], "np_indexof() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_indexof"]], "np_indexof_sorted() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_indexof_sorted"]], "np_parse_array() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_parse_array"]], "np_rolling_window() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_rolling_window"]], "np_round() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_round"]], "np_uniques() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_uniques"]], "num_trading_days() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.num_trading_days"]], "on_widgets_updated() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.on_widgets_updated"]], "orders() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.orders"]], "parse_datetimes() (in module pyqstrat.pyqstrat_io)": [[2, "pyqstrat.pyqstrat_io.parse_datetimes"]], "percent_of_equity (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.percent_of_equity"]], "percent_of_equity (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.percent_of_equity"]], "percentile_buckets() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.percentile_buckets"]], "percentile_of_score() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.percentile_of_score"]], "plot() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.plot"]], "plot_2d() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.plot_2d"]], "plot_3d() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.plot_3d"]], "plot_return_metrics() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.plot_return_metrics"]], "plot_returns() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.plot_returns"]], "pnl() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.pnl"]], "pnl_calc_time (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.pnl_calc_time"]], "position() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.position"]], "position() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.position"]], "positions() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.positions"]], "price_dict (pyqstrat.strategy_components.pricefuncarraydict attribute)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict.price_dict"]], "price_dict (pyqstrat.strategy_components.pricefuncdict attribute)": [[2, "pyqstrat.strategy_components.PriceFuncDict.price_dict"]], "price_func (pyqstrat.strategy_components.closepositionexitrule attribute)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.price_func"]], "price_func (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.price_func"]], "price_func (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.price_func"]], "price_func (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.price_func"]], "price_func (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.price_func"]], "price_function (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.price_function"]], "price_indicator (pyqstrat.strategy_components.vwapmarketsimulator attribute)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.price_indicator"]], "properties (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.properties"]], "properties (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.properties"]], "properties (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.properties"]], "pyqstrat": [[2, "module-pyqstrat"]], "pyqstrat.account": [[2, "module-pyqstrat.account"]], "pyqstrat.evaluator": [[2, "module-pyqstrat.evaluator"]], "pyqstrat.holiday_calendars": [[2, "module-pyqstrat.holiday_calendars"]], "pyqstrat.interactive_plot": [[2, "module-pyqstrat.interactive_plot"]], "pyqstrat.markets": [[2, "module-pyqstrat.markets"]], "pyqstrat.optimize": [[2, "module-pyqstrat.optimize"]], "pyqstrat.portfolio": [[2, "module-pyqstrat.portfolio"]], "pyqstrat.pq_io": [[2, "module-pyqstrat.pq_io"]], "pyqstrat.pq_types": [[2, "module-pyqstrat.pq_types"]], "pyqstrat.pq_utils": [[2, "module-pyqstrat.pq_utils"]], "pyqstrat.pyqstrat_cpp": [[2, "module-pyqstrat.pyqstrat_cpp"]], "pyqstrat.pyqstrat_io": [[2, "module-pyqstrat.pyqstrat_io"]], "pyqstrat.strategy": [[2, "module-pyqstrat.strategy"]], "pyqstrat.strategy_builder": [[2, "module-pyqstrat.strategy_builder"]], "pyqstrat.strategy_components": [[2, "module-pyqstrat.strategy_components"]], "qty (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.qty"]], "qty (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.qty"]], "read_file() (in module pyqstrat.pyqstrat_io)": [[2, "pyqstrat.pyqstrat_io.read_file"]], "reason_code (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.reason_code"]], "reason_code (pyqstrat.strategy_components.closepositionexitrule attribute)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.reason_code"]], "reason_code (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.reason_code"]], "reason_code (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.reason_code"]], "reason_code (pyqstrat.strategy_components.vwapcloserule attribute)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.reason_code"]], "reason_code (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.reason_code"]], "remove_dups() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.remove_dups"]], "reopen_qty (pyqstrat.pq_types.rollorder attribute)": [[2, "pyqstrat.pq_types.RollOrder.reopen_qty"]], "request_cancel() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.request_cancel"]], "resample_trade_bars() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.resample_trade_bars"]], "resample_ts() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.resample_ts"]], "resample_vwap() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.resample_vwap"]], "rho() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.rho"]], "roundtrip_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.roundtrip_trades"]], "roundtrip_trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.roundtrip_trades"]], "rules (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.rules"]], "run() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.run"]], "run() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run"]], "run() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run"]], "run_indicators() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run_indicators"]], "run_indicators() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run_indicators"]], "run_rules() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run_rules"]], "run_rules() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run_rules"]], "run_signals() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run_signals"]], "run_signals() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run_signals"]], "secondary_y (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.secondary_y"]], "series_to_array() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.series_to_array"]], "set_defaults() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.set_defaults"]], "set_ipython_defaults() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.set_ipython_defaults"]], "set_pnl_calc_time() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_pnl_calc_time"]], "set_price_function() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_price_function"]], "set_property() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.set_property"]], "set_starting_equity() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_starting_equity"]], "set_strategy_context() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_strategy_context"]], "set_timestamps() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_timestamps"]], "set_trade_lag() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_trade_lag"]], "shift_np() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.shift_np"]], "show_detail (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.show_detail"]], "signals (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.signals"]], "simple_data_filter() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.simple_data_filter"]], "simple_dimension_filter() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.simple_dimension_filter"]], "single_entry_per_day (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.single_entry_per_day"]], "single_entry_per_day (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.single_entry_per_day"]], "slippage (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.slippage"]], "spread() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.spread"]], "starting_equity (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.starting_equity"]], "status (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.status"]], "stop_price_ind (pyqstrat.strategy_components.finiteriskentryrule attribute)": [[2, "pyqstrat.strategy_components.FiniteRiskEntryRule.stop_price_ind"]], "stop_price_ind (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.stop_price_ind"]], "str2date() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.str2date"]], "strategy_context (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.strategy_context"]], "strtup2date() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.strtup2date"]], "symbol (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.symbol"]], "symbols() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.symbols"]], "test_account() (in module pyqstrat.account)": [[2, "pyqstrat.account.test_account"]], "test_evaluator() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.test_evaluator"]], "test_hdf5_to_df() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.test_hdf5_to_df"]], "test_interactive_plot() (pyqstrat.interactive_plot.testinteractiveplot method)": [[2, "pyqstrat.interactive_plot.TestInteractivePlot.test_interactive_plot"]], "test_optimize() (in module pyqstrat.optimize)": [[2, "pyqstrat.optimize.test_optimize"]], "theta() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.theta"]], "thickness (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.thickness"]], "third_friday_of_month() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.third_friday_of_month"]], "time_in_force (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.time_in_force"]], "timestamp (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.timestamp"]], "timestamp (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.timestamp"]], "timestamp_unit (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.timestamp_unit"]], "timestamps (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.timestamps"]], "to_csv() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.to_csv"]], "touch() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.touch"]], "trade_lag (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.trade_lag"]], "trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.trades"]], "trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.trades"]], "transform() (pyqstrat.interactive_plot.testinteractiveplot method)": [[2, "pyqstrat.interactive_plot.TestInteractivePlot.transform"]], "trigger_price (pyqstrat.pq_types.stoplimitorder attribute)": [[2, "pyqstrat.pq_types.StopLimitOrder.trigger_price"]], "triggered (pyqstrat.pq_types.stoplimitorder attribute)": [[2, "pyqstrat.pq_types.StopLimitOrder.triggered"]], "try_frequency() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.try_frequency"]], "update() (pyqstrat.interactive_plot.interactiveplot method)": [[2, "pyqstrat.interactive_plot.InteractivePlot.update"]], "valid (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.valid"]], "valid() (pyqstrat.optimize.experiment method)": [[2, "pyqstrat.optimize.Experiment.valid"]], "vector (pyqstrat.strategy_components.vectorindicator attribute)": [[2, "pyqstrat.strategy_components.VectorIndicator.vector"]], "vector (pyqstrat.strategy_components.vectorsignal attribute)": [[2, "pyqstrat.strategy_components.VectorSignal.vector"]], "vega() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.vega"]], "volume_indicator (pyqstrat.strategy_components.vwapmarketsimulator attribute)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.volume_indicator"]], "vw_mid() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.vw_mid"]], "vwap_end_time (pyqstrat.pq_types.vwaporder attribute)": [[2, "pyqstrat.pq_types.VWAPOrder.vwap_end_time"]], "vwap_minutes (pyqstrat.strategy_components.vwapcloserule attribute)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.vwap_minutes"]], "vwap_minutes (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.vwap_minutes"]], "vwap_stop (pyqstrat.pq_types.vwaporder attribute)": [[2, "pyqstrat.pq_types.VWAPOrder.vwap_stop"]], "zero_to_nan() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.zero_to_nan"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["index", "modules", "pyqstrat"], "filenames": ["index.rst", "modules.rst", "pyqstrat.rst"], "titles": ["API documentation for pyqstrat", "pyqstrat", "pyqstrat package"], "terms": {"pleas": 0, "read": [0, 2], "readm": 0, "rst": 0, "main": [0, 2], "directori": [0, 2], "get": [0, 1, 2], "start": [0, 2], "packag": [0, 1], "index": [0, 2], "modul": [0, 1], "search": 0, "page": 0, "submodul": 1, "pq_util": 1, "pqexcept": [1, 2], "path": [1, 2], "creat": [1, 2], "assert_": [1, 2], "bootstrap_ci": [1, 2], "day_of_week_num": [1, 2], "day_symbol": [1, 2], "find_in_subdir": [1, 2], "get_child_logg": [1, 2], "get_config": [1, 2], "get_empty_np_valu": [1, 2], "get_main_logg": [1, 2], "get_path": [1, 2], "get_temp_dir": [1, 2], "has_displai": [1, 2], "in_debug": [1, 2], "in_ipython": [1, 2], "infer_compress": [1, 2], "infer_frequ": [1, 2], "is_new": [1, 2], "linear_interpol": [1, 2], "millis_since_epoch": [1, 2], "monotonically_increas": [1, 2], "nan_to_zero": [1, 2], "np_bucket": [1, 2], "np_find_closest": [1, 2], "np_inc_dat": [1, 2], "np_indexof": [1, 2], "np_indexof_sort": [1, 2], "np_parse_arrai": [1, 2], "np_rolling_window": [1, 2], "np_round": [1, 2], "np_uniqu": [1, 2], "percentile_of_scor": [1, 2], "remove_dup": [1, 2], "resample_trade_bar": [1, 2], "resample_t": [1, 2], "resample_vwap": [1, 2], "series_to_arrai": [1, 2], "set_default": [1, 2], "set_ipython_default": [1, 2], "shift_np": [1, 2], "str2date": [1, 2], "strtup2dat": [1, 2], "to_csv": [1, 2], "touch": [1, 2], "try_frequ": [1, 2], "zero_to_nan": [1, 2], "pq_type": 1, "contract": [1, 2], "clear_cach": [1, 2], "compon": [1, 2], "contract_group": [1, 2], "exist": [1, 2], "expiri": [1, 2], "get_or_cr": [1, 2], "is_basket": [1, 2], "multipli": [1, 2], "properti": [1, 2], "symbol": [1, 2], "contractgroup": [1, 2], "add_contract": [1, 2], "clear": [1, 2], "get_contract": [1, 2], "get_default": [1, 2], "name": [1, 2], "limitord": [1, 2], "limit_pric": [1, 2], "marketord": [1, 2], "order": [1, 2], "cancel": [1, 2], "fill": [1, 2], "is_open": [1, 2], "qty": [1, 2], "reason_cod": [1, 2], "request_cancel": [1, 2], "statu": [1, 2], "time_in_forc": [1, 2], "timestamp": [1, 2], "orderstatu": [1, 2], "cancel_request": [1, 2], "open": [1, 2], "partially_fil": [1, 2], "price": [1, 2], "ask": [1, 2], "ask_siz": [1, 2], "bid": [1, 2], "bid_siz": [1, 2], "invalid": [1, 2], "mid": [1, 2], "set_properti": [1, 2], "spread": [1, 2], "valid": [1, 2], "vw_mid": [1, 2], "rollord": [1, 2], "close_qti": [1, 2], "reopen_qti": [1, 2], "roundtriptrad": [1, 2], "entry_commiss": [1, 2], "entry_ord": [1, 2], "entry_pric": [1, 2], "entry_properti": [1, 2], "entry_reason": [1, 2], "entry_timestamp": [1, 2], "exit_commiss": [1, 2], "exit_ord": [1, 2], "exit_pric": [1, 2], "exit_properti": [1, 2], "exit_reason": [1, 2], "exit_timestamp": [1, 2], "net_pnl": [1, 2], "stoplimitord": [1, 2], "trigger_pric": [1, 2], "trigger": [1, 2], "timeinforc": [1, 2], "dai": [1, 2], "fok": [1, 2], "gtc": [1, 2], "trade": [1, 2], "__init__": [1, 2], "vwapord": [1, 2], "vwap_end_tim": [1, 2], "vwap_stop": [1, 2], "pq_io": 1, "df_to_hdf5": [1, 2], "hdf5_copi": [1, 2], "hdf5_repack": [1, 2], "hdf5_to_df": [1, 2], "hdf5_to_np_arrai": [1, 2], "np_arrays_to_hdf5": [1, 2], "test_hdf5_to_df": [1, 2], "holiday_calendar": 1, "calendar": [1, 2], "add_trading_dai": [1, 2], "get_trading_dai": [1, 2], "is_trading_dai": [1, 2], "num_trading_dai": [1, 2], "third_friday_of_month": [1, 2], "get_date_from_weekdai": [1, 2], "account": 1, "add_trad": [1, 2], "calc": [1, 2], "df_account_pnl": [1, 2], "df_pnl": [1, 2], "df_roundtrip_trad": [1, 2], "df_trade": [1, 2], "equiti": [1, 2], "get_trades_for_d": [1, 2], "posit": [1, 2], "roundtrip_trad": [1, 2], "contractpnl": [1, 2], "calc_net_pnl": [1, 2], "df": [1, 2], "pnl": [1, 2], "find_index_befor": [1, 2], "find_last_non_nan_index": [1, 2], "leading_nan_to_zero": [1, 2], "test_account": [1, 2], "strategi": 1, "add_ind": [1, 2], "add_market_sim": [1, 2], "add_rul": [1, 2], "add_sign": [1, 2], "df_data": [1, 2], "df_order": [1, 2], "df_return": [1, 2], "evaluate_return": [1, 2], "plot_return": [1, 2], "run": [1, 2], "run_ind": [1, 2], "run_rul": [1, 2], "run_sign": [1, 2], "portfolio": 1, "add_strategi": [1, 2], "plot": [1, 2], "optim": 1, "experi": [1, 2], "df_experi": [1, 2], "experiment_list": [1, 2], "plot_2d": [1, 2], "plot_3d": [1, 2], "flatten_kei": [1, 2], "test_optim": [1, 2], "evalu": 1, "add_metr": [1, 2], "comput": [1, 2], "compute_metr": [1, 2], "metric": [1, 2], "compute_amean": [1, 2], "compute_annual_return": [1, 2], "compute_bucketed_return": [1, 2], "compute_calmar": [1, 2], "compute_dates_3yr": [1, 2], "compute_equ": [1, 2], "compute_gmean": [1, 2], "compute_k_ratio": [1, 2], "compute_mar": [1, 2], "compute_maxdd_d": [1, 2], "compute_maxdd_date_3yr": [1, 2], "compute_maxdd_pct": [1, 2], "compute_maxdd_pct_3yr": [1, 2], "compute_maxdd_start": [1, 2], "compute_maxdd_start_3yr": [1, 2], "compute_num_period": [1, 2], "compute_periods_per_year": [1, 2], "compute_return_metr": [1, 2], "compute_returns_3yr": [1, 2], "compute_rolling_dd": [1, 2], "compute_rolling_dd_3yr": [1, 2], "compute_sharp": [1, 2], "compute_sortino": [1, 2], "compute_std": [1, 2], "display_return_metr": [1, 2], "handle_non_finite_return": [1, 2], "plot_return_metr": [1, 2], "test_evalu": [1, 2], "pyqstrat_cpp": 1, "black_scholes_pric": [1, 2], "cdf": [1, 2], "d1": [1, 2], "d2": [1, 2], "delta": [1, 2], "gamma": [1, 2], "implied_vol": [1, 2], "rho": [1, 2], "theta": [1, 2], "vega": [1, 2], "pyqstrat_io": 1, "parse_datetim": [1, 2], "read_fil": [1, 2], "market": 1, "eminifutur": [1, 2], "get_current_symbol": [1, 2], "get_expiri": [1, 2], "get_next_symbol": [1, 2], "get_previous_symbol": [1, 2], "eminiopt": [1, 2], "decode_symbol": [1, 2], "future_code_to_month": [1, 2], "future_code_to_month_numb": [1, 2], "get_future_cod": [1, 2], "strategy_build": 1, "strategybuild": [1, 2], "__call__": [1, 2], "add_contract_group": [1, 2], "add_series_ind": [1, 2], "add_series_rul": [1, 2], "data": [1, 2], "indic": [1, 2], "log_ord": [1, 2], "log_trad": [1, 2], "market_sim": [1, 2], "pnl_calc_tim": [1, 2], "price_funct": [1, 2], "rule": [1, 2], "set_log_ord": [1, 2], "set_log_trad": [1, 2], "set_pnl_calc_tim": [1, 2], "set_price_funct": [1, 2], "set_starting_equ": [1, 2], "set_strategy_context": [1, 2], "set_timestamp": [1, 2], "set_trade_lag": [1, 2], "signal": [1, 2], "starting_equ": [1, 2], "strategy_context": [1, 2], "timestamp_unit": [1, 2], "trade_lag": [1, 2], "strategy_compon": 1, "bracketorderentryrul": [1, 2], "contract_filt": [1, 2], "long": [1, 2], "max_position_s": [1, 2], "min_stop_returnt": [1, 2], "percent_of_equ": [1, 2], "price_func": [1, 2], "single_entry_per_dai": [1, 2], "stop_return_func": [1, 2], "closepositionexitrul": [1, 2], "limit_incr": [1, 2], "percentofequitytradingrul": [1, 2], "allocate_risk": [1, 2], "equity_perc": [1, 2], "pricefuncarraydict": [1, 2], "allow_previ": [1, 2], "price_dict": [1, 2], "pricefuncarrai": [1, 2], "pricefuncdict": [1, 2], "simplemarketsimul": [1, 2], "commiss": [1, 2], "post_trade_func": [1, 2], "price_round": [1, 2], "slippage_pct": [1, 2], "stopreturnexitrul": [1, 2], "vwapcloserul": [1, 2], "vwap_minut": [1, 2], "vwapentryrul": [1, 2], "min_price_diff_pct": [1, 2], "stop_price_ind": [1, 2], "vwapmarketsimul": [1, 2], "backup_price_ind": [1, 2], "price_ind": [1, 2], "volume_ind": [1, 2], "vectorind": [1, 2], "vector": [1, 2], "vectorsign": [1, 2], "get_contract_price_from_array_dict": [1, 2], "get_contract_price_from_dict": [1, 2], "interactive_plot": 1, "interactiveplot": [1, 2], "create_pivot": [1, 2], "updat": [1, 2], "lineconfig": [1, 2], "color": [1, 2], "marker_mod": [1, 2], "secondary_i": [1, 2], "show_detail": [1, 2], "thick": [1, 2], "linegraphwithdetaildisplai": [1, 2], "meanwithci": [1, 2], "simpledetailt": [1, 2], "simpletransform": [1, 2], "testinteractiveplot": [1, 2], "test_interactive_plot": [1, 2], "transform": [1, 2], "create_selection_dropdown": [1, 2], "display_form": [1, 2], "foo": [1, 2], "on_widgets_upd": [1, 2], "percentile_bucket": [1, 2], "simple_data_filt": [1, 2], "simple_dimension_filt": [1, 2], "content": 1, "except": 2, "sourc": 2, "base": 2, "class": 2, "base_path": 2, "none": 2, "object": 2, "convent": 2, "where": 2, "write": 2, "report": 2, "return": 2, "type": 2, "condit": 2, "msg": 2, "like": 2, "python": 2, "assert": 2, "rais": 2, "an": 2, "i": 2, "turn": 2, "off": 2, "us": 2, "switch": 2, "ci_level": 2, "0": 2, "95": 2, "n": 2, "1000": 2, "func": 2, "function": 2, "mean": 2, "non": 2, "parametr": 2, "bootstrap": 2, "confid": 2, "interv": 2, "ndarrai": 2, "param": 2, "The": 2, "from": 2, "float": 2, "level": 2, "e": 2, "g": 2, "default": 2, "int": 2, "number": 2, "boostrap": 2, "iter": 2, "callabl": 2, "np": 2, "median": 2, "tupl": 2, "A": 2, "contain": 2, "lower": 2, "upper": 2, "ci": 2, "random": 2, "seed": 2, "x": 2, "uniform": 2, "high": 2, "10": 2, "size": 2, "100000": 2, "allclos": 2, "4": 2, "9773159": 2, "5": 2, "010328": 2, "http": 2, "stackoverflow": 2, "com": 2, "question": 2, "52398383": 2, "find": 2, "week": 2, "datetime64": 2, "numpi": 2, "arrai": 2, "datetim": 2, "mondai": 2, "sundai": 2, "6": 2, "paramet": 2, "2015": 2, "01": 2, "04": 2, "day_int": 2, "str": 2, "dir": 2, "filenam": 2, "rel": 2, "file": 2, "subdirectori": 2, "child_nam": 2, "logger": 2, "load": 2, "config": 2, "yaml": 2, "dict": 2, "thi": 2, "first": 2, "valu": 2, "call": 2, "yml": 2, "your": 2, "home": 2, "next": 2, "look": 2, "local": 2, "work": 2, "If": 2, "found": 2, "overrid": 2, "ani": 2, "np_dtype": 2, "empti": 2, "given": 2, "datatyp": 2, "2018": 2, "03": 2, "dtype": 2, "m8": 2, "d": 2, "nat": 2, "headless": 2, "machin": 2, "remot": 2, "server": 2, "so": 2, "we": 2, "don": 2, "t": 2, "try": 2, "show": 2, "graph": 2, "etc": 2, "dure": 2, "unit": 2, "test": 2, "bool": 2, "whether": 2, "ar": 2, "ipython": 2, "jupyt": 2, "environ": 2, "input_filenam": 2, "infer": 2, "compress": 2, "its": 2, "suffix": 2, "For": 2, "exampl": 2, "tmp": 2, "hello": 2, "gz": 2, "gzip": 2, "abc": 2, "txt": 2, "true": 2, "option": 2, "most": 2, "common": 2, "frequenc": 2, "date": 2, "differ": 2, "fraction": 2, "monoton": 2, "increas": 2, "11": 2, "00": 2, "15": 2, "30": 2, "35": 2, "traceback": 2, "recent": 2, "last": 2, "could": 2, "50": 2, "print": 2, "round": 2, "8": 2, "01041667": 2, "rtype": 2, "py": 2, "05": 2, "07": 2, "09": 2, "math": 2, "isclos": 2, "60": 2, "ref_filenam": 2, "ctime": 2, "modfic": 2, "time": 2, "newer": 2, "than": 2, "either": 2, "doe": 2, "import": 2, "tempfil": 2, "temp_dir": 2, "gettempdir": 2, "f": 2, "sleep": 2, "1": 2, "y": 2, "fals": 2, "a1": 2, "a2": 2, "x1": 2, "x2": 2, "3": 2, "9": 2, "45": 2, "isnan": 2, "dt": 2, "millisecond": 2, "between": 2, "unix": 2, "epoch": 2, "sinc": 2, "can": 2, "well": 2, "1514764800000": 2, "otherwis": 2, "02": 2, "convert": 2, "nan": 2, "bucket": 2, "default_valu": 2, "side": 2, "sort": 2, "list": 2, "assign": 2, "each": 2, "element": 2, "when": 2, "cannot": 2, "left": 2, "right": 2, "set": 2, "midpoint": 2, "same": 2, "length": 2, "18": 2, "12": 2, "25": 2, "v": 2, "8914491": 2, "nearest": 2, "closest": 2, "must": 2, "all": 2, "2": 2, "num_dai": 2, "increment": 2, "cell": 2, "higher": 2, "2021": 2, "06": 2, "08": 2, "check": 2, "array_equ": 2, "equal_nan": 2, "indexof_sort": 2, "": 2, "string": 2, "window": 2, "appli": 2, "roll": 2, "see": 2, "6811183": 2, "1d": 2, "std": 2, "clip": 2, "75": 2, "mai": 2, "have": 2, "gener": 2, "structur": 2, "uniqu": 2, "array1": 2, "array2": 2, "p": 2, "c": 2, "len": 2, "percentil": 2, "29989971": 2, "5351549": 2, "scipi": 2, "stat": 2, "percentileofscor": 2, "o": 2, "log": 2, "100": 2, "lst": 2, "key_func": 2, "remov": 2, "duplic": 2, "take": 2, "kei": 2, "detect": 2, "dup": 2, "stabl": 2, "sens": 2, "origin": 2, "retain": 2, "lambda": 2, "sampling_frequ": 2, "resample_func": 2, "downsampl": 2, "bar": 2, "sampl": 2, "pd": 2, "datafram": 2, "which": 2, "panda": 2, "dictionari": 2, "column": 2, "resampl": 2, "custom": 2, "defin": 2, "entri": 2, "13": 2, "h": 2, "7": 2, "l": 2, "200": 2, "150": 2, "300": 2, "400": 2, "vwap": 2, "set_index": 2, "inplac": 2, "agg": 2, "iloc": 2, "24": 2, "bin": 2, "edg": 2, "seri": 2, "weight": 2, "averag": 2, "volum": 2, "back": 2, "unchang": 2, "df_float_sf": 2, "df_display_max_row": 2, "df_display_max_column": 2, "99": 2, "np_seterr": 2, "some": 2, "displai": 2, "make": 2, "easier": 2, "view": 2, "signific": 2, "figur": 2, "row": 2, "you": 2, "them": 2, "error": 2, "mode": 2, "warn": 2, "seterr": 2, "detail": 2, "jupyter_multiple_displai": 2, "multipl": 2, "output": 2, "fill_valu": 2, "similar": 2, "shift": 2, "place": 2, "neg": 2, "after": 2, "slot": 2, "boolean": 2, "2008": 2, "tup": 2, "2009": 2, "16": 2, "file_nam": 2, "arg": 2, "kwarg": 2, "temporari": 2, "renam": 2, "perman": 2, "half": 2, "written": 2, "also": 2, "xz": 2, "algorithm": 2, "fname": 2, "438": 2, "dir_fd": 2, "replic": 2, "command": 2, "doesn": 2, "period": 2, "threshold": 2, "zero": 2, "static": 2, "our": 2, "cach": 2, "group": 2, "reprent": 2, "ibm": 2, "esh9": 2, "sometim": 2, "need": 2, "calcul": 2, "ha": 2, "futur": 2, "hedg": 2, "In": 2, "case": 2, "over": 2, "expir": 2, "want": 2, "track": 2, "leg": 2, "one": 2, "other": 2, "per": 2, "here": 2, "mini": 2, "would": 2, "simplenamespac": 2, "store": 2, "strike": 2, "contrat": 2, "stock": 2, "wai": 2, "out": 2, "factori": 2, "wa": 2, "share": 2, "quantiti": 2, "sell": 2, "reason": 2, "specif": 2, "fill_qti": 2, "enum": 2, "2020": 2, "189": 2, "4f": 2, "4433": 2, "stop": 2, "loss": 2, "limit": 2, "goe": 2, "abov": 2, "below": 2, "depend": 2, "short": 2, "becom": 2, "point": 2, "cross": 2, "enumer": 2, "fee": 2, "refer": 2, "execut": 2, "paid": 2, "broker": 2, "commis": 2, "sent": 2, "till": 2, "end": 2, "specifi": 2, "bui": 2, "now": 2, "as_utf8": 2, "hdf5": 2, "in_filenam": 2, "in_kei": 2, "out_filenam": 2, "out_kei": 2, "skip_if_exist": 2, "recurs": 2, "copi": 2, "input": 2, "skip": 2, "alreadi": 2, "replac": 2, "tempdir": 2, "temp_in": 2, "temp_out": 2, "test_g": 2, "test_subg": 2, "h5py": 2, "w": 2, "create_group": 2, "create_dataset": 2, "r": 2, "obj": 2, "serv": 2, "purpos": 2, "h5repack": 2, "line": 2, "tool": 2, "discard": 2, "space": 2, "smaller": 2, "previous": 2, "subgroup": 2, "g1": 2, "g2": 2, "subgrp": 2, "within": 2, "grp": 2, "along": 2, "compression_arg": 2, "dimension": 2, "col1": 2, "f4": 2, "byte": 2, "as_utf_8": 2, "save": 2, "utf8": 2, "encod": 2, "max": 2, "fix": 2, "ascii": 2, "much": 2, "faster": 2, "process": 2, "hdf5plugin": 2, "argument": 2, "blosc": 2, "calendar_nam": 2, "pandas_market_calendar": 2, "add": 2, "union": 2, "forward": 2, "follow": 2, "backward": 2, "preced": 2, "modifiedfollow": 2, "modifiedpreced": 2, "allow": 2, "special": 2, "ad": 2, "holidai": 2, "act": 2, "give": 2, "busi": 2, "rest": 2, "busday_offset": 2, "document": 2, "how": 2, "treat": 2, "do": 2, "fall": 2, "later": 2, "earlier": 2, "unless": 2, "across": 2, "month": 2, "boundari": 2, "nyse": 2, "28": 2, "2017": 2, "14": 2, "fridai": 2, "2019": 2, "17": 2, "19t15": 2, "15t15": 2, "include_first": 2, "include_last": 2, "2005": 2, "19": 2, "20": 2, "21": 2, "26": 2, "27": 2, "31": 2, "2016": 2, "29": 2, "22": 2, "weekend": 2, "eurex": 2, "arang": 2, "count": 2, "two": 2, "includ": 2, "those": 2, "2011": 2, "766": 2, "2013": 2, "timedelta64": 2, "filterwarn": 2, "action": 2, "ignor": 2, "categori": 2, "performancewarn": 2, "dates2": 2, "set_printopt": 2, "formatt": 2, "1f": 2, "lead": 2, "sign": 2, "year": 2, "weekdai": 2, "1000000": 2, "900": 2, "sequenc": 2, "might": 2, "pass": 2, "current": 2, "state": 2, "currenc": 2, "e6": 2, "minut": 2, "past": 2, "midnight": 2, "should": 2, "pm": 2, "intern": 2, "rememb": 2, "up": 2, "more": 2, "onli": 2, "broken": 2, "down": 2, "start_dat": 2, "end_dat": 2, "trip": 2, "greater": 2, "equal": 2, "less": 2, "Will": 2, "caus": 2, "net": 2, "thei": 2, "account_timestamp": 2, "singl": 2, "aapl_contract": 2, "aapl": 2, "def": 2, "get_pric": 2, "idx": 2, "unknown": 2, "contract_pnl": 2, "trade_5": 2, "trade_6": 2, "trade_7": 2, "_add_trad": 2, "to_dict": 2, "unreal": 2, "44": 2, "realiz": 2, "000000000000007": 2, "47": 2, "00000000000001": 2, "sorted_dict": 2, "961": 2, "run_final_calc": 2, "heartbeat": 2, "simul": 2, "potenti": 2, "think": 2, "second": 2, "daili": 2, "done": 2, "storag": 2, "pair": 2, "relev": 2, "pre": 2, "tabl": 2, "correl": 2, "member": 2, "access": 2, "depends_on": 2, "market_sim_funct": 2, "rule_funct": 2, "signal_nam": 2, "sig_true_valu": 2, "position_filt": 2, "guarante": 2, "exit": 2, "re": 2, "enter": 2, "new": 2, "ones": 2, "sure": 2, "befor": 2, "match": 2, "nonzero": 2, "correspond": 2, "fit": 2, "criteria": 2, "signal_funct": 2, "depends_on_ind": 2, "depends_on_sign": 2, "add_pnl": 2, "sum": 2, "possibl": 2, "periods_per_year": 2, "display_summari": 2, "float_precis": 2, "return_metr": 2, "gap": 2, "yourself": 2, "252": 2, "drawdown": 2, "indicator_nam": 2, "clear_al": 2, "rule_nam": 2, "concurr": 2, "uncorrel": 2, "togeth": 2, "instanc": 2, "strategy_nam": 2, "combin": 2, "By": 2, "few": 2, "readi": 2, "descript": 2, "suggest": 2, "cost": 2, "other_cost": 2, "result": 2, "variabl": 2, "repres": 2, "finit": 2, "infin": 2, "cost_func": 2, "max_process": 2, "titl": 2, "yield": 2, "cpu": 2, "core": 2, "mani": 2, "sort_column": 2, "ascend": 2, "sort_ord": 2, "lowest_cost": 2, "highest_cost": 2, "were": 2, "marker": 2, "height": 2, "width": 2, "2d": 2, "axi": 2, "anoth": 2, "subplot": 2, "plu": 2, "plotli": 2, "z": 2, "filter_func": 2, "xlim": 2, "ylim": 2, "vertical_spac": 2, "3d": 2, "actual": 2, "datapoint": 2, "reduc": 2, "dataset": 2, "filter": 2, "dimens": 2, "beyond": 2, "pick": 2, "interpol": 2, "vertic": 2, "raise_on_error": 2, "even": 2, "multiprocess": 2, "bubbl": 2, "debug": 2, "stack": 2, "trace": 2, "util": 2, "initial_metr": 2, "retriev": 2, "init": 2, "initi": 2, "subsequ": 2, "scalar": 2, "metric_nam": 2, "arithmet": 2, "003": 2, "004": 2, "882": 2, "geometr": 2, "being": 2, "integ": 2, "annual": 2, "returns_3yr": 2, "mdd_pct_3yr": 2, "calmar": 2, "ratio": 2, "divid": 2, "001": 2, "002": 2, "018362": 2, "halflife_year": 2, "k": 2, "version": 2, "lar": 2, "kestner": 2, "paper": 2, "ssrn": 2, "sol3": 2, "cfm": 2, "abstract_id": 2, "2230949": 2, "implement": 2, "modif": 2, "linear": 2, "regress": 2, "older": 2, "observ": 2, "sqrt": 2, "nob": 2, "unweight": 2, "ret": 2, "normal": 2, "loc": 2, "0025": 2, "scale": 2, "cumprod": 2, "888": 2, "abs_tol": 2, "602": 2, "140": 2, "mdd_pct": 2, "mar": 2, "biggest": 2, "incept": 2, "rolling_dd_d": 2, "rolling_dd": 2, "dd": 2, "percentag": 2, "rolling_dd_3yr_timestamp": 2, "rolling_dd_3yr": 2, "mdd_date": 2, "draw": 2, "mdd_date_3yr": 2, "approx": 2, "separ": 2, "m": 2, "72576": 2, "leading_non_finite_to_zero": 2, "subsequent_non_finite_to_zero": 2, "instrument": 2, "nd": 2, "inf": 2, "warmup": 2, "move": 2, "There": 2, "incorrect": 2, "own": 2, "recomput": 2, "just": 2, "015": 2, "ev": 2, "gmean": 2, "03122": 2, "sharp": 2, "594366": 2, "amean": 2, "note": 2, "risk": 2, "free": 2, "realli": 2, "sharpe0": 2, "assum": 2, "050508": 2, "target": 2, "133631": 2, "standard": 2, "deviat": 2, "conveni": 2, "obtain": 2, "chang": 2, "format": 2, "6g": 2, "show_point": 2, "boxplot": 2, "produc": 2, "let": 2, "select": 2, "float64": 2, "sigma": 2, "q": 2, "euroepean": 2, "put": 2, "spot": 2, "discount": 2, "exp": 2, "rt": 2, "matur": 2, "continu": 2, "compound": 2, "interest": 2, "rate": 2, "volatil": 2, "dividend": 2, "cumul": 2, "densiti": 2, "distribut": 2, "black": 2, "schole": 2, "european": 2, "impli": 2, "premium": 2, "formula": 2, "365": 2, "u": 2, "customari": 2, "pars": 2, "curr_dat": 2, "esm9": 2, "esh0": 2, "fut_symbol": 2, "esh8": 2, "16t08": 2, "curr_future_symbol": 2, "esz8": 2, "e1af8": 2, "mo": 2, "ew2z5": 2, "11t15": 2, "e3af7": 2, "17t15": 2, "ewf0": 2, "31t15": 2, "future_cod": 2, "code": 2, "abbrevi": 2, "nov": 2, "letter": 2, "march": 2, "helper": 2, "build": 2, "simpler": 2, "lot": 2, "boilerpl": 2, "built": 2, "part": 2, "aggreg": 2, "suppli": 2, "pricefunctiontyp": 2, "basi": 2, "backtest": 2, "33": 2, "send": 2, "lag": 2, "relax": 2, "assumpt": 2, "user": 2, "instead": 2, "hardcod": 2, "numer": 2, "overnight": 2, "yesterdai": 2, "close": 2, "morn": 2, "determin": 2, "night": 2, "logic": 2, "decid": 2, "what": 2, "kind": 2, "sim": 2, "successfulli": 2, "column_nam": 2, "constructor": 2, "context": 2, "min_stop_return": 2, "go": 2, "lose": 2, "amount": 2, "Of": 2, "cours": 2, "rather": 2, "smoothli": 2, "distanc": 2, "stop_return": 2, "closer": 2, "percent": 2, "veri": 2, "larg": 2, "5000": 2, "construct": 2, "everi": 2, "2023": 2, "sig_valu": 2, "full": 2, "aapl_pric": 2, "ibm_pric": 2, "aapl_stop": 2, "ibm_stop": 2, "stop_dict": 2, "fr": 2, "test_entri": 2, "default_cg": 2, "1e6": 2, "998": 2, "499": 2, "4985": 2, "2496": 2, "3326": 2, "indicator_valu": 2, "signal_valu": 2, "current_ord": 2, "self": 2, "subtract": 2, "respect": 2, "alloat": 2, "intradai": 2, "signatur": 2, "nane": 2, "exact": 2, "previou": 2, "pricefunc": 2, "basket": 2, "aapl_ibm": 2, "three": 2, "marketsimulatortyp": 2, "It": 2, "slippag": 2, "put_symbol": 2, "call_symbol": 2, "spx": 2, "3500": 2, "4000": 2, "put_contract": 2, "call_contract": 2, "test_contract": 2, "todo": 2, "dollar": 2, "transact": 2, "meant": 2, "hit": 2, "reach": 2, "estim": 2, "market_pric": 2, "opposit": 2, "b": 2, "histor": 2, "miss": 2, "parent_valu": 2, "label": 2, "transform_func": 2, "create_selection_widgets_func": 2, "dim_filter_func": 2, "data_filter_func": 2, "stat_func": 2, "plot_func": 2, "display_form_func": 2, "multidimension": 2, "interact": 2, "map": 2, "friendli": 2, "choos": 2, "dropdown": 2, "onc": 2, "statist": 2, "widget": 2, "associ": 2, "form": 2, "dont": 2, "xcol": 2, "ycol": 2, "zcol": 2, "pivot": 2, "zvalu": 2, "option_typ": 2, "american": 2, "bermudan": 2, "care": 2, "chosen": 2, "owner_idx": 2, "redraw": 2, "everyth": 2, "display_detail_func": 2, "line_config": 2, "hovertempl": 2, "pane": 2, "click": 2, "xaxis_titl": 2, "yaxis_titl": 2, "line_data": 2, "configur": 2, "hover": 2, "mean_func": 2, "nanmean": 2, "filtered_data": 2, "versu": 2, "colnam": 2, "float_format": 2, "4g": 2, "min_row": 2, "copy_to_clipboard": 2, "under": 2, "detail_widget": 2, "truncat": 2, "clipboard": 2, "On": 2, "linux": 2, "instal": 2, "xclip": 2, "quantil": 2, "methodnam": 2, "runtest": 2, "testcas": 2, "dim": 2, "update_form_func": 2, "form_widget": 2, "old": 2, "selection_widget": 2, "callback": 2, "10000": 2, "atol": 2, "selected_valu": 2, "dim_nam": 2}, "objects": {"": [[2, 0, 0, "-", "pyqstrat"]], "pyqstrat": [[2, 0, 0, "-", "account"], [2, 0, 0, "-", "evaluator"], [2, 0, 0, "-", "holiday_calendars"], [2, 0, 0, "-", "interactive_plot"], [2, 0, 0, "-", "markets"], [2, 0, 0, "-", "optimize"], [2, 0, 0, "-", "portfolio"], [2, 0, 0, "-", "pq_io"], [2, 0, 0, "-", "pq_types"], [2, 0, 0, "-", "pq_utils"], [2, 0, 0, "-", "pyqstrat_cpp"], [2, 0, 0, "-", "pyqstrat_io"], [2, 0, 0, "-", "strategy"], [2, 0, 0, "-", "strategy_builder"], [2, 0, 0, "-", "strategy_components"]], "pyqstrat.account": [[2, 1, 1, "", "Account"], [2, 1, 1, "", "ContractPNL"], [2, 3, 1, "", "find_index_before"], [2, 3, 1, "", "find_last_non_nan_index"], [2, 3, 1, "", "leading_nan_to_zero"], [2, 3, 1, "", "test_account"]], "pyqstrat.account.Account": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_trades"], [2, 2, 1, "", "calc"], [2, 2, 1, "", "df_account_pnl"], [2, 2, 1, "", "df_pnl"], [2, 2, 1, "", "df_roundtrip_trades"], [2, 2, 1, "", "df_trades"], [2, 2, 1, "", "equity"], [2, 2, 1, "", "get_trades_for_date"], [2, 2, 1, "", "position"], [2, 2, 1, "", "positions"], [2, 2, 1, "", "roundtrip_trades"], [2, 2, 1, "", "symbols"], [2, 2, 1, "", "trades"]], "pyqstrat.account.ContractPNL": [[2, 2, 1, "", "calc_net_pnl"], [2, 2, 1, "", "df"], [2, 2, 1, "", "net_pnl"], [2, 2, 1, "", "pnl"], [2, 2, 1, "", "position"]], "pyqstrat.evaluator": [[2, 1, 1, "", "Evaluator"], [2, 3, 1, "", "compute_amean"], [2, 3, 1, "", "compute_annual_returns"], [2, 3, 1, "", "compute_bucketed_returns"], [2, 3, 1, "", "compute_calmar"], [2, 3, 1, "", "compute_dates_3yr"], [2, 3, 1, "", "compute_equity"], [2, 3, 1, "", "compute_gmean"], [2, 3, 1, "", "compute_k_ratio"], [2, 3, 1, "", "compute_mar"], [2, 3, 1, "", "compute_maxdd_date"], [2, 3, 1, "", "compute_maxdd_date_3yr"], [2, 3, 1, "", "compute_maxdd_pct"], [2, 3, 1, "", "compute_maxdd_pct_3yr"], [2, 3, 1, "", "compute_maxdd_start"], [2, 3, 1, "", "compute_maxdd_start_3yr"], [2, 3, 1, "", "compute_num_periods"], [2, 3, 1, "", "compute_periods_per_year"], [2, 3, 1, "", "compute_return_metrics"], [2, 3, 1, "", "compute_returns_3yr"], [2, 3, 1, "", "compute_rolling_dd"], [2, 3, 1, "", "compute_rolling_dd_3yr"], [2, 3, 1, "", "compute_sharpe"], [2, 3, 1, "", "compute_sortino"], [2, 3, 1, "", "compute_std"], [2, 3, 1, "", "display_return_metrics"], [2, 3, 1, "", "handle_non_finite_returns"], [2, 3, 1, "", "plot_return_metrics"], [2, 3, 1, "", "test_evaluator"]], "pyqstrat.evaluator.Evaluator": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_metric"], [2, 2, 1, "", "compute"], [2, 2, 1, "", "compute_metric"], [2, 2, 1, "", "metric"], [2, 2, 1, "", "metrics"]], "pyqstrat.holiday_calendars": [[2, 1, 1, "", "Calendar"], [2, 3, 1, "", "get_date_from_weekday"]], "pyqstrat.holiday_calendars.Calendar": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_trading_days"], [2, 2, 1, "", "get_trading_days"], [2, 2, 1, "", "is_trading_day"], [2, 2, 1, "", "num_trading_days"], [2, 2, 1, "", "third_friday_of_month"]], "pyqstrat.interactive_plot": [[2, 1, 1, "", "InteractivePlot"], [2, 1, 1, "", "LineConfig"], [2, 1, 1, "", "LineGraphWithDetailDisplay"], [2, 1, 1, "", "MeanWithCI"], [2, 1, 1, "", "SimpleDetailTable"], [2, 1, 1, "", "SimpleTransform"], [2, 1, 1, "", "TestInteractivePlot"], [2, 3, 1, "", "create_selection_dropdowns"], [2, 3, 1, "", "display_form"], [2, 3, 1, "", "foo"], [2, 3, 1, "", "on_widgets_updated"], [2, 3, 1, "", "percentile_buckets"], [2, 3, 1, "", "simple_data_filter"], [2, 3, 1, "", "simple_dimension_filter"]], "pyqstrat.interactive_plot.InteractivePlot": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "create_pivot"], [2, 2, 1, "", "update"]], "pyqstrat.interactive_plot.LineConfig": [[2, 2, 1, "", "__init__"], [2, 4, 1, "", "color"], [2, 4, 1, "", "marker_mode"], [2, 4, 1, "", "secondary_y"], [2, 4, 1, "", "show_detail"], [2, 4, 1, "", "thickness"]], "pyqstrat.interactive_plot.LineGraphWithDetailDisplay": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.MeanWithCI": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.SimpleDetailTable": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.SimpleTransform": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"]], "pyqstrat.interactive_plot.TestInteractivePlot": [[2, 2, 1, "", "test_interactive_plot"], [2, 2, 1, "", "transform"]], "pyqstrat.markets": [[2, 1, 1, "", "EminiFuture"], [2, 1, 1, "", "EminiOption"], [2, 3, 1, "", "future_code_to_month"], [2, 3, 1, "", "future_code_to_month_number"], [2, 3, 1, "", "get_future_code"]], "pyqstrat.markets.EminiFuture": [[2, 4, 1, "", "calendar"], [2, 2, 1, "", "get_current_symbol"], [2, 2, 1, "", "get_expiry"], [2, 2, 1, "", "get_next_symbol"], [2, 2, 1, "", "get_previous_symbol"]], "pyqstrat.markets.EminiOption": [[2, 4, 1, "", "calendar"], [2, 2, 1, "", "decode_symbol"], [2, 2, 1, "", "get_expiry"]], "pyqstrat.optimize": [[2, 1, 1, "", "Experiment"], [2, 1, 1, "", "Optimizer"], [2, 3, 1, "", "flatten_keys"], [2, 3, 1, "", "test_optimize"]], "pyqstrat.optimize.Experiment": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "valid"]], "pyqstrat.optimize.Optimizer": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "df_experiments"], [2, 2, 1, "", "experiment_list"], [2, 2, 1, "", "plot_2d"], [2, 2, 1, "", "plot_3d"], [2, 2, 1, "", "run"]], "pyqstrat.portfolio": [[2, 1, 1, "", "Portfolio"]], "pyqstrat.portfolio.Portfolio": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_strategy"], [2, 2, 1, "", "df_returns"], [2, 2, 1, "", "evaluate_returns"], [2, 2, 1, "", "plot"], [2, 2, 1, "", "run"], [2, 2, 1, "", "run_indicators"], [2, 2, 1, "", "run_rules"], [2, 2, 1, "", "run_signals"]], "pyqstrat.pq_io": [[2, 3, 1, "", "df_to_hdf5"], [2, 3, 1, "", "hdf5_copy"], [2, 3, 1, "", "hdf5_repack"], [2, 3, 1, "", "hdf5_to_df"], [2, 3, 1, "", "hdf5_to_np_arrays"], [2, 3, 1, "", "np_arrays_to_hdf5"], [2, 3, 1, "", "test_hdf5_to_df"]], "pyqstrat.pq_types": [[2, 1, 1, "", "Contract"], [2, 1, 1, "", "ContractGroup"], [2, 1, 1, "", "LimitOrder"], [2, 1, 1, "", "MarketOrder"], [2, 1, 1, "", "Order"], [2, 1, 1, "", "OrderStatus"], [2, 1, 1, "", "Price"], [2, 1, 1, "", "RollOrder"], [2, 1, 1, "", "RoundTripTrade"], [2, 1, 1, "", "StopLimitOrder"], [2, 1, 1, "", "TimeInForce"], [2, 1, 1, "", "Trade"], [2, 1, 1, "", "VWAPOrder"]], "pyqstrat.pq_types.Contract": [[2, 2, 1, "", "clear_cache"], [2, 4, 1, "", "components"], [2, 4, 1, "", "contract_group"], [2, 2, 1, "", "create"], [2, 2, 1, "", "exists"], [2, 4, 1, "", "expiry"], [2, 2, 1, "", "get"], [2, 2, 1, "", "get_or_create"], [2, 2, 1, "", "is_basket"], [2, 4, 1, "", "multiplier"], [2, 4, 1, "", "properties"], [2, 4, 1, "", "symbol"]], "pyqstrat.pq_types.ContractGroup": [[2, 2, 1, "", "add_contract"], [2, 2, 1, "", "clear"], [2, 2, 1, "", "clear_cache"], [2, 4, 1, "", "contracts"], [2, 2, 1, "", "exists"], [2, 2, 1, "", "get"], [2, 2, 1, "", "get_contract"], [2, 2, 1, "", "get_contracts"], [2, 2, 1, "", "get_default"], [2, 4, 1, "", "name"]], "pyqstrat.pq_types.LimitOrder": [[2, 4, 1, "", "limit_price"]], "pyqstrat.pq_types.Order": [[2, 2, 1, "", "cancel"], [2, 4, 1, "", "contract"], [2, 2, 1, "", "fill"], [2, 2, 1, "", "is_open"], [2, 4, 1, "", "properties"], [2, 4, 1, "", "qty"], [2, 4, 1, "", "reason_code"], [2, 2, 1, "", "request_cancel"], [2, 4, 1, "", "status"], [2, 4, 1, "", "time_in_force"], [2, 4, 1, "", "timestamp"]], "pyqstrat.pq_types.OrderStatus": [[2, 4, 1, "", "CANCELLED"], [2, 4, 1, "", "CANCEL_REQUESTED"], [2, 4, 1, "", "FILLED"], [2, 4, 1, "", "OPEN"], [2, 4, 1, "", "PARTIALLY_FILLED"]], "pyqstrat.pq_types.Price": [[2, 4, 1, "", "ask"], [2, 4, 1, "", "ask_size"], [2, 4, 1, "", "bid"], [2, 4, 1, "", "bid_size"], [2, 2, 1, "", "invalid"], [2, 2, 1, "", "mid"], [2, 4, 1, "", "properties"], [2, 2, 1, "", "set_property"], [2, 2, 1, "", "spread"], [2, 4, 1, "", "timestamp"], [2, 4, 1, "", "valid"], [2, 2, 1, "", "vw_mid"]], "pyqstrat.pq_types.RollOrder": [[2, 4, 1, "", "close_qty"], [2, 4, 1, "", "reopen_qty"]], "pyqstrat.pq_types.RoundTripTrade": [[2, 4, 1, "", "contract"], [2, 4, 1, "", "entry_commission"], [2, 4, 1, "", "entry_order"], [2, 4, 1, "", "entry_price"], [2, 4, 1, "", "entry_properties"], [2, 4, 1, "", "entry_reason"], [2, 4, 1, "", "entry_timestamp"], [2, 4, 1, "", "exit_commission"], [2, 4, 1, "", "exit_order"], [2, 4, 1, "", "exit_price"], [2, 4, 1, "", "exit_properties"], [2, 4, 1, "", "exit_reason"], [2, 4, 1, "", "exit_timestamp"], [2, 4, 1, "", "net_pnl"], [2, 4, 1, "", "qty"]], "pyqstrat.pq_types.StopLimitOrder": [[2, 4, 1, "", "limit_price"], [2, 4, 1, "", "trigger_price"], [2, 4, 1, "", "triggered"]], "pyqstrat.pq_types.TimeInForce": [[2, 4, 1, "", "DAY"], [2, 4, 1, "", "FOK"], [2, 4, 1, "", "GTC"]], "pyqstrat.pq_types.Trade": [[2, 2, 1, "", "__init__"]], "pyqstrat.pq_types.VWAPOrder": [[2, 4, 1, "", "vwap_end_time"], [2, 4, 1, "", "vwap_stop"]], "pyqstrat.pq_utils": [[2, 5, 1, "", "PQException"], [2, 1, 1, "", "Paths"], [2, 3, 1, "", "assert_"], [2, 3, 1, "", "bootstrap_ci"], [2, 3, 1, "", "day_of_week_num"], [2, 3, 1, "", "day_symbol"], [2, 3, 1, "", "find_in_subdir"], [2, 3, 1, "", "get_child_logger"], [2, 3, 1, "", "get_config"], [2, 3, 1, "", "get_empty_np_value"], [2, 3, 1, "", "get_main_logger"], [2, 3, 1, "", "get_paths"], [2, 3, 1, "", "get_temp_dir"], [2, 3, 1, "", "has_display"], [2, 3, 1, "", "in_debug"], [2, 3, 1, "", "in_ipython"], [2, 3, 1, "", "infer_compression"], [2, 3, 1, "", "infer_frequency"], [2, 3, 1, "", "is_newer"], [2, 3, 1, "", "linear_interpolate"], [2, 3, 1, "", "millis_since_epoch"], [2, 3, 1, "", "monotonically_increasing"], [2, 3, 1, "", "nan_to_zero"], [2, 3, 1, "", "np_bucket"], [2, 3, 1, "", "np_find_closest"], [2, 3, 1, "", "np_inc_dates"], [2, 3, 1, "", "np_indexof"], [2, 3, 1, "", "np_indexof_sorted"], [2, 3, 1, "", "np_parse_array"], [2, 3, 1, "", "np_rolling_window"], [2, 3, 1, "", "np_round"], [2, 3, 1, "", "np_uniques"], [2, 3, 1, "", "percentile_of_score"], [2, 3, 1, "", "remove_dups"], [2, 3, 1, "", "resample_trade_bars"], [2, 3, 1, "", "resample_ts"], [2, 3, 1, "", "resample_vwap"], [2, 3, 1, "", "series_to_array"], [2, 3, 1, "", "set_defaults"], [2, 3, 1, "", "set_ipython_defaults"], [2, 3, 1, "", "shift_np"], [2, 3, 1, "", "str2date"], [2, 3, 1, "", "strtup2date"], [2, 3, 1, "", "to_csv"], [2, 3, 1, "", "touch"], [2, 3, 1, "", "try_frequency"], [2, 3, 1, "", "zero_to_nan"]], "pyqstrat.pq_utils.Paths": [[2, 2, 1, "", "create"]], "pyqstrat.pyqstrat_cpp": [[2, 3, 1, "", "black_scholes_price"], [2, 3, 1, "", "cdf"], [2, 3, 1, "", "d1"], [2, 3, 1, "", "d2"], [2, 3, 1, "", "delta"], [2, 3, 1, "", "gamma"], [2, 3, 1, "", "implied_vol"], [2, 3, 1, "", "rho"], [2, 3, 1, "", "theta"], [2, 3, 1, "", "vega"]], "pyqstrat.pyqstrat_io": [[2, 3, 1, "", "parse_datetimes"], [2, 3, 1, "", "read_file"]], "pyqstrat.strategy": [[2, 1, 1, "", "Strategy"]], "pyqstrat.strategy.Strategy": [[2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_indicator"], [2, 2, 1, "", "add_market_sim"], [2, 2, 1, "", "add_rule"], [2, 2, 1, "", "add_signal"], [2, 2, 1, "", "df_data"], [2, 2, 1, "", "df_orders"], [2, 2, 1, "", "df_pnl"], [2, 2, 1, "", "df_returns"], [2, 2, 1, "", "df_roundtrip_trades"], [2, 2, 1, "", "df_trades"], [2, 2, 1, "", "evaluate_returns"], [2, 2, 1, "", "orders"], [2, 2, 1, "", "plot_returns"], [2, 2, 1, "", "roundtrip_trades"], [2, 2, 1, "", "run"], [2, 2, 1, "", "run_indicators"], [2, 2, 1, "", "run_rules"], [2, 2, 1, "", "run_signals"], [2, 2, 1, "", "trades"]], "pyqstrat.strategy_builder": [[2, 1, 1, "", "StrategyBuilder"]], "pyqstrat.strategy_builder.StrategyBuilder": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 2, 1, "", "add_contract"], [2, 2, 1, "", "add_contract_group"], [2, 2, 1, "", "add_indicator"], [2, 2, 1, "", "add_market_sim"], [2, 2, 1, "", "add_rule"], [2, 2, 1, "", "add_series_indicator"], [2, 2, 1, "", "add_series_rule"], [2, 2, 1, "", "add_signal"], [2, 4, 1, "", "contract_groups"], [2, 4, 1, "", "data"], [2, 4, 1, "", "indicators"], [2, 4, 1, "", "log_orders"], [2, 4, 1, "", "log_trades"], [2, 4, 1, "", "market_sims"], [2, 4, 1, "", "pnl_calc_time"], [2, 4, 1, "", "price_function"], [2, 4, 1, "", "rules"], [2, 2, 1, "", "set_log_orders"], [2, 2, 1, "", "set_log_trades"], [2, 2, 1, "", "set_pnl_calc_time"], [2, 2, 1, "", "set_price_function"], [2, 2, 1, "", "set_starting_equity"], [2, 2, 1, "", "set_strategy_context"], [2, 2, 1, "", "set_timestamps"], [2, 2, 1, "", "set_trade_lag"], [2, 4, 1, "", "signals"], [2, 4, 1, "", "starting_equity"], [2, 4, 1, "", "strategy_context"], [2, 4, 1, "", "timestamp_unit"], [2, 4, 1, "", "timestamps"], [2, 4, 1, "", "trade_lag"]], "pyqstrat.strategy_components": [[2, 1, 1, "", "BracketOrderEntryRule"], [2, 1, 1, "", "ClosePositionExitRule"], [2, 1, 1, "", "PercentOfEquityTradingRule"], [2, 1, 1, "", "PriceFuncArrayDict"], [2, 1, 1, "", "PriceFuncArrays"], [2, 1, 1, "", "PriceFuncDict"], [2, 1, 1, "", "SimpleMarketSimulator"], [2, 1, 1, "", "StopReturnExitRule"], [2, 1, 1, "", "VWAPCloseRule"], [2, 1, 1, "", "VWAPEntryRule"], [2, 1, 1, "", "VWAPMarketSimulator"], [2, 1, 1, "", "VectorIndicator"], [2, 1, 1, "", "VectorSignal"], [2, 3, 1, "", "get_contract_price_from_array_dict"], [2, 3, 1, "", "get_contract_price_from_dict"]], "pyqstrat.strategy_components.BracketOrderEntryRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "contract_filter"], [2, 4, 1, "", "long"], [2, 4, 1, "", "max_position_size"], [2, 4, 1, "", "min_stop_returnt"], [2, 4, 1, "", "percent_of_equity"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"], [2, 4, 1, "", "single_entry_per_day"], [2, 4, 1, "", "stop_return_func"]], "pyqstrat.strategy_components.ClosePositionExitRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "limit_increment"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"]], "pyqstrat.strategy_components.PercentOfEquityTradingRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "allocate_risk"], [2, 4, 1, "", "equity_percent"], [2, 4, 1, "", "limit_increment"], [2, 4, 1, "", "long"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"]], "pyqstrat.strategy_components.PriceFuncArrayDict": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "allow_previous"], [2, 4, 1, "", "price_dict"]], "pyqstrat.strategy_components.PriceFuncArrays": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "allow_previous"], [2, 4, 1, "", "price_dict"]], "pyqstrat.strategy_components.PriceFuncDict": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "price_dict"]], "pyqstrat.strategy_components.SimpleMarketSimulator": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "commission"], [2, 4, 1, "", "post_trade_func"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "price_rounding"], [2, 4, 1, "", "slippage_pct"]], "pyqstrat.strategy_components.StopReturnExitRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"], [2, 4, 1, "", "stop_return_func"]], "pyqstrat.strategy_components.VWAPCloseRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "reason_code"], [2, 4, 1, "", "vwap_minutes"]], "pyqstrat.strategy_components.VWAPEntryRule": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "long"], [2, 4, 1, "", "min_price_diff_pct"], [2, 4, 1, "", "percent_of_equity"], [2, 4, 1, "", "price_func"], [2, 4, 1, "", "reason_code"], [2, 4, 1, "", "single_entry_per_day"], [2, 4, 1, "", "stop_price_ind"], [2, 4, 1, "", "vwap_minutes"]], "pyqstrat.strategy_components.VWAPMarketSimulator": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "backup_price_indicator"], [2, 4, 1, "", "price_indicator"], [2, 4, 1, "", "volume_indicator"]], "pyqstrat.strategy_components.VectorIndicator": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "vector"]], "pyqstrat.strategy_components.VectorSignal": [[2, 2, 1, "", "__call__"], [2, 2, 1, "", "__init__"], [2, 4, 1, "", "vector"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:function", "4": "py:attribute", "5": "py:exception"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "function", "Python function"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "exception", "Python exception"]}, "titleterms": {"api": 0, "document": 0, "pyqstrat": [0, 1, 2], "content": [0, 2], "indic": 0, "tabl": 0, "packag": 2, "submodul": 2, "pq_util": 2, "modul": 2, "pq_type": 2, "pq_io": 2, "holiday_calendar": 2, "account": 2, "strategi": 2, "portfolio": 2, "optim": 2, "evalu": 2, "pyqstrat_cpp": 2, "pyqstrat_io": 2, "market": 2, "strategy_build": 2, "strategy_compon": 2, "interactive_plot": 2}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"API documentation for pyqstrat": [[0, "api-documentation-for-pyqstrat"]], "Contents:": [[0, null]], "Indices and tables": [[0, "indices-and-tables"]], "pyqstrat": [[1, "pyqstrat"]], "pyqstrat package": [[2, "pyqstrat-package"]], "Submodules": [[2, "submodules"]], "pyqstrat.pq_utils module": [[2, "module-pyqstrat.pq_utils"]], "pyqstrat.pq_types module": [[2, "module-pyqstrat.pq_types"]], "pyqstrat.pq_io module": [[2, "module-pyqstrat.pq_io"]], "pyqstrat.holiday_calendars module": [[2, "module-pyqstrat.holiday_calendars"]], "pyqstrat.account module": [[2, "module-pyqstrat.account"]], "pyqstrat.strategy module": [[2, "module-pyqstrat.strategy"]], "pyqstrat.portfolio module": [[2, "module-pyqstrat.portfolio"]], "pyqstrat.optimize module": [[2, "module-pyqstrat.optimize"]], "pyqstrat.evaluator module": [[2, "module-pyqstrat.evaluator"]], "pyqstrat.pyqstrat_cpp module": [[2, "module-pyqstrat.pyqstrat_cpp"]], "pyqstrat.pyqstrat_io module": [[2, "module-pyqstrat.pyqstrat_io"]], "pyqstrat.markets module": [[2, "module-pyqstrat.markets"]], "pyqstrat.strategy_builder module": [[2, "module-pyqstrat.strategy_builder"]], "pyqstrat.strategy_components module": [[2, "module-pyqstrat.strategy_components"]], "pyqstrat.interactive_plot module": [[2, "module-pyqstrat.interactive_plot"]], "Module contents": [[2, "module-pyqstrat"]]}, "indexentries": {"account (class in pyqstrat.account)": [[2, "pyqstrat.account.Account"]], "bracketorderentryrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule"]], "cancelled (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.CANCELLED"]], "cancel_requested (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.CANCEL_REQUESTED"]], "calendar (class in pyqstrat.holiday_calendars)": [[2, "pyqstrat.holiday_calendars.Calendar"]], "closepositionexitrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule"]], "contract (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Contract"]], "contractgroup (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.ContractGroup"]], "contractpnl (class in pyqstrat.account)": [[2, "pyqstrat.account.ContractPNL"]], "day (pyqstrat.pq_types.timeinforce attribute)": [[2, "pyqstrat.pq_types.TimeInForce.DAY"]], "eminifuture (class in pyqstrat.markets)": [[2, "pyqstrat.markets.EminiFuture"]], "eminioption (class in pyqstrat.markets)": [[2, "pyqstrat.markets.EminiOption"]], "evaluator (class in pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.Evaluator"]], "experiment (class in pyqstrat.optimize)": [[2, "pyqstrat.optimize.Experiment"]], "filled (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.FILLED"]], "fok (pyqstrat.pq_types.timeinforce attribute)": [[2, "pyqstrat.pq_types.TimeInForce.FOK"]], "gtc (pyqstrat.pq_types.timeinforce attribute)": [[2, "pyqstrat.pq_types.TimeInForce.GTC"]], "interactiveplot (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.InteractivePlot"]], "limitorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.LimitOrder"]], "lineconfig (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.LineConfig"]], "linegraphwithdetaildisplay (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.LineGraphWithDetailDisplay"]], "marketorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.MarketOrder"]], "meanwithci (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.MeanWithCI"]], "open (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.OPEN"]], "optimizer (class in pyqstrat.optimize)": [[2, "pyqstrat.optimize.Optimizer"]], "order (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Order"]], "orderstatus (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.OrderStatus"]], "partially_filled (pyqstrat.pq_types.orderstatus attribute)": [[2, "pyqstrat.pq_types.OrderStatus.PARTIALLY_FILLED"]], "pqexception": [[2, "pyqstrat.pq_utils.PQException"]], "paths (class in pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.Paths"]], "percentofequitytradingrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule"]], "portfolio (class in pyqstrat.portfolio)": [[2, "pyqstrat.portfolio.Portfolio"]], "price (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Price"]], "pricefuncarraydict (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict"]], "pricefuncarrays (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.PriceFuncArrays"]], "pricefuncdict (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.PriceFuncDict"]], "rollorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.RollOrder"]], "roundtriptrade (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.RoundTripTrade"]], "simpledetailtable (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.SimpleDetailTable"]], "simplemarketsimulator (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator"]], "simpletransform (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.SimpleTransform"]], "stoplimitorder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.StopLimitOrder"]], "stopreturnexitrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.StopReturnExitRule"]], "strategy (class in pyqstrat.strategy)": [[2, "pyqstrat.strategy.Strategy"]], "strategybuilder (class in pyqstrat.strategy_builder)": [[2, "pyqstrat.strategy_builder.StrategyBuilder"]], "testinteractiveplot (class in pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.TestInteractivePlot"]], "timeinforce (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.TimeInForce"]], "trade (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.Trade"]], "vwapcloserule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VWAPCloseRule"]], "vwapentryrule (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VWAPEntryRule"]], "vwapmarketsimulator (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator"]], "vwaporder (class in pyqstrat.pq_types)": [[2, "pyqstrat.pq_types.VWAPOrder"]], "vectorindicator (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VectorIndicator"]], "vectorsignal (class in pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.VectorSignal"]], "__call__() (pyqstrat.interactive_plot.linegraphwithdetaildisplay method)": [[2, "pyqstrat.interactive_plot.LineGraphWithDetailDisplay.__call__"]], "__call__() (pyqstrat.interactive_plot.meanwithci method)": [[2, "pyqstrat.interactive_plot.MeanWithCI.__call__"]], "__call__() (pyqstrat.interactive_plot.simpledetailtable method)": [[2, "pyqstrat.interactive_plot.SimpleDetailTable.__call__"]], "__call__() (pyqstrat.interactive_plot.simpletransform method)": [[2, "pyqstrat.interactive_plot.SimpleTransform.__call__"]], "__call__() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.__call__"]], "__call__() (pyqstrat.strategy_components.bracketorderentryrule method)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.__call__"]], "__call__() (pyqstrat.strategy_components.closepositionexitrule method)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.__call__"]], "__call__() (pyqstrat.strategy_components.percentofequitytradingrule method)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.__call__"]], "__call__() (pyqstrat.strategy_components.pricefuncarraydict method)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict.__call__"]], "__call__() (pyqstrat.strategy_components.pricefuncarrays method)": [[2, "pyqstrat.strategy_components.PriceFuncArrays.__call__"]], "__call__() (pyqstrat.strategy_components.pricefuncdict method)": [[2, "pyqstrat.strategy_components.PriceFuncDict.__call__"]], "__call__() (pyqstrat.strategy_components.simplemarketsimulator method)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.__call__"]], "__call__() (pyqstrat.strategy_components.stopreturnexitrule method)": [[2, "pyqstrat.strategy_components.StopReturnExitRule.__call__"]], "__call__() (pyqstrat.strategy_components.vwapcloserule method)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.__call__"]], "__call__() (pyqstrat.strategy_components.vwapentryrule method)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.__call__"]], "__call__() (pyqstrat.strategy_components.vwapmarketsimulator method)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.__call__"]], "__call__() (pyqstrat.strategy_components.vectorindicator method)": [[2, "pyqstrat.strategy_components.VectorIndicator.__call__"]], "__call__() (pyqstrat.strategy_components.vectorsignal method)": [[2, "pyqstrat.strategy_components.VectorSignal.__call__"]], "__init__() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.__init__"]], "__init__() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.__init__"]], "__init__() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.__init__"]], "__init__() (pyqstrat.interactive_plot.interactiveplot method)": [[2, "pyqstrat.interactive_plot.InteractivePlot.__init__"]], "__init__() (pyqstrat.interactive_plot.lineconfig method)": [[2, "pyqstrat.interactive_plot.LineConfig.__init__"]], "__init__() (pyqstrat.interactive_plot.linegraphwithdetaildisplay method)": [[2, "pyqstrat.interactive_plot.LineGraphWithDetailDisplay.__init__"]], "__init__() (pyqstrat.interactive_plot.meanwithci method)": [[2, "pyqstrat.interactive_plot.MeanWithCI.__init__"]], "__init__() (pyqstrat.interactive_plot.simpledetailtable method)": [[2, "pyqstrat.interactive_plot.SimpleDetailTable.__init__"]], "__init__() (pyqstrat.interactive_plot.simpletransform method)": [[2, "pyqstrat.interactive_plot.SimpleTransform.__init__"]], "__init__() (pyqstrat.optimize.experiment method)": [[2, "pyqstrat.optimize.Experiment.__init__"]], "__init__() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.__init__"]], "__init__() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.__init__"]], "__init__() (pyqstrat.pq_types.trade method)": [[2, "pyqstrat.pq_types.Trade.__init__"]], "__init__() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.__init__"]], "__init__() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.__init__"]], "__init__() (pyqstrat.strategy_components.bracketorderentryrule method)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.__init__"]], "__init__() (pyqstrat.strategy_components.closepositionexitrule method)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.__init__"]], "__init__() (pyqstrat.strategy_components.percentofequitytradingrule method)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.__init__"]], "__init__() (pyqstrat.strategy_components.pricefuncarraydict method)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict.__init__"]], "__init__() (pyqstrat.strategy_components.pricefuncarrays method)": [[2, "pyqstrat.strategy_components.PriceFuncArrays.__init__"]], "__init__() (pyqstrat.strategy_components.pricefuncdict method)": [[2, "pyqstrat.strategy_components.PriceFuncDict.__init__"]], "__init__() (pyqstrat.strategy_components.simplemarketsimulator method)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.__init__"]], "__init__() (pyqstrat.strategy_components.stopreturnexitrule method)": [[2, "pyqstrat.strategy_components.StopReturnExitRule.__init__"]], "__init__() (pyqstrat.strategy_components.vwapcloserule method)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.__init__"]], "__init__() (pyqstrat.strategy_components.vwapentryrule method)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.__init__"]], "__init__() (pyqstrat.strategy_components.vwapmarketsimulator method)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.__init__"]], "__init__() (pyqstrat.strategy_components.vectorindicator method)": [[2, "pyqstrat.strategy_components.VectorIndicator.__init__"]], "__init__() (pyqstrat.strategy_components.vectorsignal method)": [[2, "pyqstrat.strategy_components.VectorSignal.__init__"]], "add_contract() (pyqstrat.pq_types.contractgroup method)": [[2, "pyqstrat.pq_types.ContractGroup.add_contract"]], "add_contract() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_contract"]], "add_contract_group() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_contract_group"]], "add_indicator() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_indicator"]], "add_indicator() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_indicator"]], "add_market_sim() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_market_sim"]], "add_market_sim() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_market_sim"]], "add_metric() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.add_metric"]], "add_rule() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_rule"]], "add_rule() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_rule"]], "add_series_indicator() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_series_indicator"]], "add_series_rule() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_series_rule"]], "add_signal() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.add_signal"]], "add_signal() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.add_signal"]], "add_strategy() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.add_strategy"]], "add_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.add_trades"]], "add_trading_days() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.add_trading_days"]], "allocate_risk (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.allocate_risk"]], "allow_previous (pyqstrat.strategy_components.pricefuncarraydict attribute)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict.allow_previous"]], "allow_previous (pyqstrat.strategy_components.pricefuncarrays attribute)": [[2, "pyqstrat.strategy_components.PriceFuncArrays.allow_previous"]], "ask (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.ask"]], "ask_size (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.ask_size"]], "assert_() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.assert_"]], "backup_price_indicator (pyqstrat.strategy_components.vwapmarketsimulator attribute)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.backup_price_indicator"]], "bid (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.bid"]], "bid_size (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.bid_size"]], "black_scholes_price() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.black_scholes_price"]], "bootstrap_ci() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.bootstrap_ci"]], "calc() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.calc"]], "calc_net_pnl() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.calc_net_pnl"]], "calendar (pyqstrat.markets.eminifuture attribute)": [[2, "pyqstrat.markets.EminiFuture.calendar"]], "calendar (pyqstrat.markets.eminioption attribute)": [[2, "pyqstrat.markets.EminiOption.calendar"]], "cancel() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.cancel"]], "cdf() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.cdf"]], "clear() (pyqstrat.pq_types.contractgroup method)": [[2, "pyqstrat.pq_types.ContractGroup.clear"]], "clear_cache() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.clear_cache"]], "clear_cache() (pyqstrat.pq_types.contractgroup static method)": [[2, "pyqstrat.pq_types.ContractGroup.clear_cache"]], "close_qty (pyqstrat.pq_types.rollorder attribute)": [[2, "pyqstrat.pq_types.RollOrder.close_qty"]], "color (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.color"]], "commission (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.commission"]], "components (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.components"]], "compute() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.compute"]], "compute_amean() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_amean"]], "compute_annual_returns() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_annual_returns"]], "compute_bucketed_returns() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_bucketed_returns"]], "compute_calmar() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_calmar"]], "compute_dates_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_dates_3yr"]], "compute_equity() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_equity"]], "compute_gmean() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_gmean"]], "compute_k_ratio() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_k_ratio"]], "compute_mar() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_mar"]], "compute_maxdd_date() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_date"]], "compute_maxdd_date_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_date_3yr"]], "compute_maxdd_pct() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_pct"]], "compute_maxdd_pct_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_pct_3yr"]], "compute_maxdd_start() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_start"]], "compute_maxdd_start_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_maxdd_start_3yr"]], "compute_metric() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.compute_metric"]], "compute_num_periods() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_num_periods"]], "compute_periods_per_year() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_periods_per_year"]], "compute_return_metrics() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_return_metrics"]], "compute_returns_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_returns_3yr"]], "compute_rolling_dd() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_rolling_dd"]], "compute_rolling_dd_3yr() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_rolling_dd_3yr"]], "compute_sharpe() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_sharpe"]], "compute_sortino() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_sortino"]], "compute_std() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.compute_std"]], "contract (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.contract"]], "contract (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.contract"]], "contract_filter (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.contract_filter"]], "contract_group (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.contract_group"]], "contract_groups (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.contract_groups"]], "contracts (pyqstrat.pq_types.contractgroup attribute)": [[2, "pyqstrat.pq_types.ContractGroup.contracts"]], "create() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.create"]], "create() (pyqstrat.pq_utils.paths method)": [[2, "pyqstrat.pq_utils.Paths.create"]], "create_pivot() (pyqstrat.interactive_plot.interactiveplot method)": [[2, "pyqstrat.interactive_plot.InteractivePlot.create_pivot"]], "create_selection_dropdowns() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.create_selection_dropdowns"]], "d1() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.d1"]], "d2() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.d2"]], "data (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.data"]], "day_of_week_num() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.day_of_week_num"]], "day_symbol() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.day_symbol"]], "decode_symbol() (pyqstrat.markets.eminioption static method)": [[2, "pyqstrat.markets.EminiOption.decode_symbol"]], "delta() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.delta"]], "df() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.df"]], "df_account_pnl() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_account_pnl"]], "df_data() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_data"]], "df_experiments() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.df_experiments"]], "df_orders() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_orders"]], "df_pnl() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_pnl"]], "df_pnl() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_pnl"]], "df_returns() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.df_returns"]], "df_returns() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_returns"]], "df_roundtrip_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_roundtrip_trades"]], "df_roundtrip_trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_roundtrip_trades"]], "df_to_hdf5() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.df_to_hdf5"]], "df_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.df_trades"]], "df_trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.df_trades"]], "display_form() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.display_form"]], "display_return_metrics() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.display_return_metrics"]], "entry_commission (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_commission"]], "entry_order (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_order"]], "entry_price (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_price"]], "entry_properties (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_properties"]], "entry_reason (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_reason"]], "entry_timestamp (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.entry_timestamp"]], "equity() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.equity"]], "equity_percent (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.equity_percent"]], "evaluate_returns() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.evaluate_returns"]], "evaluate_returns() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.evaluate_returns"]], "exists() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.exists"]], "exists() (pyqstrat.pq_types.contractgroup static method)": [[2, "pyqstrat.pq_types.ContractGroup.exists"]], "exit_commission (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_commission"]], "exit_order (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_order"]], "exit_price (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_price"]], "exit_properties (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_properties"]], "exit_reason (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_reason"]], "exit_timestamp (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.exit_timestamp"]], "experiment_list() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.experiment_list"]], "expiry (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.expiry"]], "fill() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.fill"]], "find_in_subdir() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.find_in_subdir"]], "find_index_before() (in module pyqstrat.account)": [[2, "pyqstrat.account.find_index_before"]], "find_last_non_nan_index() (in module pyqstrat.account)": [[2, "pyqstrat.account.find_last_non_nan_index"]], "flatten_keys() (in module pyqstrat.optimize)": [[2, "pyqstrat.optimize.flatten_keys"]], "foo() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.foo"]], "future_code_to_month() (in module pyqstrat.markets)": [[2, "pyqstrat.markets.future_code_to_month"]], "future_code_to_month_number() (in module pyqstrat.markets)": [[2, "pyqstrat.markets.future_code_to_month_number"]], "gamma() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.gamma"]], "get() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.get"]], "get() (pyqstrat.pq_types.contractgroup static method)": [[2, "pyqstrat.pq_types.ContractGroup.get"]], "get_child_logger() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_child_logger"]], "get_config() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_config"]], "get_contract() (pyqstrat.pq_types.contractgroup method)": [[2, "pyqstrat.pq_types.ContractGroup.get_contract"]], "get_contract_price_from_array_dict() (in module pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.get_contract_price_from_array_dict"]], "get_contract_price_from_dict() (in module pyqstrat.strategy_components)": [[2, "pyqstrat.strategy_components.get_contract_price_from_dict"]], "get_contracts() (pyqstrat.pq_types.contractgroup method)": [[2, "pyqstrat.pq_types.ContractGroup.get_contracts"]], "get_current_symbol() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_current_symbol"]], "get_date_from_weekday() (in module pyqstrat.holiday_calendars)": [[2, "pyqstrat.holiday_calendars.get_date_from_weekday"]], "get_default() (pyqstrat.pq_types.contractgroup static method)": [[2, "pyqstrat.pq_types.ContractGroup.get_default"]], "get_empty_np_value() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_empty_np_value"]], "get_expiry() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_expiry"]], "get_expiry() (pyqstrat.markets.eminioption static method)": [[2, "pyqstrat.markets.EminiOption.get_expiry"]], "get_future_code() (in module pyqstrat.markets)": [[2, "pyqstrat.markets.get_future_code"]], "get_main_logger() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_main_logger"]], "get_next_symbol() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_next_symbol"]], "get_or_create() (pyqstrat.pq_types.contract static method)": [[2, "pyqstrat.pq_types.Contract.get_or_create"]], "get_paths() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_paths"]], "get_previous_symbol() (pyqstrat.markets.eminifuture static method)": [[2, "pyqstrat.markets.EminiFuture.get_previous_symbol"]], "get_temp_dir() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.get_temp_dir"]], "get_trades_for_date() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.get_trades_for_date"]], "get_trading_days() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.get_trading_days"]], "handle_non_finite_returns() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.handle_non_finite_returns"]], "has_display() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.has_display"]], "hdf5_copy() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_copy"]], "hdf5_repack() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_repack"]], "hdf5_to_df() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_to_df"]], "hdf5_to_np_arrays() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.hdf5_to_np_arrays"]], "implied_vol() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.implied_vol"]], "in_debug() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.in_debug"]], "in_ipython() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.in_ipython"]], "indicators (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.indicators"]], "infer_compression() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.infer_compression"]], "infer_frequency() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.infer_frequency"]], "invalid() (pyqstrat.pq_types.price static method)": [[2, "pyqstrat.pq_types.Price.invalid"]], "is_basket() (pyqstrat.pq_types.contract method)": [[2, "pyqstrat.pq_types.Contract.is_basket"]], "is_newer() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.is_newer"]], "is_open() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.is_open"]], "is_trading_day() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.is_trading_day"]], "leading_nan_to_zero() (in module pyqstrat.account)": [[2, "pyqstrat.account.leading_nan_to_zero"]], "limit_increment (pyqstrat.strategy_components.closepositionexitrule attribute)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.limit_increment"]], "limit_increment (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.limit_increment"]], "limit_price (pyqstrat.pq_types.limitorder attribute)": [[2, "pyqstrat.pq_types.LimitOrder.limit_price"]], "limit_price (pyqstrat.pq_types.stoplimitorder attribute)": [[2, "pyqstrat.pq_types.StopLimitOrder.limit_price"]], "linear_interpolate() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.linear_interpolate"]], "log_orders (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.log_orders"]], "log_trades (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.log_trades"]], "long (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.long"]], "long (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.long"]], "long (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.long"]], "marker_mode (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.marker_mode"]], "market_sims (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.market_sims"]], "max_position_size (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.max_position_size"]], "metric() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.metric"]], "metrics() (pyqstrat.evaluator.evaluator method)": [[2, "pyqstrat.evaluator.Evaluator.metrics"]], "mid() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.mid"]], "millis_since_epoch() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.millis_since_epoch"]], "min_price_diff_pct (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.min_price_diff_pct"]], "min_stop_returnt (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.min_stop_returnt"]], "module": [[2, "module-pyqstrat"], [2, "module-pyqstrat.account"], [2, "module-pyqstrat.evaluator"], [2, "module-pyqstrat.holiday_calendars"], [2, "module-pyqstrat.interactive_plot"], [2, "module-pyqstrat.markets"], [2, "module-pyqstrat.optimize"], [2, "module-pyqstrat.portfolio"], [2, "module-pyqstrat.pq_io"], [2, "module-pyqstrat.pq_types"], [2, "module-pyqstrat.pq_utils"], [2, "module-pyqstrat.pyqstrat_cpp"], [2, "module-pyqstrat.pyqstrat_io"], [2, "module-pyqstrat.strategy"], [2, "module-pyqstrat.strategy_builder"], [2, "module-pyqstrat.strategy_components"]], "monotonically_increasing() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.monotonically_increasing"]], "multiplier (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.multiplier"]], "name (pyqstrat.pq_types.contractgroup attribute)": [[2, "pyqstrat.pq_types.ContractGroup.name"]], "nan_to_zero() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.nan_to_zero"]], "net_pnl (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.net_pnl"]], "net_pnl() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.net_pnl"]], "np_arrays_to_hdf5() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.np_arrays_to_hdf5"]], "np_bucket() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_bucket"]], "np_find_closest() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_find_closest"]], "np_inc_dates() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_inc_dates"]], "np_indexof() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_indexof"]], "np_indexof_sorted() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_indexof_sorted"]], "np_parse_array() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_parse_array"]], "np_rolling_window() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_rolling_window"]], "np_round() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_round"]], "np_uniques() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.np_uniques"]], "num_trading_days() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.num_trading_days"]], "on_widgets_updated() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.on_widgets_updated"]], "orders() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.orders"]], "parse_datetimes() (in module pyqstrat.pyqstrat_io)": [[2, "pyqstrat.pyqstrat_io.parse_datetimes"]], "percent_of_equity (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.percent_of_equity"]], "percent_of_equity (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.percent_of_equity"]], "percentile_buckets() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.percentile_buckets"]], "percentile_of_score() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.percentile_of_score"]], "plot() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.plot"]], "plot_2d() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.plot_2d"]], "plot_3d() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.plot_3d"]], "plot_return_metrics() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.plot_return_metrics"]], "plot_returns() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.plot_returns"]], "pnl() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.pnl"]], "pnl_calc_time (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.pnl_calc_time"]], "position() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.position"]], "position() (pyqstrat.account.contractpnl method)": [[2, "pyqstrat.account.ContractPNL.position"]], "positions() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.positions"]], "post_trade_func (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.post_trade_func"]], "price_dict (pyqstrat.strategy_components.pricefuncarraydict attribute)": [[2, "pyqstrat.strategy_components.PriceFuncArrayDict.price_dict"]], "price_dict (pyqstrat.strategy_components.pricefuncarrays attribute)": [[2, "pyqstrat.strategy_components.PriceFuncArrays.price_dict"]], "price_dict (pyqstrat.strategy_components.pricefuncdict attribute)": [[2, "pyqstrat.strategy_components.PriceFuncDict.price_dict"]], "price_func (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.price_func"]], "price_func (pyqstrat.strategy_components.closepositionexitrule attribute)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.price_func"]], "price_func (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.price_func"]], "price_func (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.price_func"]], "price_func (pyqstrat.strategy_components.stopreturnexitrule attribute)": [[2, "pyqstrat.strategy_components.StopReturnExitRule.price_func"]], "price_func (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.price_func"]], "price_function (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.price_function"]], "price_indicator (pyqstrat.strategy_components.vwapmarketsimulator attribute)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.price_indicator"]], "price_rounding (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.price_rounding"]], "properties (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.properties"]], "properties (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.properties"]], "properties (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.properties"]], "pyqstrat": [[2, "module-pyqstrat"]], "pyqstrat.account": [[2, "module-pyqstrat.account"]], "pyqstrat.evaluator": [[2, "module-pyqstrat.evaluator"]], "pyqstrat.holiday_calendars": [[2, "module-pyqstrat.holiday_calendars"]], "pyqstrat.interactive_plot": [[2, "module-pyqstrat.interactive_plot"]], "pyqstrat.markets": [[2, "module-pyqstrat.markets"]], "pyqstrat.optimize": [[2, "module-pyqstrat.optimize"]], "pyqstrat.portfolio": [[2, "module-pyqstrat.portfolio"]], "pyqstrat.pq_io": [[2, "module-pyqstrat.pq_io"]], "pyqstrat.pq_types": [[2, "module-pyqstrat.pq_types"]], "pyqstrat.pq_utils": [[2, "module-pyqstrat.pq_utils"]], "pyqstrat.pyqstrat_cpp": [[2, "module-pyqstrat.pyqstrat_cpp"]], "pyqstrat.pyqstrat_io": [[2, "module-pyqstrat.pyqstrat_io"]], "pyqstrat.strategy": [[2, "module-pyqstrat.strategy"]], "pyqstrat.strategy_builder": [[2, "module-pyqstrat.strategy_builder"]], "pyqstrat.strategy_components": [[2, "module-pyqstrat.strategy_components"]], "qty (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.qty"]], "qty (pyqstrat.pq_types.roundtriptrade attribute)": [[2, "pyqstrat.pq_types.RoundTripTrade.qty"]], "read_file() (in module pyqstrat.pyqstrat_io)": [[2, "pyqstrat.pyqstrat_io.read_file"]], "reason_code (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.reason_code"]], "reason_code (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.reason_code"]], "reason_code (pyqstrat.strategy_components.closepositionexitrule attribute)": [[2, "pyqstrat.strategy_components.ClosePositionExitRule.reason_code"]], "reason_code (pyqstrat.strategy_components.percentofequitytradingrule attribute)": [[2, "pyqstrat.strategy_components.PercentOfEquityTradingRule.reason_code"]], "reason_code (pyqstrat.strategy_components.stopreturnexitrule attribute)": [[2, "pyqstrat.strategy_components.StopReturnExitRule.reason_code"]], "reason_code (pyqstrat.strategy_components.vwapcloserule attribute)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.reason_code"]], "reason_code (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.reason_code"]], "remove_dups() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.remove_dups"]], "reopen_qty (pyqstrat.pq_types.rollorder attribute)": [[2, "pyqstrat.pq_types.RollOrder.reopen_qty"]], "request_cancel() (pyqstrat.pq_types.order method)": [[2, "pyqstrat.pq_types.Order.request_cancel"]], "resample_trade_bars() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.resample_trade_bars"]], "resample_ts() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.resample_ts"]], "resample_vwap() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.resample_vwap"]], "rho() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.rho"]], "roundtrip_trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.roundtrip_trades"]], "roundtrip_trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.roundtrip_trades"]], "rules (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.rules"]], "run() (pyqstrat.optimize.optimizer method)": [[2, "pyqstrat.optimize.Optimizer.run"]], "run() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run"]], "run() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run"]], "run_indicators() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run_indicators"]], "run_indicators() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run_indicators"]], "run_rules() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run_rules"]], "run_rules() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run_rules"]], "run_signals() (pyqstrat.portfolio.portfolio method)": [[2, "pyqstrat.portfolio.Portfolio.run_signals"]], "run_signals() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.run_signals"]], "secondary_y (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.secondary_y"]], "series_to_array() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.series_to_array"]], "set_defaults() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.set_defaults"]], "set_ipython_defaults() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.set_ipython_defaults"]], "set_log_orders() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_log_orders"]], "set_log_trades() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_log_trades"]], "set_pnl_calc_time() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_pnl_calc_time"]], "set_price_function() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_price_function"]], "set_property() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.set_property"]], "set_starting_equity() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_starting_equity"]], "set_strategy_context() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_strategy_context"]], "set_timestamps() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_timestamps"]], "set_trade_lag() (pyqstrat.strategy_builder.strategybuilder method)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.set_trade_lag"]], "shift_np() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.shift_np"]], "show_detail (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.show_detail"]], "signals (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.signals"]], "simple_data_filter() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.simple_data_filter"]], "simple_dimension_filter() (in module pyqstrat.interactive_plot)": [[2, "pyqstrat.interactive_plot.simple_dimension_filter"]], "single_entry_per_day (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.single_entry_per_day"]], "single_entry_per_day (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.single_entry_per_day"]], "slippage_pct (pyqstrat.strategy_components.simplemarketsimulator attribute)": [[2, "pyqstrat.strategy_components.SimpleMarketSimulator.slippage_pct"]], "spread() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.spread"]], "starting_equity (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.starting_equity"]], "status (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.status"]], "stop_price_ind (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.stop_price_ind"]], "stop_return_func (pyqstrat.strategy_components.bracketorderentryrule attribute)": [[2, "pyqstrat.strategy_components.BracketOrderEntryRule.stop_return_func"]], "stop_return_func (pyqstrat.strategy_components.stopreturnexitrule attribute)": [[2, "pyqstrat.strategy_components.StopReturnExitRule.stop_return_func"]], "str2date() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.str2date"]], "strategy_context (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.strategy_context"]], "strtup2date() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.strtup2date"]], "symbol (pyqstrat.pq_types.contract attribute)": [[2, "pyqstrat.pq_types.Contract.symbol"]], "symbols() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.symbols"]], "test_account() (in module pyqstrat.account)": [[2, "pyqstrat.account.test_account"]], "test_evaluator() (in module pyqstrat.evaluator)": [[2, "pyqstrat.evaluator.test_evaluator"]], "test_hdf5_to_df() (in module pyqstrat.pq_io)": [[2, "pyqstrat.pq_io.test_hdf5_to_df"]], "test_interactive_plot() (pyqstrat.interactive_plot.testinteractiveplot method)": [[2, "pyqstrat.interactive_plot.TestInteractivePlot.test_interactive_plot"]], "test_optimize() (in module pyqstrat.optimize)": [[2, "pyqstrat.optimize.test_optimize"]], "theta() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.theta"]], "thickness (pyqstrat.interactive_plot.lineconfig attribute)": [[2, "pyqstrat.interactive_plot.LineConfig.thickness"]], "third_friday_of_month() (pyqstrat.holiday_calendars.calendar method)": [[2, "pyqstrat.holiday_calendars.Calendar.third_friday_of_month"]], "time_in_force (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.time_in_force"]], "timestamp (pyqstrat.pq_types.order attribute)": [[2, "pyqstrat.pq_types.Order.timestamp"]], "timestamp (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.timestamp"]], "timestamp_unit (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.timestamp_unit"]], "timestamps (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.timestamps"]], "to_csv() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.to_csv"]], "touch() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.touch"]], "trade_lag (pyqstrat.strategy_builder.strategybuilder attribute)": [[2, "pyqstrat.strategy_builder.StrategyBuilder.trade_lag"]], "trades() (pyqstrat.account.account method)": [[2, "pyqstrat.account.Account.trades"]], "trades() (pyqstrat.strategy.strategy method)": [[2, "pyqstrat.strategy.Strategy.trades"]], "transform() (pyqstrat.interactive_plot.testinteractiveplot method)": [[2, "pyqstrat.interactive_plot.TestInteractivePlot.transform"]], "trigger_price (pyqstrat.pq_types.stoplimitorder attribute)": [[2, "pyqstrat.pq_types.StopLimitOrder.trigger_price"]], "triggered (pyqstrat.pq_types.stoplimitorder attribute)": [[2, "pyqstrat.pq_types.StopLimitOrder.triggered"]], "try_frequency() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.try_frequency"]], "update() (pyqstrat.interactive_plot.interactiveplot method)": [[2, "pyqstrat.interactive_plot.InteractivePlot.update"]], "valid (pyqstrat.pq_types.price attribute)": [[2, "pyqstrat.pq_types.Price.valid"]], "valid() (pyqstrat.optimize.experiment method)": [[2, "pyqstrat.optimize.Experiment.valid"]], "vector (pyqstrat.strategy_components.vectorindicator attribute)": [[2, "pyqstrat.strategy_components.VectorIndicator.vector"]], "vector (pyqstrat.strategy_components.vectorsignal attribute)": [[2, "pyqstrat.strategy_components.VectorSignal.vector"]], "vega() (in module pyqstrat.pyqstrat_cpp)": [[2, "pyqstrat.pyqstrat_cpp.vega"]], "volume_indicator (pyqstrat.strategy_components.vwapmarketsimulator attribute)": [[2, "pyqstrat.strategy_components.VWAPMarketSimulator.volume_indicator"]], "vw_mid() (pyqstrat.pq_types.price method)": [[2, "pyqstrat.pq_types.Price.vw_mid"]], "vwap_end_time (pyqstrat.pq_types.vwaporder attribute)": [[2, "pyqstrat.pq_types.VWAPOrder.vwap_end_time"]], "vwap_minutes (pyqstrat.strategy_components.vwapcloserule attribute)": [[2, "pyqstrat.strategy_components.VWAPCloseRule.vwap_minutes"]], "vwap_minutes (pyqstrat.strategy_components.vwapentryrule attribute)": [[2, "pyqstrat.strategy_components.VWAPEntryRule.vwap_minutes"]], "vwap_stop (pyqstrat.pq_types.vwaporder attribute)": [[2, "pyqstrat.pq_types.VWAPOrder.vwap_stop"]], "zero_to_nan() (in module pyqstrat.pq_utils)": [[2, "pyqstrat.pq_utils.zero_to_nan"]]}}) \ No newline at end of file