Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
node-red-contrib-alpaca
Advanced tools
Readme
I've decided to re-integrate everything into one package again, v2.0 and v2.1 were both structured with two complementary packages one mandatory "auth-config" and one optional "simple" set of nodes. If you were using the node-red-contrib-alpaca-simple package then those nodes will give a "Type already registered" error - however it won't let you remove them through the palette manager, same with the alpaca-config node.
If you are getting these errors run from your .node-red directory:
npm remove node-red-contrib-alpaca-auth
npm remove node-red-contrib-alpaca-simple
If you have any problems, raise an issue on GitHub.
This project wraps the official Node.js library for Alpaca into useful nodes for Node-RED.
Node-RED is a visual programming tool based on NodeJS. Alpaca is a US stock trading API.
In v2.0.0 this package has been pared down to just two nodes.
If you updated and are now missing nodes, search instead for "node-red-contrib-alpaca-simple".
This node provides access to any of the basic functions in the official SDK. In general the node is designed to be the simplest possible wrapper for the SDK.
The internal processing can be described as follows:
The function can be set by msg.topic, or by using the dropdown in the node configuration panel. To guide your programming, an example / template input will appear in the config panel when the selection changes.
Please refer to the official API documentation for more details on individual functions' behavior.
Official API Docs: https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v2/real-time/
This node connects to the V2 websocket. The config node creates the connection which multiplexes the data to the individual nodes. Alpaca's free data plan currently limits to one connection which is accomplished by limiting your flow to use one config node.
By default the listener nodes connect to the symbol and subscription defined in the configuration panel. If you check the "Programmatic Config" option then an input connection becomes available. This input will accept a new symbol and/or subscription to update the listener in real time. Symbol will always be replaced by msg.payload but the subscription will only be replaced if it is one of the valid subscriptions: "trades", "quotes", or "bars".
Example Quotes Response:
{
"topic": "onStockQuote",
"payload": {
"T": "q",
"Symbol": "FB",
"BidExchange": "V",
"BidPrice": 339.41,
"BidSize": 1,
"AskExchange": "V",
"AskPrice": 339.52,
"AskSize": 1,
"Condition": [
"R"
],
"Tape": "C",
"Timestamp": "2021-06-22T19:43:01.848529883Z"
},
"_msgid": "6665f836.954ab8"
}
Example Trades Response:
{
"topic": "onStockTrade",
"payload": {
"T": "t",
"ID": 5844,
"Symbol": "FB",
"Exchange": "V",
"Price": 339.37,
"Size": 23,
"Conditions": [
"@",
"I"
],
"Tape": "C",
"Timestamp": "2021-06-22T19:43:10.440076072Z"
},
"_msgid": "1f2edc2b.29cd24"
}
Example Bars Response:
{
"topic": "onStockBar",
"payload": {
"T": "b",
"Symbol": "FB",
"OpenPrice": 339.41,
"ClosePrice": 339.38,
"HighPrice": 339.49,
"LowPrice": 339.38,
"Volume": 2287,
"Timestamp": "2021-06-22T19:43:00Z"
},
"_msgid": "73754e51.b2361"
}
FAQs
Nodes for connecting to the Alpaca stock trading API.
The npm package node-red-contrib-alpaca receives a total of 12 weekly downloads. As such, node-red-contrib-alpaca popularity was classified as not popular.
We found that node-red-contrib-alpaca demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.