@gbozee/ultimate 0.0.2-next.70 → 0.0.2-next.71
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/index.cjs +33 -4
- package/dist/index.d.ts +11 -0
- package/dist/index.js +33 -4
- package/dist/mcp-server.cjs +33 -4
- package/dist/mcp-server.js +33 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -72216,6 +72216,37 @@ class BaseExchange {
|
|
|
72216
72216
|
]
|
|
72217
72217
|
});
|
|
72218
72218
|
}
|
|
72219
|
+
async entryStopLimitOrders(payload) {
|
|
72220
|
+
const { symbol, kind, orders, price_places, decimal_places, place } = payload;
|
|
72221
|
+
const price = await this.get_current_price(symbol);
|
|
72222
|
+
const orders_to_place = orders.map((order) => {
|
|
72223
|
+
const { entry } = order;
|
|
72224
|
+
let spread = 0.005;
|
|
72225
|
+
if (price < 5000) {
|
|
72226
|
+
spread = 0.02;
|
|
72227
|
+
}
|
|
72228
|
+
let full_spread = spread / 100 + 1;
|
|
72229
|
+
const stop = kind === "long" ? entry * full_spread ** -1 : entry * full_spread;
|
|
72230
|
+
const side = kind === "long" ? "buy" : "sell";
|
|
72231
|
+
return {
|
|
72232
|
+
price: order.entry,
|
|
72233
|
+
quantity: order.quantity,
|
|
72234
|
+
stop: to_f(stop, price_places || "%.3f"),
|
|
72235
|
+
side,
|
|
72236
|
+
kind,
|
|
72237
|
+
is_market: false
|
|
72238
|
+
};
|
|
72239
|
+
});
|
|
72240
|
+
if (place) {
|
|
72241
|
+
return this._createLimitPurchaseOrders({
|
|
72242
|
+
symbol,
|
|
72243
|
+
price_places,
|
|
72244
|
+
decimal_places,
|
|
72245
|
+
orders: orders_to_place
|
|
72246
|
+
});
|
|
72247
|
+
}
|
|
72248
|
+
return orders_to_place;
|
|
72249
|
+
}
|
|
72219
72250
|
async customStopLoss(payload) {
|
|
72220
72251
|
const {
|
|
72221
72252
|
symbol,
|
|
@@ -77153,10 +77184,8 @@ async function placeStopOrder3(client, payload) {
|
|
|
77153
77184
|
validateQuantity: false,
|
|
77154
77185
|
validatePrice: false
|
|
77155
77186
|
});
|
|
77156
|
-
const
|
|
77157
|
-
|
|
77158
|
-
stop_loss
|
|
77159
|
-
];
|
|
77187
|
+
const filtered = (existingStops || []).filter((s2) => s2.price !== stop_loss.price);
|
|
77188
|
+
const all_stop_losses = [...filtered, stop_loss];
|
|
77160
77189
|
return savePaperDetails(client, {
|
|
77161
77190
|
kind: order.kind,
|
|
77162
77191
|
symbol: payload.symbol,
|
package/dist/index.d.ts
CHANGED
|
@@ -517,6 +517,17 @@ declare abstract class BaseExchange {
|
|
|
517
517
|
decimal_places?: string;
|
|
518
518
|
close?: boolean;
|
|
519
519
|
}): Promise<any>;
|
|
520
|
+
entryStopLimitOrders(payload: {
|
|
521
|
+
symbol: string;
|
|
522
|
+
kind: "long" | "short";
|
|
523
|
+
orders: Array<{
|
|
524
|
+
entry: number;
|
|
525
|
+
quantity: number;
|
|
526
|
+
}>;
|
|
527
|
+
price_places?: string;
|
|
528
|
+
decimal_places?: string;
|
|
529
|
+
place?: boolean;
|
|
530
|
+
}): Promise<any>;
|
|
520
531
|
customStopLoss(payload: {
|
|
521
532
|
price_places: string;
|
|
522
533
|
decimal_places: string;
|
package/dist/index.js
CHANGED
|
@@ -72114,6 +72114,37 @@ class BaseExchange {
|
|
|
72114
72114
|
]
|
|
72115
72115
|
});
|
|
72116
72116
|
}
|
|
72117
|
+
async entryStopLimitOrders(payload) {
|
|
72118
|
+
const { symbol, kind, orders, price_places, decimal_places, place } = payload;
|
|
72119
|
+
const price = await this.get_current_price(symbol);
|
|
72120
|
+
const orders_to_place = orders.map((order) => {
|
|
72121
|
+
const { entry } = order;
|
|
72122
|
+
let spread = 0.005;
|
|
72123
|
+
if (price < 5000) {
|
|
72124
|
+
spread = 0.02;
|
|
72125
|
+
}
|
|
72126
|
+
let full_spread = spread / 100 + 1;
|
|
72127
|
+
const stop = kind === "long" ? entry * full_spread ** -1 : entry * full_spread;
|
|
72128
|
+
const side = kind === "long" ? "buy" : "sell";
|
|
72129
|
+
return {
|
|
72130
|
+
price: order.entry,
|
|
72131
|
+
quantity: order.quantity,
|
|
72132
|
+
stop: to_f(stop, price_places || "%.3f"),
|
|
72133
|
+
side,
|
|
72134
|
+
kind,
|
|
72135
|
+
is_market: false
|
|
72136
|
+
};
|
|
72137
|
+
});
|
|
72138
|
+
if (place) {
|
|
72139
|
+
return this._createLimitPurchaseOrders({
|
|
72140
|
+
symbol,
|
|
72141
|
+
price_places,
|
|
72142
|
+
decimal_places,
|
|
72143
|
+
orders: orders_to_place
|
|
72144
|
+
});
|
|
72145
|
+
}
|
|
72146
|
+
return orders_to_place;
|
|
72147
|
+
}
|
|
72117
72148
|
async customStopLoss(payload) {
|
|
72118
72149
|
const {
|
|
72119
72150
|
symbol,
|
|
@@ -77051,10 +77082,8 @@ async function placeStopOrder3(client, payload) {
|
|
|
77051
77082
|
validateQuantity: false,
|
|
77052
77083
|
validatePrice: false
|
|
77053
77084
|
});
|
|
77054
|
-
const
|
|
77055
|
-
|
|
77056
|
-
stop_loss
|
|
77057
|
-
];
|
|
77085
|
+
const filtered = (existingStops || []).filter((s2) => s2.price !== stop_loss.price);
|
|
77086
|
+
const all_stop_losses = [...filtered, stop_loss];
|
|
77058
77087
|
return savePaperDetails(client, {
|
|
77059
77088
|
kind: order.kind,
|
|
77060
77089
|
symbol: payload.symbol,
|
package/dist/mcp-server.cjs
CHANGED
|
@@ -75938,6 +75938,37 @@ class BaseExchange {
|
|
|
75938
75938
|
]
|
|
75939
75939
|
});
|
|
75940
75940
|
}
|
|
75941
|
+
async entryStopLimitOrders(payload) {
|
|
75942
|
+
const { symbol, kind, orders, price_places, decimal_places, place } = payload;
|
|
75943
|
+
const price = await this.get_current_price(symbol);
|
|
75944
|
+
const orders_to_place = orders.map((order) => {
|
|
75945
|
+
const { entry } = order;
|
|
75946
|
+
let spread = 0.005;
|
|
75947
|
+
if (price < 5000) {
|
|
75948
|
+
spread = 0.02;
|
|
75949
|
+
}
|
|
75950
|
+
let full_spread = spread / 100 + 1;
|
|
75951
|
+
const stop = kind === "long" ? entry * full_spread ** -1 : entry * full_spread;
|
|
75952
|
+
const side = kind === "long" ? "buy" : "sell";
|
|
75953
|
+
return {
|
|
75954
|
+
price: order.entry,
|
|
75955
|
+
quantity: order.quantity,
|
|
75956
|
+
stop: to_f(stop, price_places || "%.3f"),
|
|
75957
|
+
side,
|
|
75958
|
+
kind,
|
|
75959
|
+
is_market: false
|
|
75960
|
+
};
|
|
75961
|
+
});
|
|
75962
|
+
if (place) {
|
|
75963
|
+
return this._createLimitPurchaseOrders({
|
|
75964
|
+
symbol,
|
|
75965
|
+
price_places,
|
|
75966
|
+
decimal_places,
|
|
75967
|
+
orders: orders_to_place
|
|
75968
|
+
});
|
|
75969
|
+
}
|
|
75970
|
+
return orders_to_place;
|
|
75971
|
+
}
|
|
75941
75972
|
async customStopLoss(payload) {
|
|
75942
75973
|
const {
|
|
75943
75974
|
symbol,
|
|
@@ -80875,10 +80906,8 @@ async function placeStopOrder3(client, payload) {
|
|
|
80875
80906
|
validateQuantity: false,
|
|
80876
80907
|
validatePrice: false
|
|
80877
80908
|
});
|
|
80878
|
-
const
|
|
80879
|
-
|
|
80880
|
-
stop_loss
|
|
80881
|
-
];
|
|
80909
|
+
const filtered = (existingStops || []).filter((s2) => s2.price !== stop_loss.price);
|
|
80910
|
+
const all_stop_losses = [...filtered, stop_loss];
|
|
80882
80911
|
return savePaperDetails(client, {
|
|
80883
80912
|
kind: order.kind,
|
|
80884
80913
|
symbol: payload.symbol,
|
package/dist/mcp-server.js
CHANGED
|
@@ -75897,6 +75897,37 @@ class BaseExchange {
|
|
|
75897
75897
|
]
|
|
75898
75898
|
});
|
|
75899
75899
|
}
|
|
75900
|
+
async entryStopLimitOrders(payload) {
|
|
75901
|
+
const { symbol, kind, orders, price_places, decimal_places, place } = payload;
|
|
75902
|
+
const price = await this.get_current_price(symbol);
|
|
75903
|
+
const orders_to_place = orders.map((order) => {
|
|
75904
|
+
const { entry } = order;
|
|
75905
|
+
let spread = 0.005;
|
|
75906
|
+
if (price < 5000) {
|
|
75907
|
+
spread = 0.02;
|
|
75908
|
+
}
|
|
75909
|
+
let full_spread = spread / 100 + 1;
|
|
75910
|
+
const stop = kind === "long" ? entry * full_spread ** -1 : entry * full_spread;
|
|
75911
|
+
const side = kind === "long" ? "buy" : "sell";
|
|
75912
|
+
return {
|
|
75913
|
+
price: order.entry,
|
|
75914
|
+
quantity: order.quantity,
|
|
75915
|
+
stop: to_f(stop, price_places || "%.3f"),
|
|
75916
|
+
side,
|
|
75917
|
+
kind,
|
|
75918
|
+
is_market: false
|
|
75919
|
+
};
|
|
75920
|
+
});
|
|
75921
|
+
if (place) {
|
|
75922
|
+
return this._createLimitPurchaseOrders({
|
|
75923
|
+
symbol,
|
|
75924
|
+
price_places,
|
|
75925
|
+
decimal_places,
|
|
75926
|
+
orders: orders_to_place
|
|
75927
|
+
});
|
|
75928
|
+
}
|
|
75929
|
+
return orders_to_place;
|
|
75930
|
+
}
|
|
75900
75931
|
async customStopLoss(payload) {
|
|
75901
75932
|
const {
|
|
75902
75933
|
symbol,
|
|
@@ -80834,10 +80865,8 @@ async function placeStopOrder3(client, payload) {
|
|
|
80834
80865
|
validateQuantity: false,
|
|
80835
80866
|
validatePrice: false
|
|
80836
80867
|
});
|
|
80837
|
-
const
|
|
80838
|
-
|
|
80839
|
-
stop_loss
|
|
80840
|
-
];
|
|
80868
|
+
const filtered = (existingStops || []).filter((s2) => s2.price !== stop_loss.price);
|
|
80869
|
+
const all_stop_losses = [...filtered, stop_loss];
|
|
80841
80870
|
return savePaperDetails(client, {
|
|
80842
80871
|
kind: order.kind,
|
|
80843
80872
|
symbol: payload.symbol,
|