Skip to content

Releases

OpenAlgo MATLAB Library 1.1.0

Choose a tag to compare

@marketcalls marketcalls released this 16 Oct 00:59

OpenAlgo MATLAB Library 1.1.0

Trade through your own OpenAlgo server from MATLAB: the Command Window, a live script or a scheduled matlab -batch job. This release fixes host name verification on the Java TLS provider, adds tls_ca_file for servers with a private CA, and changes the default strategy name to "MATLAB".

What changed in 1.1.0

Security

  • The Java TLS provider now verifies the server's host name. In 1.0.0 it checked only the certificate chain, so a valid certificate issued for a different host was accepted on wss:// connections that used Java. The .NET and MATLAB Python interface providers already checked the host name; all three providers now do. Upgrade if you connect to a hosted wss:// server, especially when Java is the provider (it is picked when neither .NET nor the MATLAB Python interface is available, or when tls_transport is "java").

Added

  • tls_ca_file on the feed client: a PEM file of CA certificates trusted in addition to the system trust store, for a wss:// server whose certificate comes from a private CA. Set it before connect(); the host name is still verified.
client.tls_ca_file = "C:\certs\my-private-ca.pem";
client.connect();

Behaviour change

  • The default strategy name is now "MATLAB". Orders and requests sent without a strategy argument (placeorder, placesmartorder, basketorder, splitorder, orderstatus, openposition, modifyorder, cancelorder, closeposition, cancelallorder, optionsorder, placegttorder, modifygttorder, cancelgttorder) are now tagged MATLAB instead of Python. If you filter the order book, close positions or cancel orders by the default strategy name, update those filters or pass strategy= explicitly. Calls that pass a strategy name are not affected.

Fixed

  • Help text: every method with a strategy default states Default "MATLAB"., the calling convention in help openalgo and help openalgo.api is described on its own terms, the utility and management methods have their own heading, and help openalgo.FeedAPI explains that an https:// host derives the wss://<host>/ws feed URL by itself.

Install

Download openalgo-matlab-1.1.0.mltbx from the assets below and double-click it in MATLAB, or install it from the Command Window:

matlab.addons.install("openalgo-matlab-1.1.0.mltbx");
openalgo.version()      % '1.1.0'

Or clone the repository and add the folder that contains +openalgo to the MATLAB path:

addpath("C:\path\to\openalgo-matlab-library")

Quick start

client = openalgo.api(api_key=getenv("OPENALGO_API_KEY"), host="http://127.0.0.1:5000");

client.ping()                                        % API key and broker session check
resp = client.placeorder(strategy="MATLAB Strategy", symbol="SBIN", action="BUY", ...
    exchange="NSE", price_type="MARKET", product="MIS", quantity=1);

df = client.history(symbol="SBIN", exchange="NSE", interval="5m", ...
    start_date="2025-04-01", end_date="2025-04-08");    % a timetable

What it covers

  • Orders: place, smart, basket, split, modify, cancel, cancel all, close position, order status, open position.
  • GTT orders: SINGLE and OCO triggers, modify, cancel, GTT order book, with impossible trigger specs refused before anything is sent.
  • Market data: quotes, multi-quotes, depth, symbol, search, history (as a timetable), ticker (JSON or text rows), intervals, expiry, instruments (as a table), synthetic future.
  • Account: funds, order book, trade book, position book, holdings, margin, sandbox P&L by symbol, analyzer status and toggle.
  • Options: option chain, option symbol, options order, multi-leg options order, Greeks for one option or up to 50 at once.
  • Strategy module: list, status, start, stop, close all, close leg, runs, orders and events, plus openalgo.Strategy for the strategy webhook (batch start/stop and signal entries/exits).
  • Notifications and utilities: Telegram and WhatsApp alerts, Telegram bot management, market holidays and timings, chart preferences, ping.
  • Live WebSocket feed: LTP, quotes, market depth (5, 20, 30 or 50 levels where the broker supports them) and real-time order updates, with callbacks or polling, automatic reconnect with subscription replay, verbose logging, and wait, unsubscribe_all, get_broker_info, get_supported_brokers and ws_ping.
  • Hosted servers: give the client https://yourdomain.com and the feed connects to wss://yourdomain.com/ws by itself. Secure WebSocket runs over .NET on Windows, MATLAB's Python interface (Python 3.9 to 3.13) or Java, with certificate and host name verification on every provider.

Good to know

  • Arguments are name=value pairs with exact, case-sensitive names.
  • Responses are MATLAB structs: JSON null becomes [], and a one-element list of records becomes a 1x1 struct.
  • Server and network problems come back as an error struct (status, message, error_type) instead of stopping your script; wrong arguments raise MATLAB errors with openalgo:* identifiers.
  • Feed callbacks fire while MATLAB is idle or during pause; use client.wait(seconds) in matlab -batch scripts.
  • Displaying the client never shows your API key.
  • Every method has its own help text: help openalgo.api/placeorder.

Requirements

  • Tested on MATLAB R2026b.
  • Base MATLAB only: no toolboxes. A local ws:// feed needs nothing else.
  • A running OpenAlgo server. Use analyzer (sandbox) mode while you try things out.

Documentation

OpenAlgo MATLAB library 1.0.0

Choose a tag to compare

@marketcalls marketcalls released this 15 Oct 23:17

OpenAlgo MATLAB Library 1.0.0

The first release of the OpenAlgo MATLAB library. Trade through your own OpenAlgo server from MATLAB: the Command Window, a live script or a scheduled matlab -batch job.

Install

Download openalgo-matlab-1.0.0.mltbx from the assets below and double-click it in MATLAB, or install it from the Command Window:

matlab.addons.install("openalgo-matlab-1.0.0.mltbx");
openalgo.version()      % '1.0.0'

Or clone the repository and add the folder that contains +openalgo to the MATLAB path:

addpath("C:\path\to\openalgo-matlab-library")

A MATLAB File Exchange listing will follow.

Quick start

client = openalgo.api(api_key=getenv("OPENALGO_API_KEY"), host="http://127.0.0.1:5000");

client.ping()                                        % API key and broker session check
resp = client.placeorder(strategy="MATLAB Strategy", symbol="SBIN", action="BUY", ...
    exchange="NSE", price_type="MARKET", product="MIS", quantity=1);

df = client.history(symbol="SBIN", exchange="NSE", interval="5m", ...
    start_date="2025-04-01", end_date="2025-04-08");    % a timetable

What it covers

  • Orders: place, smart, basket, split, modify, cancel, cancel all, close position, order status, open position.
  • GTT orders: SINGLE and OCO triggers, modify, cancel, GTT order book, with impossible trigger specs refused before anything is sent.
  • Market data: quotes, multi-quotes, depth, symbol, search, history (as a timetable), ticker (JSON or text rows), intervals, expiry, instruments (as a table), synthetic future.
  • Account: funds, order book, trade book, position book, holdings, margin, sandbox P&L by symbol, analyzer status and toggle.
  • Options: option chain, option symbol, options order, multi-leg options order, Greeks for one option or up to 50 at once.
  • Strategy module: list, status, start, stop, close all, close leg, runs, orders and events, plus openalgo.Strategy for the strategy webhook (batch start/stop and signal entries/exits).
  • Notifications and utilities: Telegram and WhatsApp alerts, Telegram bot management, market holidays and timings, chart preferences, ping.
  • Live WebSocket feed: LTP, quotes, market depth (5, 20, 30 or 50 levels where the broker supports them) and real-time order updates, with callbacks or polling, automatic reconnect with subscription replay, verbose logging, and wait, unsubscribe_all, get_broker_info, get_supported_brokers and ws_ping.
  • Hosted servers: give the client https://yourdomain.com and the feed connects to wss://yourdomain.com/ws by itself. Secure WebSocket runs over .NET on Windows, MATLAB's Python interface (Python 3.9 to 3.13) or Java, with certificate verification on.

Good to know

  • Arguments are name=value pairs with exact, case-sensitive names.
  • Responses are MATLAB structs: JSON null becomes [], and a one-element list of records becomes a 1x1 struct.
  • Server and network problems come back as an error struct (status, message, error_type) instead of stopping your script; wrong arguments raise MATLAB errors with openalgo:* identifiers.
  • Feed callbacks fire while MATLAB is idle or during pause; use client.wait(seconds) in matlab -batch scripts.
  • Displaying the client never shows your API key.
  • Every method has its own help text: help openalgo.api/placeorder.

Requirements

  • Tested on MATLAB R2026b.
  • Base MATLAB only: no toolboxes. A local ws:// feed needs nothing else.
  • A running OpenAlgo server. Use analyzer (sandbox) mode while you try things out.

Documentation