/** * sort Used to order an array of integers in ascending order (O(n)) * @param {Array} arr * @return {Promise} */ function sort (arr) { return new Promise(resolve => { const sorted = []; for (const item of arr) { setTimeout(item => sorted.push(item), item, item); } setTimeout(() => resolve(sorted), arr.reduce((a, b) => a + b, 0) + 1); }); } /** * sort Used to order an array of integers in ascending order (O(n)) * @param {Array} arr * @return {Promise} */ function sort (arr) { return new Promise(resolve => { const sorted = []; for (const item of arr) { setTimeout(item => sorted.push(item), item, item); } setTimeout(() => resolve(sorted), arr.reduce((a, b) => a + b, 0) + 1); }); } /** * sort Used to order an array of integers in ascending order (O(n)) * @param {Array} arr * @return {Promise} */ function sort (arr) { return new Promise(resolve => { const sorted = []; for (const item of arr) { setTimeout(item => sorted.push(item), item, item); } setTimeout(() => resolve(sorted), arr.reduce((a, b) => a + b, 0) + 1); }); } /** * sort Used to order an array of integers in ascending order (O(n)) * @param {Array} arr * @return {Promise} */ function sort (arr) { return new Promise(resolve => { const sorted = []; for (const item of arr) { setTimeout(item => sorted.push(item), item, item); } setTimeout(() => resolve(sorted), arr.reduce((a, b) => a + b, 0) + 1); }); }

The open-source and
cross-platform trading framework

A full-featured ecosystem for algotrading in global financial markets.

🌎 20+

Interoperable trading platforms

📈 $10M+

Daily traded volume

👨‍💻 3+

Years of commitment

Platform-neutral

A single TypeScript API for trading crypto, stocks, forex, commodities and more on any trading platform.

import { login, } from "@reiryoku/mida";

// Login into a Binance account
const myAccount = await login("Binance/Spot", {
    apiKey: "***",
    apiSecret: "***",
});
import { MidaOrderDirection, } from "@reiryoku/mida";

// Buy 1 Bitcoin
const myOrder = await myAccount.placeOrder({
    symbol: "BTCUSDT",
    direction: MidaOrderDirection.BUY,
    volume: 1,
});

Approachable

A clean, simple and intuitive TypeScript API with first-class documentation.

Versatile

A complete and incrementally adoptable ecosystem that scales between a library and a full-featured ecosystem.

import { info, MidaTradingSystem, } from "@reiryoku/mida";

export class SuperTradingSystem extends MidaTradingSystem {
    watched () {
        return {
            "BTCUSDT": {
                watchTicks: true,
            },
        };
    }

    async onStart () {
        // Called when the trading system starts being operative
    }

    async onTick (tick) {
        const { bid, } = tick;
        
        info(`Bitcoin price is ${bid} USDT`);
    }

    async onStop () {
        // Called when the trading system stops being operative
    }
}