@alfe.ai/ctrader-mcp 0.3.5 → 0.3.7
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/dist/server.js +408 -154
- package/package.json +3 -3
- package/proto/ctrader.proto +32 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/ctrader-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "cTrader MCP server — full trading (market/limit/stop/stop-limit orders, trailing stops), Level 2 depth, live quotes, trade history, PnL & margin over the cTrader Open API (protobuf/TLS)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/server.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
22
22
|
"protobufjs": "^8.7.0",
|
|
23
23
|
"zod": "^4.0.5",
|
|
24
|
-
"@alfe.ai/agent-api-client": "0.
|
|
25
|
-
"@alfe.ai/config": "0.4.
|
|
24
|
+
"@alfe.ai/agent-api-client": "0.15.0",
|
|
25
|
+
"@alfe.ai/config": "0.4.1"
|
|
26
26
|
},
|
|
27
27
|
"license": "UNLICENSED",
|
|
28
28
|
"homepage": "https://alfe.ai",
|
package/proto/ctrader.proto
CHANGED
|
@@ -29,7 +29,7 @@ message ProtoErrorRes {
|
|
|
29
29
|
optional uint32 payloadType = 1;
|
|
30
30
|
required string errorCode = 2;
|
|
31
31
|
optional string description = 3;
|
|
32
|
-
optional
|
|
32
|
+
optional uint64 maintenanceEndTimestamp = 4;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// Heartbeat (payloadType 51). Keep-alive; no fields beyond payloadType.
|
|
@@ -53,6 +53,13 @@ enum ProtoOATradeSide {
|
|
|
53
53
|
SELL = 2;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
enum ProtoOAOrderTriggerMethod {
|
|
57
|
+
TRADE = 1;
|
|
58
|
+
OPPOSITE = 2;
|
|
59
|
+
DOUBLE_TRADE = 3;
|
|
60
|
+
DOUBLE_OPPOSITE = 4;
|
|
61
|
+
}
|
|
62
|
+
|
|
56
63
|
enum ProtoOAQuoteType {
|
|
57
64
|
BID = 1;
|
|
58
65
|
ASK = 2;
|
|
@@ -118,7 +125,7 @@ message ProtoOAGetAccountListByAccessTokenReq {
|
|
|
118
125
|
message ProtoOACtidTraderAccount {
|
|
119
126
|
required uint64 ctidTraderAccountId = 1;
|
|
120
127
|
optional bool isLive = 2;
|
|
121
|
-
optional
|
|
128
|
+
optional int64 traderLogin = 3;
|
|
122
129
|
optional int64 lastClosingDealTimestamp = 4;
|
|
123
130
|
optional int64 lastBalanceUpdateTimestamp = 5;
|
|
124
131
|
optional string brokerTitleShort = 6;
|
|
@@ -164,12 +171,13 @@ message ProtoOATrader {
|
|
|
164
171
|
optional bool isLimitedRisk = 18;
|
|
165
172
|
optional uint32 limitedRiskMarginCalculationStrategy = 19;
|
|
166
173
|
optional uint32 moneyDigits = 20;
|
|
167
|
-
optional
|
|
174
|
+
optional bool fairStopOut = 21;
|
|
168
175
|
}
|
|
169
176
|
|
|
170
177
|
message ProtoOATraderRes {
|
|
171
|
-
optional uint32
|
|
172
|
-
required
|
|
178
|
+
optional uint32 payloadType = 1;
|
|
179
|
+
required int64 ctidTraderAccountId = 2;
|
|
180
|
+
required ProtoOATrader trader = 3;
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
// ── Reconcile (open positions + pending orders) ─────────────────────────
|
|
@@ -182,7 +190,8 @@ message ProtoOATradeData {
|
|
|
182
190
|
optional string label = 5;
|
|
183
191
|
optional bool guaranteedStopLoss = 6;
|
|
184
192
|
optional string comment = 7;
|
|
185
|
-
optional
|
|
193
|
+
optional string measurementUnits = 8;
|
|
194
|
+
optional uint64 closeTimestamp = 9;
|
|
186
195
|
}
|
|
187
196
|
|
|
188
197
|
message ProtoOAPosition {
|
|
@@ -198,8 +207,8 @@ message ProtoOAPosition {
|
|
|
198
207
|
optional double marginRate = 10;
|
|
199
208
|
optional int64 mirroringCommission = 11;
|
|
200
209
|
optional bool guaranteedStopLoss = 12;
|
|
201
|
-
optional
|
|
202
|
-
optional
|
|
210
|
+
optional uint64 usedMargin = 13;
|
|
211
|
+
optional ProtoOAOrderTriggerMethod stopLossTriggerMethod = 14;
|
|
203
212
|
optional uint32 moneyDigits = 15;
|
|
204
213
|
optional bool trailingStopLoss = 16;
|
|
205
214
|
}
|
|
@@ -230,7 +239,7 @@ message ProtoOAOrder {
|
|
|
230
239
|
optional int64 relativeTakeProfit = 21;
|
|
231
240
|
optional bool isStopOut = 22;
|
|
232
241
|
optional bool trailingStopLoss = 23;
|
|
233
|
-
optional
|
|
242
|
+
optional ProtoOAOrderTriggerMethod stopTriggerMethod = 24;
|
|
234
243
|
}
|
|
235
244
|
|
|
236
245
|
message ProtoOAReconcileReq {
|
|
@@ -267,7 +276,7 @@ message ProtoOASymbolsListReq {
|
|
|
267
276
|
message ProtoOAArchivedSymbol {
|
|
268
277
|
required int64 symbolId = 1;
|
|
269
278
|
required string name = 2;
|
|
270
|
-
|
|
279
|
+
required int64 utcLastUpdateTimestamp = 3;
|
|
271
280
|
optional string description = 4;
|
|
272
281
|
}
|
|
273
282
|
|
|
@@ -280,8 +289,8 @@ message ProtoOASymbolsListRes {
|
|
|
280
289
|
|
|
281
290
|
message ProtoOASymbol {
|
|
282
291
|
required int64 symbolId = 1;
|
|
283
|
-
|
|
284
|
-
|
|
292
|
+
required int32 digits = 2;
|
|
293
|
+
required int32 pipPosition = 3;
|
|
285
294
|
optional bool enableShortSelling = 4;
|
|
286
295
|
optional bool guaranteedStopLoss = 5;
|
|
287
296
|
optional uint32 swapRollover3Days = 6;
|
|
@@ -293,7 +302,7 @@ message ProtoOASymbol {
|
|
|
293
302
|
optional int64 maxVolume = 9;
|
|
294
303
|
optional int64 minVolume = 10;
|
|
295
304
|
optional int64 stepVolume = 11;
|
|
296
|
-
optional
|
|
305
|
+
optional uint64 maxExposure = 12;
|
|
297
306
|
// lotSize is canonical field 30 (NOT 21 — field 21 is the deprecated
|
|
298
307
|
// minCommission). Reading it at 21 yields 0 for XAUUSD → SYMBOL_NO_LOTSIZE
|
|
299
308
|
// and mis-sizes volume for any symbol where field 21 is non-zero.
|
|
@@ -316,7 +325,7 @@ message ProtoOASymbolByIdRes {
|
|
|
316
325
|
// ── Trendbars (market data / candles) ───────────────────────────────────
|
|
317
326
|
|
|
318
327
|
message ProtoOATrendbar {
|
|
319
|
-
|
|
328
|
+
required int64 volume = 3;
|
|
320
329
|
optional ProtoOATrendbarPeriod period = 4;
|
|
321
330
|
optional int64 low = 5;
|
|
322
331
|
optional uint64 deltaOpen = 6;
|
|
@@ -601,7 +610,7 @@ message ProtoOANewOrderReq {
|
|
|
601
610
|
optional int64 relativeTakeProfit = 20;
|
|
602
611
|
optional bool guaranteedStopLoss = 21;
|
|
603
612
|
optional bool trailingStopLoss = 22;
|
|
604
|
-
optional
|
|
613
|
+
optional ProtoOAOrderTriggerMethod stopTriggerMethod = 23;
|
|
605
614
|
}
|
|
606
615
|
|
|
607
616
|
message ProtoOAAmendOrderReq {
|
|
@@ -614,11 +623,12 @@ message ProtoOAAmendOrderReq {
|
|
|
614
623
|
optional int64 expirationTimestamp = 7;
|
|
615
624
|
optional double stopLoss = 8;
|
|
616
625
|
optional double takeProfit = 9;
|
|
617
|
-
optional
|
|
618
|
-
optional int64
|
|
619
|
-
optional
|
|
620
|
-
optional bool
|
|
621
|
-
optional
|
|
626
|
+
optional int32 slippageInPoints = 10;
|
|
627
|
+
optional int64 relativeStopLoss = 11;
|
|
628
|
+
optional int64 relativeTakeProfit = 12;
|
|
629
|
+
optional bool guaranteedStopLoss = 13;
|
|
630
|
+
optional bool trailingStopLoss = 14;
|
|
631
|
+
optional ProtoOAOrderTriggerMethod stopTriggerMethod = 15;
|
|
622
632
|
}
|
|
623
633
|
|
|
624
634
|
message ProtoOAAmendPositionSLTPReq {
|
|
@@ -627,11 +637,9 @@ message ProtoOAAmendPositionSLTPReq {
|
|
|
627
637
|
required int64 positionId = 3;
|
|
628
638
|
optional double stopLoss = 4;
|
|
629
639
|
optional double takeProfit = 5;
|
|
630
|
-
optional bool guaranteedStopLoss =
|
|
631
|
-
optional double stopLossTriggerMethod = 7;
|
|
640
|
+
optional bool guaranteedStopLoss = 7;
|
|
632
641
|
optional bool trailingStopLoss = 8;
|
|
633
|
-
optional
|
|
634
|
-
optional double relativeTakeProfit = 10;
|
|
642
|
+
optional ProtoOAOrderTriggerMethod stopLossTriggerMethod = 9;
|
|
635
643
|
}
|
|
636
644
|
|
|
637
645
|
message ProtoOAClosePositionReq {
|