Questions about dependent scripts
[Deleted User]
Posts: 0
Hi,
I have a question about the behavior of an account object in a pairs-trading like strategy:
I am wondering if the exit script sees the same account object (and the same positions and execution data) from the entry script, or those info. in the account object gets wiped out once the entry script is terminated and the control is passed to the exit script ?
Thanks!
Tagged:
Comments
I would answer my own question here:
The dependent strategy would inherit all the account information from its precedent. Here is an example:
I output the account info right before and after the precedent: dependent_strategy_entry hand over the control to dependent_strategy_exit, and they are the same:
Account info before dependent exit strategy starts:
Account ID: 0
Positions:
account_id: 0
entry_pl: 0.00
mtm_pl: 0.00
buying_power: None
open_capital_long: 0.00
open_capital_short: -229329.00
pending_capital_long: 0.00
pending_capital_short: -615360.24
max_capital_used: 229329.00
max_capital_used_timestamp: 1420209300038700
open_symbols: ['SPY', 'AAPL', 'FB', 'MSFT', 'WMT']
pending_symbols: []
starting exit
dependent_strategy_exit on_start:
Account ID: 0
Positions inherited from entry script:
['SPY', 'AAPL', 'FB', 'MSFT', 'WMT']
Positions:
account_id: 0
entry_pl: 0.00
mtm_pl: 0.00
buying_power: None
open_capital_long: 0.00
open_capital_short: -229329.00
pending_capital_long: 0.00
pending_capital_short: -615360.24
max_capital_used: 229329.00
max_capital_used_timestamp: 1420209300038700
open_symbols: ['SPY', 'AAPL', 'FB', 'MSFT', 'WMT']
pending_symbols: []