Open drew2323 opened 4 months ago
Currently the ACCOUNT
that is used as only interface is set in RunReq dialog when running strategy (ACCOUNT1)
AS change - in stratvars under stratvars.signals
there can be additional ACCOUNTS
that can be used for trades.
During intiialization in base.py
there is unique set calculated from above and set of unique accounts is stored and those values are the used as keys to
self.account_variables
- account is key and value is AccountVariables
objectself.interface are self.order_notifs
are changed to dictionary and to be keyed by ACCOUNT
-. in set_mode
LiveOrderUpdatesStreamer
- pro každou instanci strategie a každý ACCOUNT je vytvořena vlastní instance. TBD dořešit způsob distribuce, každý streamer dostává všechny - nyní se distribuuje do dané strategie na základě symbolu. Zvážit použití nějakého clientID atp. OMEZENÍ: nelze více bežících strategií na stejný symbol
todo:
Support two Accounts for trading within one strategy. This would allow taking both long/short positions simultaneously, taking advantage of hedging.
Currently only one account is used for trading, thus long and short position within the same time is not possible.
Idea:
Currently the signal within a strategy defintiion is governed by
signal
section instratvars
TOML followed by name of the signal - in the case belowmain
. In the root section there are various attributtes (window open and close, stoplosses etc.) incondition
section there are specific condition for LONG or SHORT positon. Account should probably be new attribute within root signal section.It could also be suffixed by _long or _short string to allow multiple accounts for each direction within I one signal section.
TBD - more details usage, cross referencing etc.
Impacted areas:
stratvars