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
}
}