@chirag1702/algox
v1.0.0
Published
Algorithmic trading framework for Indian Stock Market
Maintainers
Readme
@chirag1702/algox
@chirag1702/algox is a TypeScript framework for building event-driven algorithmic trading systems for Indian markets.
What You Get
- Strategy orchestration through
StrategyEngine - Pluggable broker integrations through
BrokerAdapter - A reusable strategy base class via
BaseStrategy - Type-safe market data, order, account, and position models
- Built-in indicators and indicator runtime services
MockBrokerPluginfor local development and test flows
Installation
npm install @chirag1702/algoxQuick Start
import {
BaseStrategy,
Exchange,
InstrumentType,
MockBrokerPlugin,
StrategyEngine,
Timeframe,
type Candle,
type StrategyConfig,
type StrategyContext,
} from '@chirag1702/algox';
class DemoStrategy extends BaseStrategy {
strategyId = 'demo-strategy';
strategyName = 'Demo Strategy';
config: StrategyConfig = {
brokerAccounts: [
{
accountId: 'paper-account',
broker: 'mock',
allocatedCapital: 100000,
},
],
instruments: [
{
symbol: 'RELIANCE',
exchange: Exchange.NSE,
instrumentType: InstrumentType.EQUITY,
tradingSymbol: 'RELIANCE',
lotSize: 1,
tickSize: 0.05,
},
],
timeframes: [Timeframe.FIVE_MINUTE],
parameters: {},
};
async onBar(candle: Candle, context: StrategyContext): Promise<void> {
await context.logger.info('New candle received', {
symbol: candle.instrument.symbol,
close: candle.close,
});
}
}
async function main(): Promise<void> {
const engine = new StrategyEngine();
engine.brokerAdapter.registerPlugin('mock', new MockBrokerPlugin());
await engine.addStrategy(new DemoStrategy());
await engine.start();
}
void main();Public API
Import supported runtime values and types from the package root:
import { StrategyEngine, BaseStrategy } from '@chirag1702/algox';Deep imports from internal src/ or dist/ paths are not part of the public package contract.
Documentation
Long-form strategy guides, broker plugin guides, and examples remain in the repository source tree. This npm package intentionally publishes only the compiled runtime, README, and license.
License
MIT
