@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/index.d.ts CHANGED
@@ -94,6 +94,11 @@ export interface ScheduledTrade extends BaseSystemFields {
94
94
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
95
95
  };
96
96
  distribution?: GetEntriesParams["distribution"];
97
+ distribution_params?: {
98
+ curveFactor?: number;
99
+ stdDevFactor?: number;
100
+ lambda?: number;
101
+ };
97
102
  settings?: {
98
103
  gap_trading?: {
99
104
  entry_risk?: number;
@@ -323,6 +328,7 @@ declare abstract class BaseExchange {
323
328
  email: string;
324
329
  }>;
325
330
  proxyAgent?: any;
331
+ remoteActionBaseUrl?: string;
326
332
  constructor(client: any);
327
333
  protected abstract getPositionInfo(symbol: string): Promise<any>;
328
334
  abstract cancelAllOrders(symbol: string, payload: {
@@ -538,7 +544,19 @@ declare abstract class BaseExchange {
538
544
  email: string;
539
545
  }>;
540
546
  proxyAgent?: any;
547
+ remoteActionBaseUrl?: string;
541
548
  }): void;
549
+ getSymbolInformation(payload: {
550
+ symbol: string;
551
+ variant?: "full" | "short";
552
+ }): Promise<{
553
+ candlesticks: Record<string, any[]>;
554
+ resistance: Record<string, number>;
555
+ support: Record<string, number>;
556
+ currentPrice: number;
557
+ minimumWeekly?: number;
558
+ lowest?: number;
559
+ }>;
542
560
  }
543
561
  declare function encryptObject(obj: any, password: string): string;
544
562
  declare function decryptObject(encryptedString: string, password: string): any;
@@ -1044,6 +1062,12 @@ export declare class Strategy {
1044
1062
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
1045
1063
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1046
1064
  };
1065
+ distribution?: GetEntriesParams["distribution"];
1066
+ distribution_params?: {
1067
+ curveFactor?: number;
1068
+ stdDevFactor?: number;
1069
+ lambda?: number;
1070
+ };
1047
1071
  };
1048
1072
  identifyGapConfig(payload: {
1049
1073
  factor?: number;
@@ -1177,12 +1201,22 @@ export type SignalConfigType = {
1177
1201
  short: GetEntriesParams["distribution"];
1178
1202
  };
1179
1203
  max_quantity?: number;
1204
+ distribution_params?: {
1205
+ curveFactor?: number;
1206
+ stdDevFactor?: number;
1207
+ lambda?: number;
1208
+ };
1180
1209
  };
1181
1210
  declare class Signal {
1182
1211
  focus: number;
1183
1212
  budget: number;
1184
1213
  percent_change: number;
1185
1214
  price_places: string;
1215
+ distribution_params: {
1216
+ curveFactor?: number;
1217
+ stdDevFactor?: number;
1218
+ lambda?: number;
1219
+ };
1186
1220
  decimal_places: string;
1187
1221
  zone_risk: number;
1188
1222
  fee: number;
@@ -1210,8 +1244,8 @@ declare class Signal {
1210
1244
  short: GetEntriesParams["distribution"];
1211
1245
  };
1212
1246
  max_quantity: number;
1213
- 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);
1214
- build_entry({ current_price, stop_loss, pnl, stop_percent, kind, risk, no_of_trades, take_profit, distribution, }: {
1247
+ 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);
1248
+ build_entry({ current_price, stop_loss, pnl, stop_percent, kind, risk, no_of_trades, take_profit, distribution, distribution_params, }: {
1215
1249
  take_profit?: number;
1216
1250
  no_of_trades?: number;
1217
1251
  current_price: number;
@@ -1221,6 +1255,11 @@ declare class Signal {
1221
1255
  stop_percent?: number;
1222
1256
  pnl?: number;
1223
1257
  distribution?: GetEntriesParams["distribution"];
1258
+ distribution_params?: {
1259
+ curveFactor?: number;
1260
+ stdDevFactor?: number;
1261
+ lambda?: number;
1262
+ };
1224
1263
  }): any;
1225
1264
  get risk(): number;
1226
1265
  get min_trades(): number;
@@ -1337,6 +1376,12 @@ export type AppConfig = {
1337
1376
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
1338
1377
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1339
1378
  };
1379
+ distribution?: GetEntriesParams["distribution"];
1380
+ distribution_params?: {
1381
+ curveFactor?: number;
1382
+ stdDevFactor?: number;
1383
+ lambda?: number;
1384
+ };
1340
1385
  };
1341
1386
  export type ExtendConfigType = {
1342
1387
  take_profit?: number;
@@ -1360,8 +1405,13 @@ export type ExtendConfigType = {
1360
1405
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
1361
1406
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1362
1407
  distribution?: GetEntriesParams["distribution"];
1408
+ distribution_params?: {
1409
+ curveFactor?: number;
1410
+ stdDevFactor?: number;
1411
+ lambda?: number;
1412
+ };
1363
1413
  };
1364
- 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;
1414
+ 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;
1365
1415
  export declare function buildAvg({ _trades, kind, }: {
1366
1416
  _trades: any[];
1367
1417
  kind: "long" | "short";
@@ -1377,6 +1427,11 @@ export declare function get_app_config_and_max_size(config: GlobalConfig, payloa
1377
1427
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
1378
1428
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1379
1429
  distribution?: GetEntriesParams["distribution"];
1430
+ distribution_params?: {
1431
+ curveFactor?: number;
1432
+ stdDevFactor?: number;
1433
+ lambda?: number;
1434
+ };
1380
1435
  }): {
1381
1436
  app_config: AppConfig;
1382
1437
  max_size: any;
@@ -1402,12 +1457,22 @@ export declare function buildAppConfig(config: GlobalConfig, payload: {
1402
1457
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
1403
1458
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1404
1459
  distribution?: GetEntriesParams["distribution"];
1460
+ distribution_params?: {
1461
+ curveFactor?: number;
1462
+ stdDevFactor?: number;
1463
+ lambda?: number;
1464
+ };
1405
1465
  }): AppConfig;
1406
1466
  export declare function getOptimumStopAndRisk(app_config: AppConfig, params: {
1407
1467
  max_size: number;
1408
1468
  target_stop: number;
1409
1469
  highest_risk?: number;
1410
1470
  distribution?: GetEntriesParams["distribution"];
1471
+ distribution_params?: {
1472
+ curveFactor?: number;
1473
+ stdDevFactor?: number;
1474
+ lambda?: number;
1475
+ };
1411
1476
  }): {
1412
1477
  optimal_stop: number;
1413
1478
  optimal_risk: number;
@@ -1465,6 +1530,11 @@ export declare function generateOptimumAppConfig(config: GlobalConfig, payload:
1465
1530
  start_risk: number;
1466
1531
  max_risk?: number;
1467
1532
  distribution?: GetEntriesParams["distribution"];
1533
+ distribution_params?: {
1534
+ curveFactor?: number;
1535
+ stdDevFactor?: number;
1536
+ lambda?: number;
1537
+ };
1468
1538
  }, position: {
1469
1539
  entry: number;
1470
1540
  quantity: number;
@@ -1477,6 +1547,11 @@ export declare function determineOptimumReward(payload: {
1477
1547
  high_range?: number;
1478
1548
  target_loss?: number;
1479
1549
  distribution?: GetEntriesParams["distribution"];
1550
+ distribution_params?: {
1551
+ curveFactor?: number;
1552
+ stdDevFactor?: number;
1553
+ lambda?: number;
1554
+ };
1480
1555
  max_size?: number;
1481
1556
  }): number | {
1482
1557
  result: any[];
@@ -1496,6 +1571,11 @@ export declare function determineOptimumRisk(config: GlobalConfig, payload: {
1496
1571
  risk: number;
1497
1572
  symbol: string;
1498
1573
  distribution?: GetEntriesParams["distribution"];
1574
+ distribution_params?: {
1575
+ curveFactor?: number;
1576
+ stdDevFactor?: number;
1577
+ lambda?: number;
1578
+ };
1499
1579
  }, params: {
1500
1580
  highest_risk: number;
1501
1581
  tolerance?: number;
@@ -1518,6 +1598,11 @@ export declare function computeRiskReward(payload: {
1518
1598
  risk_per_trade: number;
1519
1599
  target_loss?: number;
1520
1600
  distribution?: GetEntriesParams["distribution"];
1601
+ distribution_params?: {
1602
+ curveFactor?: number;
1603
+ stdDevFactor?: number;
1604
+ lambda?: number;
1605
+ };
1521
1606
  high_range?: number;
1522
1607
  max_size?: number;
1523
1608
  }): number | {
@@ -1540,6 +1625,11 @@ export declare function getRiskReward(payload: {
1540
1625
  target_loss?: number;
1541
1626
  max_size?: number;
1542
1627
  distribution?: GetEntriesParams["distribution"];
1628
+ distribution_params?: {
1629
+ curveFactor?: number;
1630
+ stdDevFactor?: number;
1631
+ lambda?: number;
1632
+ };
1543
1633
  risk_factor?: number;
1544
1634
  high_range?: number;
1545
1635
  }): any;
@@ -1770,6 +1860,14 @@ export declare function constructAppConfig(payload: {
1770
1860
  kelly_minimum_risk: number;
1771
1861
  kelly_prediction_model: string;
1772
1862
  };
1863
+ distribution_config?: {
1864
+ distribution?: GetEntriesParams["distribution"];
1865
+ distribution_params?: {
1866
+ curveFactor?: number;
1867
+ stdDevFactor?: number;
1868
+ lambda?: number;
1869
+ };
1870
+ };
1773
1871
  }): {
1774
1872
  fee: number;
1775
1873
  risk_per_trade: number;
@@ -1804,6 +1902,12 @@ export declare function constructAppConfig(payload: {
1804
1902
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
1805
1903
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1806
1904
  };
1905
+ distribution?: GetEntriesParams["distribution"];
1906
+ distribution_params?: {
1907
+ curveFactor?: number;
1908
+ stdDevFactor?: number;
1909
+ lambda?: number;
1910
+ };
1807
1911
  };
1808
1912
  export declare function generateDangerousConfig(payload: {
1809
1913
  account: PositionsView;
@@ -1847,6 +1951,11 @@ export type TradeConfig = {
1847
1951
  risk: number;
1848
1952
  symbol: string;
1849
1953
  distribution?: GetEntriesParams["distribution"];
1954
+ distribution_params?: {
1955
+ curveFactor?: number;
1956
+ stdDevFactor?: number;
1957
+ lambda?: number;
1958
+ };
1850
1959
  };
1851
1960
  declare function constructAppConfig$1({ config, global_config, }: {
1852
1961
  config: TradeConfig;
@@ -1885,6 +1994,12 @@ declare function constructAppConfig$1({ config, global_config, }: {
1885
1994
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
1886
1995
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
1887
1996
  };
1997
+ distribution?: GetEntriesParams["distribution"];
1998
+ distribution_params?: {
1999
+ curveFactor?: number;
2000
+ stdDevFactor?: number;
2001
+ lambda?: number;
2002
+ };
1888
2003
  };
1889
2004
  declare function buildWithOptimumReward({ config, settings, global_config, force_exact, }: {
1890
2005
  config: TradeConfig;
@@ -1896,6 +2011,11 @@ declare function buildWithOptimumReward({ config, settings, global_config, force
1896
2011
  stop_ratio?: number;
1897
2012
  risk_reward?: number;
1898
2013
  distribution?: GetEntriesParams["distribution"];
2014
+ distribution_params?: {
2015
+ curveFactor?: number;
2016
+ stdDevFactor?: number;
2017
+ lambda?: number;
2018
+ };
1899
2019
  };
1900
2020
  force_exact?: boolean;
1901
2021
  }): {
@@ -1921,7 +2041,7 @@ declare function buildWithOptimumReward({ config, settings, global_config, force
1921
2041
  };
1922
2042
  kind: string;
1923
2043
  };
1924
- declare function generateOppositeOptimum({ config, global_config, settings, ratio, distribution, risk_factor, }: {
2044
+ declare function generateOppositeOptimum({ config, global_config, settings, ratio, distribution, distribution_params, risk_factor, }: {
1925
2045
  settings: {
1926
2046
  entry: number;
1927
2047
  stop: number;
@@ -1932,6 +2052,11 @@ declare function generateOppositeOptimum({ config, global_config, settings, rati
1932
2052
  fee_percent?: number;
1933
2053
  ratio?: number;
1934
2054
  distribution?: any;
2055
+ distribution_params?: {
2056
+ curveFactor?: number;
2057
+ stdDevFactor?: number;
2058
+ lambda?: number;
2059
+ };
1935
2060
  risk_factor?: number;
1936
2061
  }): {
1937
2062
  trades: any[];
@@ -1941,6 +2066,11 @@ declare function generateOppositeOptimum({ config, global_config, settings, rati
1941
2066
  stop: number;
1942
2067
  risk: number;
1943
2068
  distribution: any;
2069
+ distribution_params: {
2070
+ curveFactor?: number;
2071
+ stdDevFactor?: number;
2072
+ lambda?: number;
2073
+ };
1944
2074
  risk_factor: number;
1945
2075
  };
1946
2076
  kind: string;
@@ -1963,7 +2093,7 @@ declare function generateOppositeOptimum({ config, global_config, settings, rati
1963
2093
  config: any;
1964
2094
  kind: string;
1965
2095
  };
1966
- declare function increaseTradeHelper({ increase_qty, stop, config, global_config, style, entry, position, stop_ratio, distribution: default_distribution, }: {
2096
+ declare function increaseTradeHelper({ increase_qty, stop, config, global_config, style, entry, position, stop_ratio, distribution: default_distribution, distribution_params: default_distribution_params, }: {
1967
2097
  position: {
1968
2098
  entry: number;
1969
2099
  quantity: number;
@@ -1976,6 +2106,11 @@ declare function increaseTradeHelper({ increase_qty, stop, config, global_config
1976
2106
  style: "minimum" | "optimum";
1977
2107
  stop_ratio?: number;
1978
2108
  distribution?: any;
2109
+ distribution_params?: {
2110
+ curveFactor?: number;
2111
+ stdDevFactor?: number;
2112
+ lambda?: number;
2113
+ };
1979
2114
  }): {
1980
2115
  trades: any[];
1981
2116
  summary: any;
@@ -2031,7 +2166,7 @@ declare function increaseTradeHelper({ increase_qty, stop, config, global_config
2031
2166
  };
2032
2167
  };
2033
2168
  };
2034
- declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, config, global_config, style, distribution, }: {
2169
+ declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, config, global_config, style, distribution, distribution_params, }: {
2035
2170
  style?: "optimum" | "minimum";
2036
2171
  account: {
2037
2172
  long: {
@@ -2051,6 +2186,11 @@ declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, co
2051
2186
  };
2052
2187
  ratio?: number;
2053
2188
  distribution?: any;
2189
+ distribution_params?: {
2190
+ curveFactor?: number;
2191
+ stdDevFactor?: number;
2192
+ lambda?: number;
2193
+ };
2054
2194
  }): {
2055
2195
  trades: any[];
2056
2196
  summary: any;
@@ -2106,7 +2246,44 @@ declare function generatePositionIncreaseTrade({ account, zoneAccount, ratio, co
2106
2246
  };
2107
2247
  };
2108
2248
  };
2249
+ declare function determineHedgeTradeToPlace({ position, config, global_config, profit_risk, allowable_loss, }: {
2250
+ position: {
2251
+ entry: number;
2252
+ quantity: number;
2253
+ kind: "long" | "short";
2254
+ };
2255
+ config: TradeConfig;
2256
+ global_config: GlobalConfig;
2257
+ profit_risk?: number;
2258
+ allowable_loss?: number;
2259
+ }): {
2260
+ opposite: {
2261
+ trades: any[];
2262
+ summary: {
2263
+ entry: number;
2264
+ stop: number;
2265
+ risk: number;
2266
+ risk_reward: any;
2267
+ avg_entry: number;
2268
+ avg_size: number;
2269
+ first_entry: number;
2270
+ pnl: number;
2271
+ fee: number;
2272
+ loss: number;
2273
+ last_entry: number;
2274
+ margin: number;
2275
+ };
2276
+ config: any;
2277
+ stop_order: {
2278
+ quantity: number;
2279
+ price: number;
2280
+ };
2281
+ kind: string;
2282
+ };
2283
+ take_profit: number;
2284
+ };
2109
2285
  export declare const compoundAPI: {
2286
+ determineHedgeTradeToPlace: typeof determineHedgeTradeToPlace;
2110
2287
  buildWithOptimumReward: typeof buildWithOptimumReward;
2111
2288
  constructAppConfig: typeof constructAppConfig$1;
2112
2289
  generateOppositeOptimum: typeof generateOppositeOptimum;
@@ -2212,6 +2389,11 @@ export declare class ExchangePosition {
2212
2389
  use_current?: boolean;
2213
2390
  stop_percent?: number;
2214
2391
  distribution?: GetEntriesParams["distribution"];
2392
+ distribution_params?: {
2393
+ curveFactor?: number;
2394
+ stdDevFactor?: number;
2395
+ lambda?: number;
2396
+ };
2215
2397
  hedge?: boolean;
2216
2398
  stop_ratio?: number;
2217
2399
  }): Promise<any>;
@@ -2228,6 +2410,12 @@ export declare class ExchangePosition {
2228
2410
  kelly_minimum_risk?: number;
2229
2411
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
2230
2412
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
2413
+ distribution?: GetEntriesParams["distribution"];
2414
+ distribution_params?: {
2415
+ curveFactor?: number;
2416
+ stdDevFactor?: number;
2417
+ lambda?: number;
2418
+ };
2231
2419
  }): Promise<AppConfig>;
2232
2420
  placeConfigOrders(app_config: AppConfig, solution: {
2233
2421
  risk_reward: number;
@@ -2245,6 +2433,11 @@ export declare class ExchangePosition {
2245
2433
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
2246
2434
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
2247
2435
  distribution?: GetEntriesParams["distribution"];
2436
+ distribution_params?: {
2437
+ curveFactor?: number;
2438
+ stdDevFactor?: number;
2439
+ lambda?: number;
2440
+ };
2248
2441
  }, place?: boolean, skip_stop?: boolean): Promise<{
2249
2442
  entry_orders: {
2250
2443
  orders: {
@@ -2513,6 +2706,12 @@ export declare class ExchangePosition {
2513
2706
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
2514
2707
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
2515
2708
  };
2709
+ distribution?: GetEntriesParams["distribution"];
2710
+ distribution_params?: {
2711
+ curveFactor?: number;
2712
+ stdDevFactor?: number;
2713
+ lambda?: number;
2714
+ };
2516
2715
  };
2517
2716
  updateProfitPercentWithRisk(payload: {
2518
2717
  focus_position: ExchangePosition;
@@ -2809,7 +3008,7 @@ declare class ExchangeAccount$1 {
2809
3008
  not_reduce: boolean;
2810
3009
  ratio: any;
2811
3010
  use_full: boolean;
2812
- sell_ratio: any;
3011
+ sell_ratio: number;
2813
3012
  };
2814
3013
  trigger: {
2815
3014
  long: boolean;
@@ -3002,6 +3201,12 @@ declare class ExchangeAccount$1 {
3002
3201
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
3003
3202
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
3004
3203
  };
3204
+ distribution?: GetEntriesParams["distribution"];
3205
+ distribution_params?: {
3206
+ curveFactor?: number;
3207
+ stdDevFactor?: number;
3208
+ lambda?: number;
3209
+ };
3005
3210
  }>;
3006
3211
  runSimulation(payload: {
3007
3212
  symbol: string;
@@ -3210,6 +3415,12 @@ declare class ExchangeAccount$1 {
3210
3415
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
3211
3416
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
3212
3417
  };
3418
+ distribution?: GetEntriesParams["distribution"];
3419
+ distribution_params?: {
3420
+ curveFactor?: number;
3421
+ stdDevFactor?: number;
3422
+ lambda?: number;
3423
+ };
3213
3424
  };
3214
3425
  last_value: any;
3215
3426
  };
@@ -3469,6 +3680,12 @@ declare class App {
3469
3680
  kelly_prediction_model?: "exponential" | "normal" | "uniform";
3470
3681
  kelly_func?: "theoretical" | "position_based" | "theoretical_fixed";
3471
3682
  };
3683
+ distribution?: GetEntriesParams["distribution"];
3684
+ distribution_params?: {
3685
+ curveFactor?: number;
3686
+ stdDevFactor?: number;
3687
+ lambda?: number;
3688
+ };
3472
3689
  };
3473
3690
  last_value: any;
3474
3691
  };