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

The open-source and
cross-platform trading engine

A full-featured, progressive engine for algotrading in global financial markets.

🌎 20+

Supported trading platforms

📈 $100M+

Monthly traded volume

👨‍💻 3+

Years of activity

Platform-neutral

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

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

// Connect to a Binance account
const myAccount = await connect("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 { marketComponent, } from "@reiryoku/mida";

const MyComponent = marketComponent({
    async tick (tick) {
        // Fired when there is a market tick
        
        console.log(tick.bid);
        console.log(tick.ask);
    },

    async periodUpdate (period) {
        // Fired when a last live candlestick is updated
    },

    async periodClose (period) {
        // Fired when a candlestick is closed
    },

    // Furthermore, specific timeframes can be targeted
    async periodClose$M15 (period) {
        // Fired when a M15 candlestick is closed
    },

    async marketOpen () {
        // Fired when the market opens
    },

    async update () {
        // Fired when there is any market update of the above
    },
});

const myComponent = await MyComponent(myAccount, "#TSLA");