fixparser-plugin-mcp 9.2.2 → 9.2.3-175e9b8c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/RemoteServer.js +4 -4
- package/build/cjs/RemoteServer.js.map +3 -3
- package/build/cjs/StdioServer.js +1 -1
- package/build/cjs/StdioServer.js.map +2 -2
- package/build/esm/RemoteServer.mjs +4 -4
- package/build/esm/RemoteServer.mjs.map +3 -3
- package/build/esm/StdioServer.mjs +1 -1
- package/build/esm/StdioServer.mjs.map +2 -2
- package/package.json +7 -6
- package/types/RemoteServer.d.ts +1 -0
- package/types/StdioServer.d.ts +1 -0
- package/types/mcp/MCPBase.d.ts +46 -0
- package/types/mcp/MCPLocal.d.ts +32 -0
- package/types/mcp/MCPRemote.d.ts +58 -0
- package/types/mcp/PluginOptions.d.ts +6 -0
- package/types/mcp/index.d.ts +3 -0
- package/types/mcp/schemas/index.d.ts +16 -0
- package/types/mcp/schemas/indicatortypes.d.ts +413 -0
- package/types/mcp/schemas/marketData.d.ts +48 -0
- package/types/mcp/schemas/schemas.d.ts +181 -0
- package/types/mcp/tools/analytics.d.ts +5 -0
- package/types/mcp/tools/index.d.ts +3 -0
- package/types/mcp/tools/indicators/index.d.ts +11 -0
- package/types/mcp/tools/indicators/momentum.d.ts +27 -0
- package/types/mcp/tools/indicators/movingAverages.d.ts +18 -0
- package/types/mcp/tools/indicators/options.d.ts +102 -0
- package/types/mcp/tools/indicators/performance.d.ts +42 -0
- package/types/mcp/tools/indicators/signals.d.ts +23 -0
- package/types/mcp/tools/indicators/statistical.d.ts +102 -0
- package/types/mcp/tools/indicators/supportResistance.d.ts +51 -0
- package/types/mcp/tools/indicators/trend.d.ts +23 -0
- package/types/mcp/tools/indicators/volatility.d.ts +23 -0
- package/types/mcp/tools/indicators/volume.d.ts +26 -0
- package/types/mcp/tools/marketData.d.ts +16 -0
- package/types/mcp/tools/order.d.ts +5 -0
- package/types/mcp/tools/parse.d.ts +5 -0
- package/types/mcp/tools/parseToJSON.d.ts +5 -0
- package/types/mcp/utils/messageHandler.d.ts +5 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export declare const toolSchemas: {
|
|
2
|
+
parse: {
|
|
3
|
+
description: string;
|
|
4
|
+
schema: {
|
|
5
|
+
type: string;
|
|
6
|
+
properties: {
|
|
7
|
+
fixString: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
required: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
parseToJSON: {
|
|
15
|
+
description: string;
|
|
16
|
+
schema: {
|
|
17
|
+
type: string;
|
|
18
|
+
properties: {
|
|
19
|
+
fixString: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
required: string[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
verifyOrder: {
|
|
27
|
+
description: string;
|
|
28
|
+
schema: {
|
|
29
|
+
type: string;
|
|
30
|
+
properties: {
|
|
31
|
+
clOrdID: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
handlInst: {
|
|
35
|
+
type: string;
|
|
36
|
+
enum: string[];
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
quantity: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
price: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
ordType: {
|
|
46
|
+
type: string;
|
|
47
|
+
enum: string[];
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
side: {
|
|
51
|
+
type: string;
|
|
52
|
+
enum: string[];
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
symbol: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
timeInForce: {
|
|
59
|
+
type: string;
|
|
60
|
+
enum: string[];
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
required: string[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
executeOrder: {
|
|
68
|
+
description: string;
|
|
69
|
+
schema: {
|
|
70
|
+
type: string;
|
|
71
|
+
properties: {
|
|
72
|
+
clOrdID: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
handlInst: {
|
|
76
|
+
type: string;
|
|
77
|
+
enum: string[];
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
quantity: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
price: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
ordType: {
|
|
87
|
+
type: string;
|
|
88
|
+
enum: string[];
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
side: {
|
|
92
|
+
type: string;
|
|
93
|
+
enum: string[];
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
symbol: {
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
timeInForce: {
|
|
100
|
+
type: string;
|
|
101
|
+
enum: string[];
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
required: string[];
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
marketDataRequest: {
|
|
109
|
+
description: string;
|
|
110
|
+
schema: {
|
|
111
|
+
type: string;
|
|
112
|
+
properties: {
|
|
113
|
+
mdUpdateType: {
|
|
114
|
+
type: string;
|
|
115
|
+
enum: string[];
|
|
116
|
+
description: string;
|
|
117
|
+
};
|
|
118
|
+
symbols: {
|
|
119
|
+
type: string;
|
|
120
|
+
items: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
mdReqID: {
|
|
125
|
+
type: string;
|
|
126
|
+
};
|
|
127
|
+
subscriptionRequestType: {
|
|
128
|
+
type: string;
|
|
129
|
+
enum: string[];
|
|
130
|
+
description: string;
|
|
131
|
+
};
|
|
132
|
+
mdEntryTypes: {
|
|
133
|
+
type: string;
|
|
134
|
+
items: {
|
|
135
|
+
type: string;
|
|
136
|
+
enum: string[];
|
|
137
|
+
};
|
|
138
|
+
description: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
required: string[];
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
getStockGraph: {
|
|
145
|
+
description: string;
|
|
146
|
+
schema: {
|
|
147
|
+
type: string;
|
|
148
|
+
properties: {
|
|
149
|
+
symbol: {
|
|
150
|
+
type: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
required: string[];
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
getStockPriceHistory: {
|
|
157
|
+
description: string;
|
|
158
|
+
schema: {
|
|
159
|
+
type: string;
|
|
160
|
+
properties: {
|
|
161
|
+
symbol: {
|
|
162
|
+
type: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
required: string[];
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
technicalAnalysis: {
|
|
169
|
+
description: string;
|
|
170
|
+
schema: {
|
|
171
|
+
type: string;
|
|
172
|
+
properties: {
|
|
173
|
+
symbol: {
|
|
174
|
+
type: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
required: string[];
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import type { MarketDataEntry } from '../schemas';
|
|
3
|
+
export declare const createTechnicalAnalysisHandler: (marketDataPrices: Map<string, MarketDataEntry[]>) => ((args: {
|
|
4
|
+
symbol: string;
|
|
5
|
+
}) => Promise<CallToolResult>);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IFIXParser, Message } from 'fixparser';
|
|
2
|
+
import type { MarketDataEntry, ToolHandlers, VerifiedOrder } from '../schemas';
|
|
3
|
+
export declare const createToolHandlers: (parser: IFIXParser, verifiedOrders: Map<string, VerifiedOrder>, pendingRequests: Map<string, (data: Message) => void>, marketDataPrices: Map<string, MarketDataEntry[]>) => ToolHandlers;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from '../../schemas/indicatortypes';
|
|
2
|
+
export { MomentumIndicators } from './momentum';
|
|
3
|
+
export { MovingAverages } from './movingAverages';
|
|
4
|
+
export { OptionsAnalysis } from './options';
|
|
5
|
+
export { PerformanceAnalysis } from './performance';
|
|
6
|
+
export { TradingSignalsGenerator } from './signals';
|
|
7
|
+
export { StatisticalModels } from './statistical';
|
|
8
|
+
export { SupportResistanceIndicators } from './supportResistance';
|
|
9
|
+
export { TrendIndicators } from './trend';
|
|
10
|
+
export { VolatilityIndicators } from './volatility';
|
|
11
|
+
export { VolumeIndicators } from './volume';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Stochastic } from '../../schemas/indicatortypes';
|
|
2
|
+
export declare class MomentumIndicators {
|
|
3
|
+
/**
|
|
4
|
+
* Calculate RSI (Relative Strength Index)
|
|
5
|
+
*/
|
|
6
|
+
static calculateRSI(data: number[], period?: number): number[];
|
|
7
|
+
/**
|
|
8
|
+
* Calculate Stochastic Oscillator
|
|
9
|
+
*/
|
|
10
|
+
static calculateStochastic(prices: number[], highs: number[], lows: number[]): Stochastic[];
|
|
11
|
+
/**
|
|
12
|
+
* Calculate CCI (Commodity Channel Index)
|
|
13
|
+
*/
|
|
14
|
+
static calculateCCI(prices: number[], highs: number[], lows: number[]): number[];
|
|
15
|
+
/**
|
|
16
|
+
* Calculate Rate of Change
|
|
17
|
+
*/
|
|
18
|
+
static calculateROC(prices: number[]): number[];
|
|
19
|
+
/**
|
|
20
|
+
* Calculate Williams %R
|
|
21
|
+
*/
|
|
22
|
+
static calculateWilliamsR(prices: number[]): number[];
|
|
23
|
+
/**
|
|
24
|
+
* Calculate Momentum
|
|
25
|
+
*/
|
|
26
|
+
static calculateMomentum(prices: number[]): number[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class MovingAverages {
|
|
2
|
+
/**
|
|
3
|
+
* Calculate Simple Moving Average
|
|
4
|
+
*/
|
|
5
|
+
static calculateSMA(data: number[], period: number): number[];
|
|
6
|
+
/**
|
|
7
|
+
* Calculate Exponential Moving Average
|
|
8
|
+
*/
|
|
9
|
+
static calculateEMA(data: number[], period: number): number[];
|
|
10
|
+
/**
|
|
11
|
+
* Calculate Weighted Moving Average
|
|
12
|
+
*/
|
|
13
|
+
static calculateWMA(data: number[], period: number): number[];
|
|
14
|
+
/**
|
|
15
|
+
* Calculate Volume Weighted Moving Average
|
|
16
|
+
*/
|
|
17
|
+
static calculateVWMA(prices: number[], volumes: number[], period: number): number[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { BlackScholes } from '../../schemas/indicatortypes';
|
|
2
|
+
export declare class OptionsAnalysis {
|
|
3
|
+
/**
|
|
4
|
+
* Calculate Black-Scholes Option Pricing
|
|
5
|
+
*/
|
|
6
|
+
static calculateBlackScholes(currentPrice: number, startPrice: number, avgVolume: number): BlackScholes | null;
|
|
7
|
+
/**
|
|
8
|
+
* Calculate Binomial Tree Option Pricing
|
|
9
|
+
*/
|
|
10
|
+
static calculateBinomialTree(currentPrice: number, strikePrice: number, timeToExpiry?: number, riskFreeRate?: number, volatility?: number, steps?: number): {
|
|
11
|
+
callPrice: number;
|
|
12
|
+
putPrice: number;
|
|
13
|
+
delta: number;
|
|
14
|
+
gamma: number;
|
|
15
|
+
theta: number;
|
|
16
|
+
vega: number;
|
|
17
|
+
rho: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Calculate Trinomial Tree Option Pricing
|
|
21
|
+
*/
|
|
22
|
+
static calculateTrinomialTree(currentPrice: number, strikePrice: number, timeToExpiry?: number, riskFreeRate?: number, volatility?: number, steps?: number): {
|
|
23
|
+
callPrice: number;
|
|
24
|
+
putPrice: number;
|
|
25
|
+
delta: number;
|
|
26
|
+
gamma: number;
|
|
27
|
+
theta: number;
|
|
28
|
+
vega: number;
|
|
29
|
+
rho: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Calculate Monte Carlo Option Pricing
|
|
33
|
+
*/
|
|
34
|
+
static calculateMonteCarlo(currentPrice: number, strikePrice: number, timeToExpiry?: number, riskFreeRate?: number, volatility?: number, simulations?: number): {
|
|
35
|
+
callPrice: number;
|
|
36
|
+
putPrice: number;
|
|
37
|
+
delta: number;
|
|
38
|
+
gamma: number;
|
|
39
|
+
theta: number;
|
|
40
|
+
vega: number;
|
|
41
|
+
rho: number;
|
|
42
|
+
confidenceInterval: {
|
|
43
|
+
lower: number;
|
|
44
|
+
upper: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Calculate Heston Model (Stochastic Volatility)
|
|
49
|
+
*/
|
|
50
|
+
static calculateHestonModel(currentPrice: number, strikePrice: number, timeToExpiry?: number, riskFreeRate?: number, _initialVolatility?: number, _longTermVolatility?: number, _meanReversionSpeed?: number, _volatilityOfVolatility?: number, _correlation?: number): {
|
|
51
|
+
callPrice: number;
|
|
52
|
+
putPrice: number;
|
|
53
|
+
impliedVolatility: number;
|
|
54
|
+
delta: number;
|
|
55
|
+
gamma: number;
|
|
56
|
+
theta: number;
|
|
57
|
+
vega: number;
|
|
58
|
+
rho: number;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Calculate SABR Model
|
|
62
|
+
*/
|
|
63
|
+
static calculateSABRModel(currentPrice: number, strikePrice: number, timeToExpiry?: number, riskFreeRate?: number, alpha?: number, beta?: number, rho?: number, nu?: number): {
|
|
64
|
+
callPrice: number;
|
|
65
|
+
putPrice: number;
|
|
66
|
+
impliedVolatility: number;
|
|
67
|
+
delta: number;
|
|
68
|
+
gamma: number;
|
|
69
|
+
theta: number;
|
|
70
|
+
vega: number;
|
|
71
|
+
rho: number;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Calculate Variance Gamma Model
|
|
75
|
+
*/
|
|
76
|
+
static calculateVarianceGamma(currentPrice: number, strikePrice: number, timeToExpiry?: number, riskFreeRate?: number, _sigma?: number, _theta?: number, _nu?: number): {
|
|
77
|
+
callPrice: number;
|
|
78
|
+
putPrice: number;
|
|
79
|
+
impliedVolatility: number;
|
|
80
|
+
delta: number;
|
|
81
|
+
gamma: number;
|
|
82
|
+
theta: number;
|
|
83
|
+
vega: number;
|
|
84
|
+
rho: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Normal CDF approximation
|
|
88
|
+
*/
|
|
89
|
+
private static normalCDF;
|
|
90
|
+
/**
|
|
91
|
+
* Normal PDF
|
|
92
|
+
*/
|
|
93
|
+
private static normalPDF;
|
|
94
|
+
/**
|
|
95
|
+
* Error function approximation
|
|
96
|
+
*/
|
|
97
|
+
private static erf;
|
|
98
|
+
/**
|
|
99
|
+
* Box-Muller transform for normal random numbers
|
|
100
|
+
*/
|
|
101
|
+
private static boxMuller;
|
|
102
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare class PerformanceAnalysis {
|
|
2
|
+
/**
|
|
3
|
+
* Calculate maximum drawdown
|
|
4
|
+
*/
|
|
5
|
+
static calculateMaxDrawdown(prices: number[]): number;
|
|
6
|
+
/**
|
|
7
|
+
* Calculate maximum consecutive losses
|
|
8
|
+
*/
|
|
9
|
+
static calculateMaxConsecutiveLosses(prices: number[]): number;
|
|
10
|
+
/**
|
|
11
|
+
* Calculate win rate
|
|
12
|
+
*/
|
|
13
|
+
static calculateWinRate(prices: number[]): number;
|
|
14
|
+
/**
|
|
15
|
+
* Calculate profit factor
|
|
16
|
+
*/
|
|
17
|
+
static calculateProfitFactor(prices: number[]): number;
|
|
18
|
+
/**
|
|
19
|
+
* Calculate Sharpe Ratio
|
|
20
|
+
*/
|
|
21
|
+
static calculateSharpeRatio(returns: number[], riskFreeRate?: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Calculate Sortino Ratio
|
|
24
|
+
*/
|
|
25
|
+
static calculateSortinoRatio(returns: number[], riskFreeRate?: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Calculate Calmar Ratio
|
|
28
|
+
*/
|
|
29
|
+
static calculateCalmarRatio(returns: number[], maxDrawdown: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* Calculate Position Size
|
|
32
|
+
*/
|
|
33
|
+
static calculatePositionSize(targetEntry: number, stopLoss: number): number;
|
|
34
|
+
/**
|
|
35
|
+
* Calculate Confidence
|
|
36
|
+
*/
|
|
37
|
+
static calculateConfidence(signals: string[]): number;
|
|
38
|
+
/**
|
|
39
|
+
* Calculate Risk Level
|
|
40
|
+
*/
|
|
41
|
+
static calculateRiskLevel(volatility: number): string;
|
|
42
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TradingSignals } from '../../schemas/indicatortypes';
|
|
2
|
+
export declare class TradingSignalsGenerator {
|
|
3
|
+
/**
|
|
4
|
+
* Generate trading signals based on market analysis
|
|
5
|
+
*/
|
|
6
|
+
static generateSignals(currentPrice: number, trueVWAP: number, momentum5: number, momentum10: number, sessionReturn: number, currentVolume: number, avgVolume: number, pricePosition: number, volatility: number): {
|
|
7
|
+
bullishSignals: number;
|
|
8
|
+
bearishSignals: number;
|
|
9
|
+
signals: string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Calculate overall signal and confidence
|
|
13
|
+
*/
|
|
14
|
+
static calculateOverallSignal(bullishSignals: number, bearishSignals: number, signals: string[], volatility: number): TradingSignals;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate confidence based on number of signals
|
|
17
|
+
*/
|
|
18
|
+
private static calculateConfidence;
|
|
19
|
+
/**
|
|
20
|
+
* Calculate risk level based on volatility
|
|
21
|
+
*/
|
|
22
|
+
private static calculateRiskLevel;
|
|
23
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export declare class StatisticalModels {
|
|
2
|
+
/**
|
|
3
|
+
* Calculate Z-Score
|
|
4
|
+
*/
|
|
5
|
+
static calculateZScore(currentPrice: number, startPrice: number): number;
|
|
6
|
+
/**
|
|
7
|
+
* Calculate Ornstein-Uhlenbeck
|
|
8
|
+
*/
|
|
9
|
+
static calculateOrnsteinUhlenbeck(currentPrice: number, startPrice: number, avgVolume: number, priceChanges: number[]): {
|
|
10
|
+
mean: number;
|
|
11
|
+
speed: number;
|
|
12
|
+
volatility: number;
|
|
13
|
+
currentValue: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Calculate Kalman Filter
|
|
17
|
+
*/
|
|
18
|
+
static calculateKalmanFilter(currentPrice: number, startPrice: number, avgVolume: number, priceChanges: number[]): {
|
|
19
|
+
state: number;
|
|
20
|
+
covariance: number;
|
|
21
|
+
gain: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Calculate ARIMA
|
|
25
|
+
*/
|
|
26
|
+
static calculateARIMA(currentPrice: number, priceChanges: number[]): {
|
|
27
|
+
forecast: number[];
|
|
28
|
+
residuals: number[];
|
|
29
|
+
aic: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Calculate GARCH
|
|
33
|
+
*/
|
|
34
|
+
static calculateGARCH(avgVolume: number, priceChanges: number[]): {
|
|
35
|
+
volatility: number;
|
|
36
|
+
persistence: number;
|
|
37
|
+
meanReversion: number;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Calculate VAR (Vector AutoRegression)
|
|
41
|
+
*/
|
|
42
|
+
static calculateVAR(prices: number[], volumes: number[], lags?: number): {
|
|
43
|
+
priceForecast: number[];
|
|
44
|
+
volumeForecast: number[];
|
|
45
|
+
coefficients: number[][];
|
|
46
|
+
residuals: number[][];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Calculate Gaussian Process Regression
|
|
50
|
+
*/
|
|
51
|
+
static calculateGaussianProcess(prices: number[], periods?: number): {
|
|
52
|
+
mean: number[];
|
|
53
|
+
variance: number[];
|
|
54
|
+
confidenceInterval: {
|
|
55
|
+
lower: number[];
|
|
56
|
+
upper: number[];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Calculate Pairs Trading Strategy
|
|
61
|
+
*/
|
|
62
|
+
static calculatePairsTrading(asset1Prices: number[], asset2Prices: number[]): {
|
|
63
|
+
spread: number[];
|
|
64
|
+
zScore: number[];
|
|
65
|
+
hedgeRatio: number;
|
|
66
|
+
entrySignal: string;
|
|
67
|
+
exitSignal: string;
|
|
68
|
+
position: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Calculate Hilbert Transform
|
|
72
|
+
*/
|
|
73
|
+
static calculateHilbertTransform(currentPrice: number, priceChanges: number[]): {
|
|
74
|
+
analytic: number[];
|
|
75
|
+
phase: number[];
|
|
76
|
+
amplitude: number[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Calculate Wavelet Transform
|
|
80
|
+
*/
|
|
81
|
+
static calculateWaveletTransform(currentPrice: number, priceChanges: number[]): {
|
|
82
|
+
coefficients: number[];
|
|
83
|
+
scales: number[];
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Calculate Fourier Transform
|
|
87
|
+
*/
|
|
88
|
+
static calculateFourierTransform(prices: number[]): {
|
|
89
|
+
frequencies: number[];
|
|
90
|
+
amplitudes: number[];
|
|
91
|
+
phases: number[];
|
|
92
|
+
dominantFrequencies: number[];
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Calculate Empirical Mode Decomposition (EMD)
|
|
96
|
+
*/
|
|
97
|
+
static calculateEMD(prices: number[]): {
|
|
98
|
+
imfs: number[][];
|
|
99
|
+
residual: number[];
|
|
100
|
+
frequencies: number[];
|
|
101
|
+
};
|
|
102
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ElliottWave, FibonacciLevels, HarmonicPattern, PivotPoints } from '../../schemas/indicatortypes';
|
|
2
|
+
export declare class SupportResistanceIndicators {
|
|
3
|
+
/**
|
|
4
|
+
* Calculate Pivot Points (Classic)
|
|
5
|
+
*/
|
|
6
|
+
static calculatePivotPoints(prices: number[], highs: number[], lows: number[]): PivotPoints[];
|
|
7
|
+
/**
|
|
8
|
+
* Calculate Fibonacci Pivot Points
|
|
9
|
+
*/
|
|
10
|
+
static calculateFibonacciPivotPoints(prices: number[], highs: number[], lows: number[]): PivotPoints[];
|
|
11
|
+
/**
|
|
12
|
+
* Calculate Camarilla Pivot Points
|
|
13
|
+
*/
|
|
14
|
+
static calculateCamarillaPivotPoints(prices: number[], highs: number[], lows: number[]): PivotPoints[];
|
|
15
|
+
/**
|
|
16
|
+
* Calculate Fibonacci Levels
|
|
17
|
+
*/
|
|
18
|
+
static calculateFibonacciLevels(prices: number[]): FibonacciLevels[];
|
|
19
|
+
/**
|
|
20
|
+
* Calculate Gann Levels
|
|
21
|
+
*/
|
|
22
|
+
static calculateGannLevels(prices: number[]): number[];
|
|
23
|
+
/**
|
|
24
|
+
* Calculate Elliott Wave
|
|
25
|
+
*/
|
|
26
|
+
static calculateElliottWave(prices: number[]): ElliottWave[];
|
|
27
|
+
/**
|
|
28
|
+
* Helper method to detect price swings
|
|
29
|
+
*/
|
|
30
|
+
private static detectPriceSwings;
|
|
31
|
+
/**
|
|
32
|
+
* Helper method to calculate wave position
|
|
33
|
+
*/
|
|
34
|
+
private static calculateWavePosition;
|
|
35
|
+
/**
|
|
36
|
+
* Calculate Harmonic Patterns
|
|
37
|
+
*/
|
|
38
|
+
static calculateHarmonicPatterns(prices: number[]): HarmonicPattern[];
|
|
39
|
+
/**
|
|
40
|
+
* Helper method to detect harmonic patterns
|
|
41
|
+
*/
|
|
42
|
+
private static detectHarmonicPattern;
|
|
43
|
+
/**
|
|
44
|
+
* Helper method to check if a value is within a range
|
|
45
|
+
*/
|
|
46
|
+
private static isInRange;
|
|
47
|
+
/**
|
|
48
|
+
* Helper method to calculate pattern completion percentage
|
|
49
|
+
*/
|
|
50
|
+
private static calculatePatternCompletion;
|
|
51
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DMI, IchimokuCloud, MACD } from '../../schemas/indicatortypes';
|
|
2
|
+
export declare class TrendIndicators {
|
|
3
|
+
/**
|
|
4
|
+
* Calculate MACD (Moving Average Convergence Divergence)
|
|
5
|
+
*/
|
|
6
|
+
static calculateMACD(prices: number[]): MACD[];
|
|
7
|
+
/**
|
|
8
|
+
* Calculate ADX (Average Directional Index)
|
|
9
|
+
*/
|
|
10
|
+
static calculateADX(prices: number[], highs: number[], lows: number[]): number[];
|
|
11
|
+
/**
|
|
12
|
+
* Calculate DMI (Directional Movement Index)
|
|
13
|
+
*/
|
|
14
|
+
static calculateDMI(prices: number[], highs: number[], lows: number[]): DMI[];
|
|
15
|
+
/**
|
|
16
|
+
* Calculate Ichimoku Cloud
|
|
17
|
+
*/
|
|
18
|
+
static calculateIchimoku(prices: number[], highs: number[], lows: number[]): IchimokuCloud[];
|
|
19
|
+
/**
|
|
20
|
+
* Calculate Parabolic SAR
|
|
21
|
+
*/
|
|
22
|
+
static calculateParabolicSAR(prices: number[], highs: number[], lows: number[]): number[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BollingerBands, DonchianChannels, KeltnerChannels } from '../../schemas/indicatortypes';
|
|
2
|
+
export declare class VolatilityIndicators {
|
|
3
|
+
/**
|
|
4
|
+
* Calculate Bollinger Bands
|
|
5
|
+
*/
|
|
6
|
+
static calculateBollingerBands(data: number[], period?: number, stdDev?: number): BollingerBands[];
|
|
7
|
+
/**
|
|
8
|
+
* Calculate Average True Range (ATR)
|
|
9
|
+
*/
|
|
10
|
+
static calculateATR(prices: number[], highs: number[], lows: number[]): number[];
|
|
11
|
+
/**
|
|
12
|
+
* Calculate Keltner Channels
|
|
13
|
+
*/
|
|
14
|
+
static calculateKeltnerChannels(prices: number[], highs: number[], lows: number[]): KeltnerChannels[];
|
|
15
|
+
/**
|
|
16
|
+
* Calculate Donchian Channels
|
|
17
|
+
*/
|
|
18
|
+
static calculateDonchianChannels(prices: number[]): DonchianChannels[];
|
|
19
|
+
/**
|
|
20
|
+
* Calculate Chaikin Volatility
|
|
21
|
+
*/
|
|
22
|
+
static calculateChaikinVolatility(prices: number[], highs: number[], lows: number[]): number[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare class VolumeIndicators {
|
|
2
|
+
/**
|
|
3
|
+
* Calculate On Balance Volume (OBV)
|
|
4
|
+
*/
|
|
5
|
+
static calculateOBV(prices: number[], volumes: number[]): number[];
|
|
6
|
+
/**
|
|
7
|
+
* Calculate Chaikin Money Flow (CMF)
|
|
8
|
+
*/
|
|
9
|
+
static calculateCMF(prices: number[], highs: number[], lows: number[], volumes: number[]): number[];
|
|
10
|
+
/**
|
|
11
|
+
* Calculate Accumulation/Distribution Line (ADL)
|
|
12
|
+
*/
|
|
13
|
+
static calculateADL(prices: number[], highs: number[], lows: number[], volumes: number[]): number[];
|
|
14
|
+
/**
|
|
15
|
+
* Calculate Volume Rate of Change
|
|
16
|
+
*/
|
|
17
|
+
static calculateVolumeROC(volumes: number[]): number[];
|
|
18
|
+
/**
|
|
19
|
+
* Calculate Money Flow Index (MFI)
|
|
20
|
+
*/
|
|
21
|
+
static calculateMFI(prices: number[], highs: number[], lows: number[], volumes: number[]): number[];
|
|
22
|
+
/**
|
|
23
|
+
* Calculate Volume Weighted Average Price (VWAP)
|
|
24
|
+
*/
|
|
25
|
+
static calculateVWAP(prices: number[], volumes: number[]): number[];
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { type IFIXParser, type Message } from 'fixparser';
|
|
3
|
+
import type { MarketDataEntry } from '../schemas';
|
|
4
|
+
export declare const createMarketDataRequestHandler: (parser: IFIXParser, pendingRequests: Map<string, (data: Message) => void>) => ((args: {
|
|
5
|
+
mdUpdateType: string;
|
|
6
|
+
symbols: string[];
|
|
7
|
+
mdReqID: string;
|
|
8
|
+
subscriptionRequestType: string;
|
|
9
|
+
mdEntryTypes?: string[];
|
|
10
|
+
}) => Promise<CallToolResult>);
|
|
11
|
+
export declare const createGetStockGraphHandler: (marketDataPrices: Map<string, MarketDataEntry[]>) => ((args: {
|
|
12
|
+
symbol: string;
|
|
13
|
+
}) => Promise<CallToolResult>);
|
|
14
|
+
export declare const createGetStockPriceHistoryHandler: (marketDataPrices: Map<string, MarketDataEntry[]>) => ((args: {
|
|
15
|
+
symbol: string;
|
|
16
|
+
}) => Promise<CallToolResult>);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { type IFIXParser, type Message } from 'fixparser';
|
|
3
|
+
import type { VerifiedOrder } from '../schemas';
|
|
4
|
+
export declare const createVerifyOrderHandler: (parser: IFIXParser, verifiedOrders: Map<string, VerifiedOrder>) => ((args: VerifiedOrder) => Promise<CallToolResult>);
|
|
5
|
+
export declare const createExecuteOrderHandler: (parser: IFIXParser, verifiedOrders: Map<string, VerifiedOrder>, pendingRequests: Map<string, (data: Message) => void>) => ((args: VerifiedOrder) => Promise<CallToolResult>);
|