@gbozee/ultimate 0.0.2-69 → 0.0.2-70

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.
@@ -499,6 +499,10 @@ export declare class Strategy {
499
499
  };
500
500
  spread: number;
501
501
  }[];
502
+ /**To be used as one of the agent tools eventually since
503
+ * it is something that can be triggered continously without
504
+ * any risk
505
+ */
502
506
  generateOppositeTrades(payload: {
503
507
  kind: "long" | "short";
504
508
  risk_factor?: number;
@@ -509,6 +513,7 @@ export declare class Strategy {
509
513
  quantity: number;
510
514
  };
511
515
  loss: number;
516
+ profit_percent: number;
512
517
  fee: number;
513
518
  risk_per_trade: number;
514
519
  risk_reward: number;
@@ -2075,7 +2075,8 @@ class Strategy {
2075
2075
  }
2076
2076
  ]), app_config.decimal_places, app_config.price_places);
2077
2077
  const expected_loss = Math.abs(avg.price - stop) * avg.quantity;
2078
- return { ...app_config, avg, loss: -expected_loss };
2078
+ const profit_percent = to_f(this.pnl(kind) * 100 / (avg.price * avg.quantity), "%.3f");
2079
+ return { ...app_config, avg, loss: -expected_loss, profit_percent };
2079
2080
  }
2080
2081
  }
2081
2082
  export {
package/dist/index.cjs CHANGED
@@ -53982,7 +53982,8 @@ class Strategy {
53982
53982
  }
53983
53983
  ]), app_config.decimal_places, app_config.price_places);
53984
53984
  const expected_loss = Math.abs(avg.price - stop) * avg.quantity;
53985
- return { ...app_config, avg, loss: -expected_loss };
53985
+ const profit_percent = to_f2(this.pnl(kind) * 100 / (avg.price * avg.quantity), "%.3f");
53986
+ return { ...app_config, avg, loss: -expected_loss, profit_percent };
53986
53987
  }
53987
53988
  }
53988
53989
 
package/dist/index.d.ts CHANGED
@@ -625,6 +625,10 @@ export declare class Strategy {
625
625
  };
626
626
  spread: number;
627
627
  }[];
628
+ /**To be used as one of the agent tools eventually since
629
+ * it is something that can be triggered continously without
630
+ * any risk
631
+ */
628
632
  generateOppositeTrades(payload: {
629
633
  kind: "long" | "short";
630
634
  risk_factor?: number;
@@ -635,6 +639,7 @@ export declare class Strategy {
635
639
  quantity: number;
636
640
  };
637
641
  loss: number;
642
+ profit_percent: number;
638
643
  fee: number;
639
644
  risk_per_trade: number;
640
645
  risk_reward: number;
package/dist/index.js CHANGED
@@ -53937,7 +53937,8 @@ class Strategy {
53937
53937
  }
53938
53938
  ]), app_config.decimal_places, app_config.price_places);
53939
53939
  const expected_loss = Math.abs(avg.price - stop) * avg.quantity;
53940
- return { ...app_config, avg, loss: -expected_loss };
53940
+ const profit_percent = to_f2(this.pnl(kind) * 100 / (avg.price * avg.quantity), "%.3f");
53941
+ return { ...app_config, avg, loss: -expected_loss, profit_percent };
53941
53942
  }
53942
53943
  }
53943
53944
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-69",
4
+ "version": "0.0.2-70",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",