INNER CODE UNIT · Python

_position_has_strategy_params_snapshot

jptsantossilva/BEC · bec/main.py:496

def _position_has_strategy_params_snapshot(pos_row) -> bool:
    snapshot = database.parse_strategy_params(pos_row.get("Strategy_Params_JSON", ""))
    parameters = snapshot.get("parameters") if isinstance(snapshot, dict) else None
    return isinstance(parameters, dict) and bool(parameters)


def _has_approved_backtest(strategy_id: str, symbol: str, timeframe: str) -> bool:
    return database.is_active_backtest_approved_for_live_buy(
        symbol=symbol,
        time_frame=timeframe,
        strategy_id=strategy_id,
    )


def get_strategy_parameter_overrides(strategy_id: str, first_value=0, second_value=0, pos_row=None) -> dict:
    try:
        definition = database.get_strategy_definition(strategy_id)
    except Exception:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…