openbroker 1.1.0 → 1.1.1
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/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env npx tsx
|
|
2
2
|
// Bracket Order - Entry with Take Profit and Stop Loss
|
|
3
3
|
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
4
5
|
import { getClient } from '../core/client.js';
|
|
5
6
|
import { formatUsd, parseArgs, sleep } from '../core/utils.js';
|
|
6
7
|
|
|
@@ -298,4 +299,8 @@ async function main() {
|
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
|
|
301
|
-
|
|
302
|
+
// Only run when invoked as a script — not when imported as a module
|
|
303
|
+
// (e.g. by `openbroker-plugin` via the lib re-export of `runBracket`).
|
|
304
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
305
|
+
main();
|
|
306
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env npx tsx
|
|
2
2
|
// Chase Order - Follow price with limit orders until filled
|
|
3
3
|
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
4
5
|
import { getClient } from '../core/client.js';
|
|
5
6
|
import { formatUsd, parseArgs, sleep } from '../core/utils.js';
|
|
6
7
|
|
|
@@ -253,4 +254,8 @@ async function main() {
|
|
|
253
254
|
}
|
|
254
255
|
}
|
|
255
256
|
|
|
256
|
-
|
|
257
|
+
// Only run when invoked as a script — not when imported as a module
|
|
258
|
+
// (e.g. by `openbroker-plugin` via the lib re-export of `runChase`).
|
|
259
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
260
|
+
main();
|
|
261
|
+
}
|