Hello Tradovate Developers,
I’m excited to announce a new Typescript package I’ve been working on called tradovate-typescript. This package aims to simplify connecting to and deploying trading strategies on Tradovate.
You can connect to quote, tick, or any other type of Tradovate data in just a few lines of code. It also makes running full live or replay strategies really easy. I will post a video this week showing how to build a simple strategy.
If this package gets some stars on GitHub, I wouldn’t be opposed to making a Python or Go version of this package as well. Let me know!
Project Overview: tradovate-typescript is a Typescript wrapper for the Tradovate API, allowing you to quickly set up connections and interact with market data and trading functionality.
Key Features:
- Easy connection to Tradovate services
- Streamlined market data subscription
- Typescript support for improved development experience
Installation: You can install the package using npm or yarn:
npm install tradovate --save
yarn add tradovate
Usage:
Connecting to quote data can be done in a few lines of code.
import 'dotenv/config'
import {TradovateService, AccessTokenRequestBody, MarketDataSocket} from '../../src'
const credentials: AccessTokenRequestBody = {
name: process.env.TV_USER!,
password: process.env.TV_PASSWORD!,
appId: process.env.TV_APP_ID,
appVersion: '1.0.0',
cid: process.env.TV_CID,
sec: process.env.TV_SECRET
}
const service = new TradovateService()
const mdSocket = new MarketDataSocket()
async function main() {
// Pass in credentials and initialize core service
await service.connect(credentials)
// Connect to market data socket
await mdSocket.connect()
// Subscribe to quote data for a ticker
await mdSocket.subscribeQuote('ESU3', item => {
console.log(item)
})
// Disconnect socket after 30 mins
setTimeout(() => {
mdSocket.disconnect()
}, 30 * 60 * 1000)
}
main()
Note: you need a funded Tradovate account with API access enabled and a CME Information License Agreement (ILA) for above code to work.