主要内容

获取实时资金。净数据

这个例子展示了如何从Money中检索实时数据。网络为一个符号。它解释了如何订阅实时更新、停止订阅以及如何使用自定义事件处理程序函数处理实时更新。

要处理实时数据更新,可以使用默认的事件处理程序函数。或者,对于另一种方法,您可以编写自定义事件处理程序函数。用于使用Money编写自定义事件处理函数。净数据,见实时.有关自定义事件处理程序函数,请参见编写和运行自定义事件处理函数

这个例子需要一个Money。网络用户名和密码。如需这些凭据,请联系钱。网

要访问此示例的代码,请输入编辑MoneyNetDataWorkflowExample.m

创造货币。网Connection

创造货币。网connectionc使用用户名和密码。

用户名=“user@company.com”;pwd =“999999”;C = moneynet(用户名,pwd);

检索一个符号的实时数据

获取金钱。网real-time data updates for the IBM®的象征。

符号=“IBM”;实时(c,符号)

默认事件处理程序mnRealTimeEventHandler处理所有实时数据更新。要访问默认事件处理程序的代码,请输入编辑mnRealTimeEventHandler.m

mnRealTimeEventHandler函数创建工作区变量IBMRealTime.的mnRealTimeEventHandler函数填充表IBMRealTime实时数据更新。查看实时数据,打开IBMRealTime在变量编辑器中。

停止实时数据更新

停止符号订阅。

停止(c)

mnRealTimeEventHandler停止处理所有实时数据更新。最后一次实时数据更新仍在IBMRealTime

使用自定义事件处理函数检索实时数据

定义一个自定义事件处理函数myfcn.的myfcn函数显示货币。网real-time data to the Command Window.

Myfcn = @(x)disp(x);

获取金钱。网real-time data updates for the IBM symbol usingmyfcn

符号=“IBM”;实时(c,象征,myfcn)
符号说明Yesterday Yesterday datetime BidAsk exchangeofcurrentbidprice exchangeofcurrenttaskprice High Low Volume YearHigh YearHighDateTime YearLow YearLow datetime Dividend Dividend yield EPS EPSDateTime eps稀释eps稀释datetime PERatio BidSize AskSize LastTradeDate LastTradeTime Open MarketCap Exchange TimeOfLastUpdatetoBidAskOrTrade LastTradeCondition QuoteBidAskCondition AverageVolume CurrencyCode ShortInterest PricetoBookRatio SharesOutstanding Beta VWAP去年SecurityType LastOutsideOfMarketHours LastTradeDateOutsideOfMarketHours LastTradeTimeOutsideOfMarketHours LastTradeDirection LastTradeSize LastTradeExchange  ______ ______________________________ _________ _________________ ______ ______ ____________________________ ____________________________ ______ ______ __________ ________ ________________ _______ _______________ ________ _____________ _____ _________________ __________ __________________ _______ _______ _______ __________________________ ______ _________ ________ _______________________________ __________________ ____________________ _____________ ____________ _____________ ________________ _________________ ____ ______ ________________________ _________________________________ _________________________________ __________________ _____________ _________________ ______ ____________ ' IBM的“国际商务148.31马赫的05/24/16就是151.65 - 151.67”、“151.67 148.50 2476783.00 173.78 116.90 07/20/1502/11/16 5.60 3.77 13.30 02/29/16 00:00:00 11.18 6.00 3.00 05/25/16 13:44:52 148.93 142371.96 '纽交所' 13:44:52 '' '' 4141081.00 '美元' 20241776.00 9.44 959962000.00 0.70 150.72 148.79 05/25/16 09:30:00 '=' 100.00 'OMDF' 151.66 NaN

myfcn在命令窗口中显示IBM的实时数据更新。

停止符号订阅。

停止(c,符号)

myfcn停止在命令窗口中显示实时数据更新。

近的钱。网Connection

关闭(c)

另请参阅

|||

相关的话题

外部网站