8000 GitHub - quantform/quantform: Node.js library for building systematic trading strategies in a declarative way.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

quantform/quantform

Repository files navigation

quantform-logo

Node.js library for building systematic trading strategies in reactive way.

Use the power of TypeScript and Reactive Programming to research, develop and test your
market-winning short-term and long-term investments.

www.quantform.io

Documentation · Contributing Guidelines

GH Actions   quantform on npm


The quantform is a trading automation framework designed for crypto markets, supporting centralized and decentralized exchanges. It enables traders to define strategies in a declarative/reactive way, simplifying modifications and execution. Unlike high-frequency trading solutions, quantform focuses on usability and efficiency, helping users automate both long-term and short-term investments.

Built on Node.js with minimal dependencies, it ensures reliability and performance for handling large data volumes and real-time trading. The framework also facilitates multi-exchange trading to leverage market inefficiencies and reduce risks.

  • real-time market data provide traders with up-to-the-moment market, this enables traders to make informed adjustments to their strategies as market conditions change.
  • real-time account data offers instant updates on account balances, open orders, and trade history. This allows traders to monitor their account activity.
  • paper trading and backetsting to test trading algorithms against historical market data. This enables traders to evaluate the performance of their algorithms and identify areas for improvement.
  • stable and reliable built for long-term operation, the system runs continuously for weeks or months without crashes or disruptions. Its stability ensures traders can execute strategies with confidence, minimizing downtime and technical issues.

Components

This mono-repo contains following components:

  • quantform/core on npm
  • quantform/ethereum on npm
  • quantform/sqlite on npm
  • quantform/binance on npm
  • quantform/hyperliquid on npm
  • quantform/telegram on npm

Documentation

You can find the documentation on the website.

Sample Code

/**
 * Subscribe for given instrument market data and aggregate the volume.
 */
export function whenTradeVolumeAccumulated(instrument: InstrumentSelector) {
  const { whenTrade } = useBinance();
  const { error } = useLogger(whenTradeVolumeAccumulated.name);

  let volume = d.Zero;

  return whenTrade(instrument).pipe(
    map(it => {
      volume = volume.add(it.quantity);

      return volume;
    }),
    catchError(e => {
      error('connection lost...');

      return throwError(() => e);
    }),
    retry({ count: 5, delay: 1000 })
  );
}

/**
 * Describe strategy behavior
 */
export default strategy(() => {
  behavior(() => {
    const { info } = useLogger('market-data-streaming');

    return zip([
      whenTradeVolumeAccumulated(instrumentOf('binance:btc-usdt')),
      whenTradeVolumeAccumulated(instrumentOf('binance:eth-usdt'))
    ]).pipe(tap(([btc, eth]) => info(`accumulated volume: ${btc} BTC, ${eth} ETH`)));
  });

  return [
    ...binance({}),
    sqlite()
  ];
});

Minimum Example

Scaffold a new sample project in project directory:

npx create-quantform-app .

Execute backtest session:

npm start

Code of Conduct

Please read the full text so that you can understand what actions will and will not be tolerated.

Risk Warning and Disclaimer

Trading Cryptocurrencies, Futures, Forex, CFDs and Stocks involves a risk of loss. Please consider carefully if such trading is appropriate for you. Past performance is not indicative of future results. Articles and content on this website are for entertainment purposes only and do not constitute investment recommendations or advice.

License

This project is MIT licensed.

About

Node.js library for building systematic trading strategies in a declarative way.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors 2

  •  
  •  
0