Skip to content

v2.4.1 - standard brokerage by default, MCX option and NSE currency costs, lots, charges(), discord() and slack()

Latest

Choose a tag to compare

@marketcalls marketcalls released this 23 Nov 21:38
534dc8e

openalgo 2.4.1 charges what most brokers bill by default, costs MCX options and NSE currency
derivatives, lets the cost helpers count in lots, and adds three REST calls: charges(),
discord() and slack(). Live results after a restart say which start they cover.

What changed

  • "standard" brokerage by default. Delivery orders pay 2.5 percent of the order value or
    Rs 20, whichever is lower; intraday orders 0.1 percent or Rs 20; futures 0.03 percent or
    Rs 20; options Rs 20 per executed order. It is the default of bt.backtest, bt.live,
    bt.optimize, bt.robustness, bt.walk_forward and every cost helper. Pass
    costs="zerodha" for the figures of 2.4.0; that preset is unchanged.
  • MCX options and NSE currency derivatives are costed. MCX options on non-agri
    commodities and NSE currency futures and options are priced at their exchange rates, and
    calculator rounding reproduces the broker's online calculator: one COPPER option lot
    bought at 100 and sold at 110 costs Rs 452.28, one USDINR futures lot bought at 88.3300 and
    sold at 88.3525 Rs 48.14, and the same as an option Rs 116.42.
  • NSE currency futures can be backtested. USDINR, EURINR, GBPINR and JPYINR are in the
    built-in reference tables, counted in units of the base currency as OpenAlgo counts them
    (a USDINR lot is 1,000). bt.live refuses currency derivatives in this release.
  • Cost helpers count in lots. trade_cost, round_trip_cost and trade_costs take
    lots= with symbol= and exchange=, as a broker's calculator counts commodity and
    currency trades: one ALUMINI lot bought at 250 and sold at 252 costs Rs 90.43.
  • Three new REST calls. client.charges(...) prices one order's brokerage and statutory
    charges through OpenAlgo's Charges API before it is placed. client.discord(message) and
    client.slack(message) post a message through the webhook saved in OpenAlgo.
  • Live results after a restart. The portfolio summary and tearsheet of a restarted start
    say they cover that start only, the daily summary names the contract notes' charges when
    they differ from the modelled figure, and the start banner's version-changed line names the
    parameters whose values changed.

Changes in results

  • Backtests with delivery trades, and with intraday orders below about Rs 66,667, pay more
    brokerage plus the GST on it. Trades do not change, and futures and options results are
    unchanged. A delivery round trip of two orders of Rs 800 or more pays Rs 47.20 more.
  • A strategy class holding a nested ABC, Protocol, Flag or IntFlag gets a new version id
    once, so a restart on the day of the upgrade reports a version change for it.

Checks

On the release tree: test/backtest, feed, indicator and REST tests 16,048 passed, 7 skipped; Rust fmt, clippy and tests clean on the kernel; ruff check and format clean; backtest speed targets met (530,084 strategy callbacks a second, 1M bars with conditions in 1.33 s, three strategies of 1M bars each on one account in 4.72 s); live loop 99th percentile 18.6 us against a 500 us target; docs examples 109 passed against a running OpenAlgo server. CI built and smoke-tested the wheels for Linux (x86_64, aarch64), macOS (x86_64, arm64) and Windows (x86_64).

Links

Install

pip install -U openalgo