Skip to content

CGPT5 proposed enhancementsΒ #1318

@bravegag

Description

@bravegag

Enhancement description

  1. Silent order cancellations β†’ add warning with equity & margin context in _Broker._process_orders().
  2. Contingent SL/TP validation missing β†’ ensure SL < entry < TP (or reverse for shorts) when trade is not None.
  3. Same-bar SL/TP ambiguity β†’ replace deferred execution with deterministic rule (e.g., pessimistic fill).
  4. Division by zero in PL% β†’ guard denominators (entry_price, total_invested) against 0 or NaN.
  5. Tiny Trade.close() overshoot β†’ rounding to 1 unit may overshoot; document quantization behavior.
  6. Bankruptcy leaves open orders β†’ clear self.orders when equity <= 0.
  7. Recursive reprocessing risk β†’ replace _process_orders() recursion with while loop.
  8. Canceled proportional order warning β†’ include timestamp, equity, and margin context in the warning.
  9. OHLC sanity checks β†’ optionally assert High >= max(Open,Close) and Low <= min(Open,Close).
  10. Numeric index misdetection β†’ improve timestamp inference (detect seconds vs. milliseconds).
  11. Equity backfill perf β†’ replace pandas backfill with NumPy for large datasets.
  12. Commission config β†’ expose risk_free_rate param and commission timing option ('entry'|'exit'|'both').
  13. Better Strategy param errors β†’ fix spacing and suggest close matches using difflib.get_close_matches.
  14. Strategy.I() Series support β†’ accept pandas Series; refine transpose logic.
  15. SL/TP helper methods β†’ add move_sl_to_break_even() and trail_sl() convenience APIs.
  16. Commission impact option β†’ allow open-trade P/L to include entry commission.
  17. Minor typos β†’ fix β€œthe the”, β€œleverge”, and clarify bullet in Strategy.sell.
  18. Type hints polish β†’ tighten annotations for Trade, Order, Backtest.optimize.
  19. Order.repr verbosity β†’ omit falsy booleans (e.g., contingent=False).
  20. Deprecation message spacing β†’ add missing space before β€œBacktesting 0.2.0.”

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions