@gbozee/ultimate 0.0.2-204 → 0.0.2-207
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/frontend-index.d.ts +170 -6
- package/dist/frontend-index.js +96 -25
- package/dist/index.cjs +164 -32
- package/dist/index.d.ts +224 -7
- package/dist/index.js +164 -32
- package/dist/mcp-server.cjs +164 -32
- package/dist/mcp-server.js +164 -32
- package/package.json +1 -1
package/dist/frontend-index.d.ts
CHANGED
|
@@ -165,12 +165,22 @@ export type SignalConfigType = {
|
|
|
165
165
|
short: GetEntriesParams["distribution"];
|
|
166
166
|
};
|
|
167
167
|
max_quantity?: number;
|
|
168
|
+
distribution_params?: {
|
|
169
|
+
curveFactor?: number;
|
|
170
|
+
stdDevFactor?: number;
|
|
171
|
+
lambda?: number;
|
|
172
|
+
};
|
|
168
173
|
};
|
|
169
174
|
declare class Signal {
|
|
170
175
|
focus: number;
|
|
171
176
|
budget: number;
|
|
172
177
|
percent_change: number;
|
|
173
178
|
price_places: string;
|
|
179
|
+
distribution_params: {
|
|
180
|
+
curveFactor?: number;
|
|
181
|
+
stdDevFactor?: number;
|
|
182
|
+
lambda?: number;
|
|
183
|
+
};
|
|
174
184
|
decimal_places: string;
|
|
175
185
|
zone_risk: number;
|
|
176
186
|
fee: number;
|
|
@@ -198,8 +208,8 @@ declare class Signal {
|
|
|
198
208
|
short: GetEntriesParams["distribution"];
|
|
199
209
|
};
|
|
200
210
|
max_quantity: number;
|
|
201
|
-
constructor({ focus, symbol, budget, percent_change, price_places, decimal_places, zone_risk, fee, support, risk_reward, resistance, risk_per_trade, increase_size, additional_increase, minimum_pnl, take_profit, increase_position, minimum_size, first_order_size, gap, max_size, use_kelly, kelly_prediction_model, kelly_confidence_factor, kelly_minimum_risk, kelly_func, full_distribution, max_quantity, }: SignalConfigType);
|
|
202
|
-
build_entry({ current_price, stop_loss, pnl, stop_percent, kind, risk, no_of_trades, take_profit, distribution, }: {
|
|
211
|
+
constructor({ focus, symbol, budget, percent_change, price_places, decimal_places, zone_risk, fee, support, risk_reward, resistance, risk_per_trade, increase_size, additional_increase, minimum_pnl, take_profit, increase_position, minimum_size, first_order_size, gap, max_size, use_kelly, kelly_prediction_model, kelly_confidence_factor, kelly_minimum_risk, kelly_func, full_distribution, max_quantity, distribution_params, }: SignalConfigType);
|
|
212
|
+
build_entry({ current_price, stop_loss, pnl, stop_percent, kind, risk, no_of_trades, take_profit, distribution, distribution_params, }: {
|
|
203
213
|
take_profit?: number;
|
|
204
214
|
no_of_trades?: number;
|
|
205
215
|
current_price: number;
|
|
@@ -209,6 +219,11 @@ declare class Signal {
|
|
|
209
219
|
stop_percent?: number;
|
|
210
220
|
pnl?: number;
|
|
211
221
|
distribution?: GetEntriesParams["distribution"];
|
|
222
|
+
distribution_params?: {
|
|
223
|
+
curveFactor?: number;
|
|
224
|
+
stdDevFactor?: number;
|
|
225
|
+
lambda?: number;
|
|
226
|
+
};
|
|
212
227
|
}): any;
|
|
213
228
|
get risk(): number;
|
|
214
229
|
get min_trades(): number;
|
|
@@ -376,6 +391,11 @@ export interface ScheduledTrade extends BaseSystemFields {
|
|
|
376
391
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
377
392
|
};
|
|
378
393
|
distribution?: GetEntriesParams["distribution"];
|
|
394
|
+
distribution_params?: {
|
|
395
|
+
curveFactor?: number;
|
|
396
|
+
stdDevFactor?: number;
|
|
397
|
+
lambda?: number;
|
|
398
|
+
};
|
|
379
399
|
settings?: {
|
|
380
400
|
gap_trading?: {
|
|
381
401
|
entry_risk?: number;
|
|
@@ -518,6 +538,12 @@ export type AppConfig = {
|
|
|
518
538
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
519
539
|
kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
|
|
520
540
|
};
|
|
541
|
+
distribution?: GetEntriesParams["distribution"];
|
|
542
|
+
distribution_params?: {
|
|
543
|
+
curveFactor?: number;
|
|
544
|
+
stdDevFactor?: number;
|
|
545
|
+
lambda?: number;
|
|
546
|
+
};
|
|
521
547
|
};
|
|
522
548
|
export type ExtendConfigType = {
|
|
523
549
|
take_profit?: number;
|
|
@@ -541,8 +567,13 @@ export type ExtendConfigType = {
|
|
|
541
567
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
542
568
|
kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
|
|
543
569
|
distribution?: GetEntriesParams["distribution"];
|
|
570
|
+
distribution_params?: {
|
|
571
|
+
curveFactor?: number;
|
|
572
|
+
stdDevFactor?: number;
|
|
573
|
+
lambda?: number;
|
|
574
|
+
};
|
|
544
575
|
};
|
|
545
|
-
export declare function buildConfig(app_config: AppConfig, { take_profit, entry, stop, raw_instance, risk, no_of_trades, min_profit, risk_reward, kind, increase, gap, rr, price_places, decimal_places, use_kelly, kelly_confidence_factor, kelly_minimum_risk, kelly_prediction_model, kelly_func, min_avg_size, distribution, }: ExtendConfigType): any[] | Signal;
|
|
576
|
+
export declare function buildConfig(app_config: AppConfig, { take_profit, entry, stop, raw_instance, risk, no_of_trades, min_profit, risk_reward, kind, increase, gap, rr, price_places, decimal_places, use_kelly, kelly_confidence_factor, kelly_minimum_risk, kelly_prediction_model, kelly_func, min_avg_size, distribution, distribution_params, }: ExtendConfigType): any[] | Signal;
|
|
546
577
|
export declare function buildAvg({ _trades, kind, }: {
|
|
547
578
|
_trades: any[];
|
|
548
579
|
kind: "long" | "short";
|
|
@@ -558,6 +589,11 @@ export declare function get_app_config_and_max_size(config: GlobalConfig, payloa
|
|
|
558
589
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
559
590
|
kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
|
|
560
591
|
distribution?: GetEntriesParams["distribution"];
|
|
592
|
+
distribution_params?: {
|
|
593
|
+
curveFactor?: number;
|
|
594
|
+
stdDevFactor?: number;
|
|
595
|
+
lambda?: number;
|
|
596
|
+
};
|
|
561
597
|
}): {
|
|
562
598
|
app_config: AppConfig;
|
|
563
599
|
max_size: any;
|
|
@@ -583,12 +619,22 @@ export declare function buildAppConfig(config: GlobalConfig, payload: {
|
|
|
583
619
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
584
620
|
kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
|
|
585
621
|
distribution?: GetEntriesParams["distribution"];
|
|
622
|
+
distribution_params?: {
|
|
623
|
+
curveFactor?: number;
|
|
624
|
+
stdDevFactor?: number;
|
|
625
|
+
lambda?: number;
|
|
626
|
+
};
|
|
586
627
|
}): AppConfig;
|
|
587
628
|
export declare function getOptimumStopAndRisk(app_config: AppConfig, params: {
|
|
588
629
|
max_size: number;
|
|
589
630
|
target_stop: number;
|
|
590
631
|
highest_risk?: number;
|
|
591
632
|
distribution?: GetEntriesParams["distribution"];
|
|
633
|
+
distribution_params?: {
|
|
634
|
+
curveFactor?: number;
|
|
635
|
+
stdDevFactor?: number;
|
|
636
|
+
lambda?: number;
|
|
637
|
+
};
|
|
592
638
|
}): {
|
|
593
639
|
optimal_stop: number;
|
|
594
640
|
optimal_risk: number;
|
|
@@ -646,6 +692,11 @@ export declare function generateOptimumAppConfig(config: GlobalConfig, payload:
|
|
|
646
692
|
start_risk: number;
|
|
647
693
|
max_risk?: number;
|
|
648
694
|
distribution?: GetEntriesParams["distribution"];
|
|
695
|
+
distribution_params?: {
|
|
696
|
+
curveFactor?: number;
|
|
697
|
+
stdDevFactor?: number;
|
|
698
|
+
lambda?: number;
|
|
699
|
+
};
|
|
649
700
|
}, position: {
|
|
650
701
|
entry: number;
|
|
651
702
|
quantity: number;
|
|
@@ -658,6 +709,11 @@ export declare function determineOptimumReward(payload: {
|
|
|
658
709
|
high_range?: number;
|
|
659
710
|
target_loss?: number;
|
|
660
711
|
distribution?: GetEntriesParams["distribution"];
|
|
712
|
+
distribution_params?: {
|
|
713
|
+
curveFactor?: number;
|
|
714
|
+
stdDevFactor?: number;
|
|
715
|
+
lambda?: number;
|
|
716
|
+
};
|
|
661
717
|
max_size?: number;
|
|
662
718
|
}): number | {
|
|
663
719
|
result: any[];
|
|
@@ -677,6 +733,11 @@ export declare function determineOptimumRisk(config: GlobalConfig, payload: {
|
|
|
677
733
|
risk: number;
|
|
678
734
|
symbol: string;
|
|
679
735
|
distribution?: GetEntriesParams["distribution"];
|
|
736
|
+
distribution_params?: {
|
|
737
|
+
curveFactor?: number;
|
|
738
|
+
stdDevFactor?: number;
|
|
739
|
+
lambda?: number;
|
|
740
|
+
};
|
|
680
741
|
}, params: {
|
|
681
742
|
highest_risk: number;
|
|
682
743
|
tolerance?: number;
|
|
@@ -699,6 +760,11 @@ export declare function computeRiskReward(payload: {
|
|
|
699
760
|
risk_per_trade: number;
|
|
700
761
|
target_loss?: number;
|
|
701
762
|
distribution?: GetEntriesParams["distribution"];
|
|
763
|
+
distribution_params?: {
|
|
764
|
+
curveFactor?: number;
|
|
765
|
+
stdDevFactor?: number;
|
|
766
|
+
lambda?: number;
|
|
767
|
+
};
|
|
702
768
|
high_range?: number;
|
|
703
769
|
max_size?: number;
|
|
704
770
|
}): number | {
|
|
@@ -721,6 +787,11 @@ export declare function getRiskReward(payload: {
|
|
|
721
787
|
target_loss?: number;
|
|
722
788
|
max_size?: number;
|
|
723
789
|
distribution?: GetEntriesParams["distribution"];
|
|
790
|
+
distribution_params?: {
|
|
791
|
+
curveFactor?: number;
|
|
792
|
+
stdDevFactor?: number;
|
|
793
|
+
lambda?: number;
|
|
794
|
+
};
|
|
724
795
|
risk_factor?: number;
|
|
725
796
|
high_range?: number;
|
|
726
797
|
}): any;
|
|
@@ -951,6 +1022,14 @@ export declare function constructAppConfig(payload: {
|
|
|
951
1022
|
kelly_minimum_risk: number;
|
|
952
1023
|
kelly_prediction_model: string;
|
|
953
1024
|
};
|
|
1025
|
+
distribution_config?: {
|
|
1026
|
+
distribution?: GetEntriesParams["distribution"];
|
|
1027
|
+
distribution_params?: {
|
|
1028
|
+
curveFactor?: number;
|
|
1029
|
+
stdDevFactor?: number;
|
|
1030
|
+
lambda?: number;
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
954
1033
|
}): {
|
|
955
1034
|
fee: number;
|
|
956
1035
|
risk_per_trade: number;
|
|
@@ -985,6 +1064,12 @@ export declare function constructAppConfig(payload: {
|
|
|
985
1064
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
986
1065
|
kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
|
|
987
1066
|
};
|
|
1067
|
+
distribution?: GetEntriesParams["distribution"];
|
|
1068
|
+
distribution_params?: {
|
|
1069
|
+
curveFactor?: number;
|
|
1070
|
+
stdDevFactor?: number;
|
|
1071
|
+
lambda?: number;
|
|
1072
|
+
};
|
|
988
1073
|
};
|
|
989
1074
|
export declare function generateDangerousConfig(payload: {
|
|
990
1075
|
account: PositionsView;
|
|
@@ -1203,6 +1288,12 @@ export declare class Strategy {
|
|
|
1203
1288
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
1204
1289
|
kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
|
|
1205
1290
|
};
|
|
1291
|
+
distribution?: GetEntriesParams["distribution"];
|
|
1292
|
+
distribution_params?: {
|
|
1293
|
+
curveFactor?: number;
|
|
1294
|
+
stdDevFactor?: number;
|
|
1295
|
+
lambda?: number;
|
|
1296
|
+
};
|
|
1206
1297
|
};
|
|
1207
1298
|
identifyGapConfig(payload: {
|
|
1208
1299
|
factor?: number;
|
|
@@ -1313,6 +1404,11 @@ export type TradeConfig = {
|
|
|
1313
1404
|
risk: number;
|
|
1314
1405
|
symbol: string;
|
|
1315
1406
|
distribution?: GetEntriesParams["distribution"];
|
|
1407
|
+
distribution_params?: {
|
|
1408
|
+
curveFactor?: number;
|
|
1409
|
+
stdDevFactor?: number;
|
|
1410
|
+
lambda?: number;
|
|
1411
|
+
};
|
|
1316
1412
|
};
|
|
1317
1413
|
declare function constructAppConfig$1({ config, global_config, }: {
|
|
1318
1414
|
config: TradeConfig;
|
|
@@ -1351,6 +1447,12 @@ declare function constructAppConfig$1({ config, global_config, }: {
|
|
|
1351
1447
|
kelly_prediction_model?: "exponential" | "normal" | "uniform";
|
|
1352
1448
|
kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
|
|
1353
1449
|
};
|
|
1450
|
+
distribution?: GetEntriesParams["distribution"];
|
|
1451
|
+
distribution_params?: {
|
|
1452
|
+
curveFactor?: number;
|
|
1453
|
+
stdDevFactor?: number;
|
|
1454
|
+
lambda?: number;
|
|
1455
|
+
};
|
|
1354
1456
|
};
|
|
1355
1457
|
declare function buildWithOptimumReward({ config, settings, global_config, force_exact, }: {
|
|
1356
1458
|
config: TradeConfig;
|
|
@@ -1362,6 +1464,11 @@ declare function buildWithOptimumReward({ config, settings, global_config, force
|
|
|
1362
1464
|
stop_ratio?: number;
|
|
1363
1465
|
risk_reward?: number;
|
|
1364
1466
|
distribution?: GetEntriesParams["distribution"];
|
|
1467
|
+
distribution_params?: {
|
|
1468
|
+
curveFactor?: number;
|
|
1469
|
+
stdDevFactor?: number;
|
|
1470
|
+
lambda?: number;
|
|
1471
|
+
};
|
|
1365
1472
|
};
|
|
1366
1473
|
force_exact?: boolean;
|
|
1367
1474
|
}): {
|
|
@@ -1387,7 +1494,7 @@ declare function buildWithOptimumReward({ config, settings, global_config, force
|
|
|
1387
1494
|
};
|
|
1388
1495
|
kind: string;
|
|
1389
1496
|
};
|
|
1390
|
-
declare function generateOppositeOptimum({ config, global_config, settings, ratio, distribution, risk_factor, }: {
|
|
1497
|
+
declare function generateOppositeOptimum({ config, global_config, settings, ratio, distribution, distribution_params, risk_factor, }: {
|
|
1391
1498
|
settings: {
|
|
1392
1499
|
entry: number;
|
|
1393
1500
|
stop: number;
|
|
@@ -1398,6 +1505,11 @@ declare function generateOppositeOptimum({ config, global_config, settings, rati
|
|
|
1398
1505
|
fee_percent?: number;
|
|
1399
1506
|
ratio?: number;
|
|
1400
1507
|
distribution?: any;
|
|
1508
|
+
distribution_params?: {
|
|
1509
|
+
curveFactor?: number;
|
|
1510
|
+
stdDevFactor?: number;
|
|
1511
|
+
lambda?: number;
|
|
1512
|
+
};
|
|
1401
1513
|
risk_factor?: number;
|
|
1402
1514
|
}): {
|
|
1403
1515
|
trades: any[];
|
|
@@ -1407,6 +1519,11 @@ declare function generateOppositeOptimum({ config, global_config, settings, rati
|
|
|
1407
1519
|
stop: number;
|
|
1408
1520
|
risk: number;
|
|
1409
1521
|
distribution: any;
|
|
1522
|
+
distribution_params: {
|
|
1523
|
+
curveFactor?: number;
|
|
1524
|
+
stdDevFactor?: number;
|
|
1525
|
+
lambda?: number;
|
|
1526
|
+
};
|
|
1410
1527
|
risk_factor: number;
|
|
1411
1528
|
};
|
|
1412
1529
|
kind: string;
|
|
@@ -1429,7 +1546,7 @@ declare function generateOppositeOptimum({ config, global_config, settings, rati
|
|
|
1429
1546
|
config: any;
|
|
1430
1547
|
kind: string;
|
|
1431
1548
|
};
|
|
1432
|
-
declare function increaseTradeHelper({ increase_qty, stop, config, global_config, style, entry, position, stop_ratio, distribution: default_distribution, }: {
|
|
1549
|
+
declare function increaseTradeHelper({ increase_qty, stop, config, global_config, style, entry, position, stop_ratio, distribution: default_distribution, distribution_params: default_distribution_params, }: {
|
|
1433
1550
|
position: {
|
|
1434
1551
|
entry: number;
|
|
1435
1552
|
quantity: number;
|
|
@@ -1442,6 +1559,11 @@ declare function increaseTradeHelper({ increase_qty, stop, config, global_config
|
|
|
1442
1559
|
style: "minimum" | "optimum";
|
|
1443
1560
|
stop_ratio?: number;
|
|
1444
1561
|
distribution?: any;
|
|
1562
|
+
distribution_params?: {
|
|
1563
|
+
curveFactor?: number;
|
|
1564
|
+
stdDevFactor?: number;
|
|
1565
|
+
lambda?: number;
|
|
1566
|
+
};
|
|
1445
1567
|
}): {
|
|
1446
1568
|
trades: any[];
|
|
1447
1569
|
summary: any;
|
|
@@ -1497,7 +1619,7 @@ declare function increaseTradeHelper({ increase_qty, stop, config, global_config
|
|
|
1497
1619
|
};
|
|
1498
1620
|
};
|
|
1499
1621
|
};
|
|
1500
|
-
declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, config, global_config, style, distribution, }: {
|
|
1622
|
+
declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, config, global_config, style, distribution, distribution_params, }: {
|
|
1501
1623
|
style?: "optimum" | "minimum";
|
|
1502
1624
|
account: {
|
|
1503
1625
|
long: {
|
|
@@ -1517,6 +1639,11 @@ declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, co
|
|
|
1517
1639
|
};
|
|
1518
1640
|
ratio?: number;
|
|
1519
1641
|
distribution?: any;
|
|
1642
|
+
distribution_params?: {
|
|
1643
|
+
curveFactor?: number;
|
|
1644
|
+
stdDevFactor?: number;
|
|
1645
|
+
lambda?: number;
|
|
1646
|
+
};
|
|
1520
1647
|
}): {
|
|
1521
1648
|
trades: any[];
|
|
1522
1649
|
summary: any;
|
|
@@ -1572,7 +1699,44 @@ declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, co
|
|
|
1572
1699
|
};
|
|
1573
1700
|
};
|
|
1574
1701
|
};
|
|
1702
|
+
declare function determineHedgeTradeToPlace({ position, config, global_config, profit_risk, allowable_loss, }: {
|
|
1703
|
+
position: {
|
|
1704
|
+
entry: number;
|
|
1705
|
+
quantity: number;
|
|
1706
|
+
kind: "long" | "short";
|
|
1707
|
+
};
|
|
1708
|
+
config: TradeConfig;
|
|
1709
|
+
global_config: GlobalConfig;
|
|
1710
|
+
profit_risk?: number;
|
|
1711
|
+
allowable_loss?: number;
|
|
1712
|
+
}): {
|
|
1713
|
+
opposite: {
|
|
1714
|
+
trades: any[];
|
|
1715
|
+
summary: {
|
|
1716
|
+
entry: number;
|
|
1717
|
+
stop: number;
|
|
1718
|
+
risk: number;
|
|
1719
|
+
risk_reward: any;
|
|
1720
|
+
avg_entry: number;
|
|
1721
|
+
avg_size: number;
|
|
1722
|
+
first_entry: number;
|
|
1723
|
+
pnl: number;
|
|
1724
|
+
fee: number;
|
|
1725
|
+
loss: number;
|
|
1726
|
+
last_entry: number;
|
|
1727
|
+
margin: number;
|
|
1728
|
+
};
|
|
1729
|
+
config: any;
|
|
1730
|
+
stop_order: {
|
|
1731
|
+
quantity: number;
|
|
1732
|
+
price: number;
|
|
1733
|
+
};
|
|
1734
|
+
kind: string;
|
|
1735
|
+
};
|
|
1736
|
+
take_profit: number;
|
|
1737
|
+
};
|
|
1575
1738
|
export declare const compoundAPI: {
|
|
1739
|
+
determineHedgeTradeToPlace: typeof determineHedgeTradeToPlace;
|
|
1576
1740
|
buildWithOptimumReward: typeof buildWithOptimumReward;
|
|
1577
1741
|
constructAppConfig: typeof constructAppConfig$1;
|
|
1578
1742
|
generateOppositeOptimum: typeof generateOppositeOptimum;
|