open-index/open-npm huggingface dataset:
npm package: @sharplygroup/n8n-nodes-xtb
Description: n8n community node for XTB (X-Trade Brokers) trading platform integration using WebSocket API
Author: Adrian Budzyński
Latest version: 0.1.4

# @sharplygroup/n8n-nodes-xtb

This is an n8n community node. It lets you use XTB in your n8n workflows.

XTB is a global online trading platform that offers access to a wide range of financial markets, including forex, indices, commodities, stocks, and ETFs.

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.

[Installation](#installation)  
[Operations](#operations)  
[Credentials](#credentials)
[Compatibility](#compatibility)  
[Resources](#resources)

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.

## Operations

The following operations are supported by this node:

*   **Account:** `getCurrentUserData`, `getMarginLevel`
*   **Calculation:** `getCommissionDef`, `getMarginTrade`, `getProfitCalculation`
*   **Dma:** `getStepRules`
*   **MarketData:** `getCalendar`, `getChartLastRequest`, `getChartRangeRequest`, `getTickPrices`, `getTradingHours`
*   **News:** `getNews`
*   **Server:** `getServerTime`, `getVersion`, `ping`
*   **Symbol:** `getAllSymbols`, `getSymbol`
*   **Trade:** `getTrades`, `getTradeRecords`, `getTradesHistory`, `getTradeStatus`
*   **Trading:** `tradeTransaction`, `tradeTransactionStatus`

## Credentials

To authenticate with the XTB API, you need to provide the following credentials:

*   **User ID:** Your XTB user ID.
*   **Password:** Your XTB password.
*   **Environment:** Whether to use the demo or real trading environment. You can select the environment in the credentials settings.

Before using the XTB node, you need to have an XTB account. You can sign up for a demo account on the [XTB website](https://www.xtb.com/).

## Compatibility

This node is compatible with the latest version of n8n. There are no known incompatibility issues.

## Resources

* [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
* [XTB API Documentation](https://developers.xstore.pro/documentation/)
npm package: @sharplygroup/xtb-api-js
Description: A module for interacting with the XTB API
Author: Adrian Budzyński
Latest version: 0.1.21

# xtb-api-js

## Description

A NodeJS library for interacting with the XTB API. It provides functionalities for account operations, market data, trading operations, and more.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)
- [Credits](#credits)

## Installation

```bash
npm install @sharplygroup/xtb-api-js
```

or

```bash
yarn add @sharplygroup/xtb-api-js
```

## Example usage

```javascript
const {
  WebSocketManager,
  AccountOperations,
} = require("@sharplygroup/xtb-api-js");

const wsManager = new WebSocketManager({
  userId: "your_user_id", // Replace with your user ID
  password: "your_password", // Replace with your password
  demo: true, // Set to false for live account
});

async function getAccountData() {
  try {
    await wsManager.connect();
    const accountOperations = new AccountOperations(wsManager);
    const accountData = await accountOperations.getCurrentUserData();
    console.log(accountData);
  } catch (error) {
    console.error(error);
  } finally {
    await wsManager.disconnect();
  }
}

getAccountData();
```

## Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

## License

[MIT](LICENSE)

## Support

Please open an issue on GitHub for any questions or problems.

## Credits

Acknowledgment of any contributors or dependencies.