Barfin Network

Core concepts

Functions & Directives

An in-depth exploration of the features and advantages of the Barfin trading system for algorithmic trading. Discover how to create and optimize strategies, conduct trading operations on various exchanges, calculate indicators, and leverage microservices. Uncover the platform's capabilities that will help you achieve success in dynamic financial markets.

Tools and capabilities for algorithmic trading on the Barfin Trading System

In modern algorithmic trading, successful interaction with financial markets demands powerful and flexible tools. The Barfin trading system stands as an exceptional example of such infrastructure, offering a wide range of functions and directives for creating, managing, and optimizing algorithmic strategies. Let's delve into the details to explore the possibilities that the functions and directives of this platform provide.

Implementation of trading actions

Barfin offers more than just calculating indicators – it enables direct trading operations. Within this platform, users can create, manage, and close trades on various exchanges. This encompasses executing market and limit orders, calculating commissions, and adhering to best trading practices.

Indicator calculation and data retrieval

Barfin boasts a rich library of indicators that can be used for market data analysis. The platform allows the calculation of various indicators and retrieving their latest values to make informed decisions in trading.

Integration with various exchanges

One of Barfin's key capabilities is its ability to integrate with different exchanges. The platform provides directives for connecting to various exchanges, obtaining market data, executing orders, and managing portfolios. This empowers traders to operate with different assets across diverse markets, expanding the scope of algorithmic influence.

Creating algorithmic strategies

Barfin supports the creation of algorithmic strategies using TypeScript. Traders can develop their own strategies based on unique insights, research, and data analysis. This facilitates a high degree of flexibility and individuality in trading approaches.

Microservices and strategy management

Barfin enables the creation and management of multiple microservices and strategies in parallel. The platform allows the launch of multiple algorithmic strategies utilizing different tools and parameters, all within a single system.


The Barfin trading system offers a comprehensive set of functions and directives that empower traders to create and manage algorithmic strategies with a high degree of control and flexibility. This opens a wide spectrum of possibilities for achieving success in financial markets amidst dynamic changes and competition.


Here's a simple TypeScript code example demonstrating the creation of an algorithmic trading strategy on the Barfin platform:

// indicators.ts

interface Indicator {
  calculate(data: number[]): number;
}

class MovingAverageIndicator implements Indicator {
  calculate(data: number[]): number {
    const sum = data.reduce((total, value) => total + value, 0);
    return sum / data.length;
  }
}

// strategy.ts

class AlgorithmicStrategy {
  private indicator: Indicator;

  constructor(indicator: Indicator) {
    this.indicator = indicator;
  }

  executeStrategy(data: number[]): void {
    const indicatorValue = this.indicator.calculate(data);
    if (indicatorValue > 50) {
      this.buy();
    } else {
      this.sell();
    }
  }

  private buy(): void {
    console.log("Executing buy order based on strategy.");
  }

  private sell(): void {
    console.log("Executing sell order based on strategy.");
  }
}

// Create an instance of the MovingAverageIndicator
const movingAverageIndicator = new MovingAverageIndicator();

// Create an instance of the AlgorithmicStrategy
const strategy = new AlgorithmicStrategy(movingAverageIndicator);

// Sample data for strategy execution
const data = [60, 55, 40, 65, 70];

// Execute the strategy
strategy.executeStrategy(data);

In this example, we've defined the Indicator interface with a calculate method. We then have the MovingAverageIndicator class that implements this interface to calculate a moving average. The AlgorithmicStrategy class uses the selected indicator to execute a buy or sell strategy based on the indicator's value.

We create an instance of MovingAverageIndicator and then create an AlgorithmicStrategy, passing the indicator to it. We then use test data to execute the strategy.