Main Content

getsubscriptions

Retrieve Money.Net subscribed symbols and event handler functions

Since R2021b

Description

example

subs = getsubscriptions(c) returns the subscription list subs that contains open subscriptions for the Money.Net web socket interface connection c.

Examples

collapse all

Create Money.Net web socket interface connection c using a user name and password.

username = "user@company.com";
pwd = "999999";

c = moneynetws(username,pwd);

Subscribe to the symbols IBM® and Google® for real-time data updates using the Money.Net connection c.

symbols = ["IBM" "GOOG"];
realtime(c,symbols)

The default event handler function processes real-time data updates.

Retrieve the subscribed symbols and the corresponding event handler function for each symbol using the Money.Net connection c.

subs = getsubscriptions(c)
subs =

  2×2 table

    Symbols           EventHandlers       
    _______    ___________________________

    "GOOG"     {@mnWSRealTimeEventHandler}
    "IBM"      {@mnWSRealTimeEventHandler}

subs returns a table with a row for each symbol and the corresponding event handler function.

Unsubscribe from all symbols using the Money.Net connection c.

stop(c)

Close the Money.Net web socket interface connection.

close(c)

Input Arguments

collapse all

Money.Net web socket interface connection, specified as a moneynetws object created using the moneynetws function.

Output Arguments

collapse all

Subscription list, returned as a table. The list contains all currently subscribed symbols and the corresponding event handler function that is processing real-time updates for each symbol. Each row in the table represents one unique subscription.

If there are no subscribed symbols, subs is an empty table.

Version History

Introduced in R2021b