prab-cli 1.2.5 → 1.2.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/index.js +175 -2
- package/dist/lib/crypto/analyzer.js +397 -93
- package/dist/lib/crypto/data-fetcher.js +399 -21
- package/dist/lib/crypto/ict-strategy.js +955 -0
- package/dist/lib/crypto/index.js +24 -1
- package/dist/lib/crypto/orderblock-strategy.js +445 -0
- package/dist/lib/crypto/signal-generator.js +346 -10
- package/dist/lib/crypto/strategy-engine.js +803 -0
- package/dist/lib/crypto/strategy.js +673 -0
- package/dist/lib/slash-commands.js +24 -0
- package/dist/server/index.js +571 -0
- package/package.json +9 -3
package/dist/index.js
CHANGED
|
@@ -172,6 +172,60 @@ program
|
|
|
172
172
|
.action(async (options) => {
|
|
173
173
|
await (0, crypto_1.runCryptoNews)(options.coin);
|
|
174
174
|
});
|
|
175
|
+
// Smart trading strategy
|
|
176
|
+
program
|
|
177
|
+
.command("strategy <crypto>")
|
|
178
|
+
.description("Generate smart trading strategy with entry, exit, and leverage")
|
|
179
|
+
.option("-s, --style <style>", "Trading style: conservative, moderate, aggressive", "moderate")
|
|
180
|
+
.option("-l, --leverage <number>", "Maximum leverage allowed", "20")
|
|
181
|
+
.option("-d, --direction <direction>", "Trade direction: both, long, short", "both")
|
|
182
|
+
.action(async (crypto, options) => {
|
|
183
|
+
const style = ["conservative", "moderate", "aggressive"].includes(options.style)
|
|
184
|
+
? options.style
|
|
185
|
+
: "moderate";
|
|
186
|
+
const maxLeverage = Math.min(parseInt(options.leverage) || 20, 100);
|
|
187
|
+
const direction = ["both", "long", "short"].includes(options.direction)
|
|
188
|
+
? options.direction
|
|
189
|
+
: "both";
|
|
190
|
+
await (0, crypto_1.runStrategy)(crypto, { style, maxLeverage, direction });
|
|
191
|
+
});
|
|
192
|
+
// Order Block trading strategy
|
|
193
|
+
program
|
|
194
|
+
.command("orderblock <crypto>")
|
|
195
|
+
.alias("ob")
|
|
196
|
+
.description("Order Block trading strategy with BUY/SELL signals based on OB zones")
|
|
197
|
+
.option("-i, --interval <interval>", "Time interval (15m, 1h, 4h, 1d)", "4h")
|
|
198
|
+
.action(async (crypto, options) => {
|
|
199
|
+
const validIntervals = ["15m", "1h", "4h", "1d"];
|
|
200
|
+
const interval = validIntervals.includes(options.interval)
|
|
201
|
+
? options.interval
|
|
202
|
+
: "4h";
|
|
203
|
+
await (0, crypto_1.runOrderBlockStrategy)(crypto, interval);
|
|
204
|
+
});
|
|
205
|
+
// ICT (Inner Circle Trader) Strategy
|
|
206
|
+
program
|
|
207
|
+
.command("ict <crypto>")
|
|
208
|
+
.description("ICT trading strategy - Killzones, OTE, Breakers, Silver Bullet, AMD")
|
|
209
|
+
.option("-i, --interval <interval>", "Time interval (15m, 1h, 4h)", "1h")
|
|
210
|
+
.action(async (crypto, options) => {
|
|
211
|
+
const validIntervals = ["15m", "1h", "4h"];
|
|
212
|
+
const interval = validIntervals.includes(options.interval)
|
|
213
|
+
? options.interval
|
|
214
|
+
: "1h";
|
|
215
|
+
await (0, crypto_1.runICTStrategy)(crypto, interval);
|
|
216
|
+
});
|
|
217
|
+
// Smart Trend Confluence Strategy (High Probability)
|
|
218
|
+
program
|
|
219
|
+
.command("smart <crypto>")
|
|
220
|
+
.description("Smart Trend Confluence - High probability strategy with multi-TF analysis")
|
|
221
|
+
.option("-h, --htf <interval>", "Higher timeframe (4h, 1d)", "4h")
|
|
222
|
+
.option("-l, --ltf <interval>", "Lower timeframe (15m, 1h)", "1h")
|
|
223
|
+
.action(async (crypto, options) => {
|
|
224
|
+
const validIntervals = ["15m", "1h", "4h", "1d"];
|
|
225
|
+
const htf = validIntervals.includes(options.htf) ? options.htf : "4h";
|
|
226
|
+
const ltf = validIntervals.includes(options.ltf) ? options.ltf : "1h";
|
|
227
|
+
await (0, crypto_1.runSmartStrategy)(crypto, htf, ltf);
|
|
228
|
+
});
|
|
175
229
|
// Model management commands
|
|
176
230
|
program
|
|
177
231
|
.command("model")
|
|
@@ -336,7 +390,12 @@ program.action(async () => {
|
|
|
336
390
|
default: "btc",
|
|
337
391
|
},
|
|
338
392
|
]);
|
|
339
|
-
|
|
393
|
+
try {
|
|
394
|
+
await (0, crypto_1.comprehensiveAnalysis)(cryptoSymbol);
|
|
395
|
+
}
|
|
396
|
+
catch (err) {
|
|
397
|
+
// Error already handled in comprehensiveAnalysis
|
|
398
|
+
}
|
|
340
399
|
break;
|
|
341
400
|
}
|
|
342
401
|
case "signal": {
|
|
@@ -359,7 +418,12 @@ program.action(async () => {
|
|
|
359
418
|
{ name: "1 Day", value: "1d" },
|
|
360
419
|
],
|
|
361
420
|
});
|
|
362
|
-
|
|
421
|
+
try {
|
|
422
|
+
await (0, crypto_1.fullSignal)(cryptoSymbol, intervalChoice);
|
|
423
|
+
}
|
|
424
|
+
catch (err) {
|
|
425
|
+
// Error already handled in fullSignal
|
|
426
|
+
}
|
|
363
427
|
break;
|
|
364
428
|
}
|
|
365
429
|
case "whale": {
|
|
@@ -418,6 +482,115 @@ program.action(async () => {
|
|
|
418
482
|
await (0, crypto_1.runCryptoNews)(coinFilter);
|
|
419
483
|
break;
|
|
420
484
|
}
|
|
485
|
+
case "strategy": {
|
|
486
|
+
// Prompt for crypto symbol
|
|
487
|
+
const { strategySymbol } = await inquirer_1.default.prompt([
|
|
488
|
+
{
|
|
489
|
+
type: "input",
|
|
490
|
+
name: "strategySymbol",
|
|
491
|
+
message: "Enter cryptocurrency symbol (e.g., btc, eth, sol):",
|
|
492
|
+
default: "btc",
|
|
493
|
+
},
|
|
494
|
+
]);
|
|
495
|
+
// Prompt for trading style
|
|
496
|
+
const styleChoice = await (0, select_1.default)({
|
|
497
|
+
message: "Select your trading style:",
|
|
498
|
+
choices: [
|
|
499
|
+
{ name: "Conservative (5-10x leverage, wider stops)", value: "conservative" },
|
|
500
|
+
{ name: "Moderate (10-20x leverage, balanced) - Recommended", value: "moderate" },
|
|
501
|
+
{ name: "Aggressive (20-50x leverage, tighter stops)", value: "aggressive" },
|
|
502
|
+
],
|
|
503
|
+
});
|
|
504
|
+
// Prompt for direction
|
|
505
|
+
const directionChoice = await (0, select_1.default)({
|
|
506
|
+
message: "Trade direction:",
|
|
507
|
+
choices: [
|
|
508
|
+
{ name: "Both Long & Short", value: "both" },
|
|
509
|
+
{ name: "Long Only", value: "long" },
|
|
510
|
+
{ name: "Short Only", value: "short" },
|
|
511
|
+
],
|
|
512
|
+
});
|
|
513
|
+
await (0, crypto_1.runStrategy)(strategySymbol, {
|
|
514
|
+
style: styleChoice,
|
|
515
|
+
direction: directionChoice,
|
|
516
|
+
maxLeverage: styleChoice === "conservative" ? 10 : styleChoice === "moderate" ? 20 : 50,
|
|
517
|
+
});
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
case "orderblock": {
|
|
521
|
+
// Prompt for crypto symbol
|
|
522
|
+
const { obSymbol } = await inquirer_1.default.prompt([
|
|
523
|
+
{
|
|
524
|
+
type: "input",
|
|
525
|
+
name: "obSymbol",
|
|
526
|
+
message: "Enter cryptocurrency symbol (e.g., btc, eth, sol):",
|
|
527
|
+
default: "btc",
|
|
528
|
+
},
|
|
529
|
+
]);
|
|
530
|
+
// Prompt for timeframe
|
|
531
|
+
const obIntervalChoice = await (0, select_1.default)({
|
|
532
|
+
message: "Select timeframe for Order Block analysis:",
|
|
533
|
+
choices: [
|
|
534
|
+
{ name: "4 Hours (Recommended for swing trades)", value: "4h" },
|
|
535
|
+
{ name: "1 Hour (Intraday trades)", value: "1h" },
|
|
536
|
+
{ name: "15 Minutes (Scalping)", value: "15m" },
|
|
537
|
+
{ name: "1 Day (Position trades)", value: "1d" },
|
|
538
|
+
],
|
|
539
|
+
});
|
|
540
|
+
await (0, crypto_1.runOrderBlockStrategy)(obSymbol, obIntervalChoice);
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
case "ict": {
|
|
544
|
+
// Prompt for crypto symbol
|
|
545
|
+
const { ictSymbol } = await inquirer_1.default.prompt([
|
|
546
|
+
{
|
|
547
|
+
type: "input",
|
|
548
|
+
name: "ictSymbol",
|
|
549
|
+
message: "Enter cryptocurrency symbol (e.g., btc, eth, sol):",
|
|
550
|
+
default: "btc",
|
|
551
|
+
},
|
|
552
|
+
]);
|
|
553
|
+
// Prompt for timeframe
|
|
554
|
+
const ictIntervalChoice = await (0, select_1.default)({
|
|
555
|
+
message: "Select timeframe for ICT analysis:",
|
|
556
|
+
choices: [
|
|
557
|
+
{ name: "1 Hour (Recommended for ICT)", value: "1h" },
|
|
558
|
+
{ name: "15 Minutes (Scalping with Silver Bullet)", value: "15m" },
|
|
559
|
+
{ name: "4 Hours (Higher timeframe bias)", value: "4h" },
|
|
560
|
+
],
|
|
561
|
+
});
|
|
562
|
+
await (0, crypto_1.runICTStrategy)(ictSymbol, ictIntervalChoice);
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
case "smart": {
|
|
566
|
+
// Prompt for crypto symbol
|
|
567
|
+
const { smartSymbol } = await inquirer_1.default.prompt([
|
|
568
|
+
{
|
|
569
|
+
type: "input",
|
|
570
|
+
name: "smartSymbol",
|
|
571
|
+
message: "Enter cryptocurrency symbol (e.g., btc, eth, sol):",
|
|
572
|
+
default: "btc",
|
|
573
|
+
},
|
|
574
|
+
]);
|
|
575
|
+
// Prompt for higher timeframe
|
|
576
|
+
const htfChoice = await (0, select_1.default)({
|
|
577
|
+
message: "Select HIGHER timeframe (for trend direction):",
|
|
578
|
+
choices: [
|
|
579
|
+
{ name: "4 Hours (Recommended)", value: "4h" },
|
|
580
|
+
{ name: "1 Day (Longer-term trend)", value: "1d" },
|
|
581
|
+
],
|
|
582
|
+
});
|
|
583
|
+
// Prompt for lower timeframe
|
|
584
|
+
const ltfChoice = await (0, select_1.default)({
|
|
585
|
+
message: "Select LOWER timeframe (for entry timing):",
|
|
586
|
+
choices: [
|
|
587
|
+
{ name: "1 Hour (Recommended)", value: "1h" },
|
|
588
|
+
{ name: "15 Minutes (Faster entries)", value: "15m" },
|
|
589
|
+
],
|
|
590
|
+
});
|
|
591
|
+
await (0, crypto_1.runSmartStrategy)(smartSymbol, htfChoice, ltfChoice);
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
421
594
|
case "model": {
|
|
422
595
|
// Fetch models from Groq API if not cached
|
|
423
596
|
if (cachedModels.length === 0) {
|