Documentation
API
Resources
#
API
✨ Quick Start
Mida
Languages
Community
Platforms
Installation
Why JavaScript/TypeScript?
📙 Essentials
connect()
getBalance()
getBalanceSheet()
getEquity()
getUsedMargin()
getFreeMargin()
getMarginLevel()
Primary asset
📙 Orders
MidaOrder()
placeOrder()
Market orders
Limit orders
Stop orders
Time in force
Impact existing positions
Resolvers
getOrders()
getPendingOrders()
getPosition()
Order events
Event: status-change
Event: reject
Event: accept
Event: pending
Event: cancel
Event: execute
Event: expire
Event: trade
Event: pending-price-change
Event: pending-volume-change
Event: expiration-date-change
Order protection
Rejected orders
MidaOrderDirectives
Order execution price
cancel()
📙 Symbols
MidaSymbol()
getSymbols()
getSymbol()
getBid()
getAsk()
getAverage()
isMarketOpen()
📙 Trades
MidaTrade()
Opening trades
Closing trades
getTrades()
Trade events
📙 Positions
MidaPosition()
getOpenPositions()
getUnrealizedGrossProfit()
getUnrealizedCommission()
getUnrealizedSwap()
getUsedMargin()
Position events
Event: trade
Event: volume-open
Event: volume-close
Event: close
Event: protection-change
Event: take-profit-change
Event: stop-loss-change
Position open price
Position realized profits
addVolume()
subtractVolume()
close()
changeProtection()
setTakeProfit()
setStopLoss()
setTrailingStopLoss()
📙 Market Watchers
MarketWatcher()
watch()
Ticks listener
Candlesticks listener
unwatch()
getSymbolDirectives()
📙 Candlesticks
MidaPeriod()
getSymbolPeriods()
Last live candlestick
OHLC
toRenko()
📙 Timeframes
MidaTimeframe
toSeconds()
📙 Market Components
marketComponent()
📙 Decimals
MidaDecimal()
decimal()
Decimal: add()
Decimal: sub()
Decimal: mul()
Decimal: div()
Decimal: toFixed()
Decimal: toNumber()
📙 Paper Trading
Paper Trading and Backtesting
MidaPlaygroundEngine()
Playground: createAccount()
How to provide ticks and candles
Ticks generators
Playground: setTicksGenerator()
Playground: setPeriodsGenerator()
Playground: elapseTime()
Playground: elapseTicks()
Playground: Customizers
Commission customizer
Latency customizer
📙 Trading Systems
MidaTradingSystem()
Trading System: start()
Trading System: stop()
Trading System: watchTicks()
Trading System: watchPeriods()
Trading System: placeOrder()
Hook: configure()
Hook: onStart()
Hook: onStop()
Hook: onTick()
Hook: onPeriodUpdate()
Hook: onPeriodClose()
Hook: onBeforePlaceOrder()
Hook: onPositionImpact()
Hook: onMarketOpen()
Hook: onMarketClose()
Symbol states
Shared state
📙 Assets
MidaAsset()
getAssets()
getAsset()
getBalance()
MidaAssetStatement
getCryptoAssetDepositAddress()
📙 Indicators
MidaIndicator()
createIndicator()
calculate()
next()
Live indicators
📙 Dates
MidaDate()
date()