diff --git a/src/indicator.ts b/src/indicator.ts new file mode 100644 index 0000000..a778121 --- /dev/null +++ b/src/indicator.ts @@ -0,0 +1,6 @@ +import { Alpaca } from "./alpaca"; + +export interface Indicator { + name: string; + evaluate(alpaca: Alpaca): Promise; +} diff --git a/src/strategy.ts b/src/strategy.ts new file mode 100644 index 0000000..c8ea4af --- /dev/null +++ b/src/strategy.ts @@ -0,0 +1,15 @@ +import { Alpaca } from "./alpaca"; + +export type SignalDirection = 'buy' | 'sell'; + +export interface Signal { + symbol: string; + direction: SignalDirection; + allocation: number; // fraction of this strategy's capital to use (0-1) +} + +export interface Strategy { + name: string; + capitalAllocation: number; // fraction of total account capital (0-1) + execute(alpaca: Alpaca): Promise; +}