INNER CODE UNIT · Python
_snapshot_parameters
jptsantossilva/BEC · bec/main.py:414
def _snapshot_parameters(pos_row=None) -> dict:
if pos_row is None:
return {}
snapshot = database.parse_strategy_params(pos_row.get("Strategy_Params_JSON", ""))
if not isinstance(snapshot, dict):
return {}
parameters = snapshot.get("parameters")
if isinstance(parameters, dict):
return dict(parameters)
return {
key: value
for key, value in snapshot.items()
if key not in {"engine", "definition", "risk", "entry_state"}
}
def _snapshot_definition(pos_row=None) -> dict:
if pos_row is None: