diff --git a/v2realbot/ENTRY_backtest_strategyVykladaci.py b/v2realbot/ENTRY_backtest_strategyVykladaci.py index 6e06116..ce8098d 100644 --- a/v2realbot/ENTRY_backtest_strategyVykladaci.py +++ b/v2realbot/ENTRY_backtest_strategyVykladaci.py @@ -357,7 +357,7 @@ def next(data, state: StrategyState): #HLAVNI ITERACNI LOG JESTE PRED AKCI - obsahuje aktualni hodnoty vetsiny parametru lp = state.interface.get_last_price(symbol=state.symbol) - state.ilog(e="ENTRY", msg=f"LP:{lp} P:{state.positions}/{round(float(state.avgp),2)} profit:{round(float(state.profit),2)} Trades:{len(state.tradeList)} DEF:{str(is_defensive_mode())}", last_price=lp, stratvars=state.vars) + state.ilog(e="ENTRY", msg=f"LP:{lp} P:{state.positions}/{round(float(state.avgp),3)} profit:{round(float(state.profit),2)} Trades:{len(state.tradeList)} DEF:{str(is_defensive_mode())}", last_price=lp, stratvars=state.vars) #maxSlopeMA = -0.03 #SLOPE ANGLE PROTECTIONs diff --git a/v2realbot/__pycache__/config.cpython-310.pyc b/v2realbot/__pycache__/config.cpython-310.pyc index 586477c..db8f7b6 100644 Binary files a/v2realbot/__pycache__/config.cpython-310.pyc and b/v2realbot/__pycache__/config.cpython-310.pyc differ diff --git a/v2realbot/common/__pycache__/model.cpython-310.pyc b/v2realbot/common/__pycache__/model.cpython-310.pyc index 23bcca9..65d4564 100644 Binary files a/v2realbot/common/__pycache__/model.cpython-310.pyc and b/v2realbot/common/__pycache__/model.cpython-310.pyc differ diff --git a/v2realbot/common/model.py b/v2realbot/common/model.py index 1ca88a0..1d4151b 100644 --- a/v2realbot/common/model.py +++ b/v2realbot/common/model.py @@ -72,6 +72,10 @@ class RunnerView(BaseModel): run_name: Optional[str] = None run_note: Optional[str] = None run_account: Account + run_trade_count: Optional[int] = 0 + run_profit: Optional[float] = 0 + run_positions: Optional[int] = 0 + run_avgp: Optional[float] = 0 run_stopped: Optional[datetime] = None run_paused: Optional[datetime] = None @@ -83,6 +87,10 @@ class Runner(BaseModel): run_account: Account run_name: Optional[str] = None run_note: Optional[str] = None + run_trade_count: Optional[int] + run_profit: Optional[float] + run_positions: Optional[int] + run_avgp: Optional[float] run_stopped: Optional[datetime] = None run_paused: Optional[datetime] = None run_thread: Optional[object] = None diff --git a/v2realbot/controller/services.py b/v2realbot/controller/services.py index 098ecf2..ea9905f 100644 --- a/v2realbot/controller/services.py +++ b/v2realbot/controller/services.py @@ -34,7 +34,12 @@ def get_all_threads(): def get_all_runners(): if len(db.runners) > 0: - print(db.runners) + #print(db.runners) + for i in db.runners: + i.run_profit = round(i.run_instance.state.profit,2) + i.run_trade_count = len(i.run_instance.state.tradeList) + i.run_positions = i.run_instance.state.positions + i.run_avgp = round(i.run_instance.state.avgp,3) return (0, db.runners) else: return (0, []) @@ -54,6 +59,10 @@ def get_stratin(id: UUID): def get_runner(id: UUID): for i in db.runners: if str(i.id) == str(id): + i.run_profit = round(i.run_instance.state.profit,2) + i.run_trade_count = len(i.run_instance.state.tradeList) + i.run_positions = i.run_instance.state.positions + i.run_avgp = round(i.run_instance.state.avgp,3) return (0, i) return (-2, "not found") diff --git a/v2realbot/static/index.html b/v2realbot/static/index.html index c8278ae..b9bc884 100644 --- a/v2realbot/static/index.html +++ b/v2realbot/static/index.html @@ -8,11 +8,13 @@ + +