Add auto break-even toggle and WeCom hub notifications.
Desktop can auto-pull stop to open+/-1 after a 3$ favorable move; hub pushes open/close events and a 23:00 BJT daily summary via webhook. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,9 +43,20 @@ def load_device() -> dict[str, Any]:
|
||||
data.setdefault("machine_name", platform.node() or "PC")
|
||||
data.setdefault("server", "")
|
||||
data.setdefault("token", "")
|
||||
data.setdefault("auto_break_even", False)
|
||||
return data
|
||||
|
||||
|
||||
def get_auto_break_even() -> bool:
|
||||
return bool(load_device().get("auto_break_even"))
|
||||
|
||||
|
||||
def set_auto_break_even(enabled: bool) -> None:
|
||||
d = load_device()
|
||||
d["auto_break_even"] = bool(enabled)
|
||||
save_device(d)
|
||||
|
||||
|
||||
def save_device(data: dict[str, Any]) -> None:
|
||||
ensure_dir()
|
||||
DEVICE_FILE.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||
|
||||
Reference in New Issue
Block a user